OSDN Git Service

PostClass.CreatedAtの型をDateTimeUtcに変更
[opentween/open-tween.git] / OpenTween / InputTabName.cs
1 // OpenTween - Client of Twitter
2 // Copyright (c) 2007-2011 kiri_feather (@kiri_feather) <kiri.feather@gmail.com>
3 //           (c) 2008-2011 Moz (@syo68k)
4 //           (c) 2008-2011 takeshik (@takeshik) <http://www.takeshik.org/>
5 //           (c) 2010-2011 anis774 (@anis774) <http://d.hatena.ne.jp/anis774/>
6 //           (c) 2010-2011 fantasticswallow (@f_swallow) <http://twitter.com/f_swallow>
7 //           (c) 2011      kim_upsilon (@kim_upsilon) <https://upsilo.net/~upsilon/>
8 // All rights reserved.
9 // 
10 // This file is part of OpenTween.
11 // 
12 // This program is free software; you can redistribute it and/or modify it
13 // under the terms of the GNU General Public License as published by the Free
14 // Software Foundation; either version 3 of the License, or (at your option)
15 // any later version.
16 // 
17 // This program is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 // for more details. 
21 // 
22 // You should have received a copy of the GNU General Public License along
23 // with this program. If not, see <http://www.gnu.org/licenses/>, or write to
24 // the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
25 // Boston, MA 02110-1301, USA.
26
27 using System;
28 using System.Collections.Generic;
29 using System.ComponentModel;
30 using System.Data;
31 using System.Drawing;
32 using System.Linq;
33 using System.Text;
34 using System.Windows.Forms;
35
36 namespace OpenTween
37 {
38     public partial class InputTabName : OTBaseForm
39     {
40         public InputTabName()
41         {
42             InitializeComponent();
43         }
44
45         private void OK_Button_Click(object sender, EventArgs e)
46         {
47             this.DialogResult = DialogResult.OK;
48             this.Close();
49         }
50
51         private void Cancel_Button_Click(object sender, EventArgs e)
52         {
53             TextTabName.Text = "";
54             this.DialogResult = DialogResult.Cancel;
55             this.Close();
56         }
57
58         public string TabName
59         {
60             get => this.TextTabName.Text.Trim();
61             set => TextTabName.Text = value.Trim();
62         }
63
64         public string FormTitle
65         {
66             get => this.Text;
67             set => this.Text = value;
68         }
69
70         public string FormDescription
71         {
72             get => this.LabelDescription.Text;
73             set => this.LabelDescription.Text = value;
74         }
75
76         public bool IsShowUsage { get; set; }
77         public MyCommon.TabUsageType Usage { get; set; }
78
79         private void InputTabName_Load(object sender, EventArgs e)
80         {
81             this.LabelUsage.Visible = false;
82             this.ComboUsage.Visible = false;
83             this.ComboUsage.Items.Add(Properties.Resources.InputTabName_Load1);
84             this.ComboUsage.Items.Add("Lists");
85             this.ComboUsage.Items.Add("PublicSearch");
86             this.ComboUsage.SelectedIndex = 0;
87         }
88
89         private void InputTabName_Shown(object sender, EventArgs e)
90         {
91             ActiveControl = TextTabName;
92             if (this.IsShowUsage)
93             {
94                 this.LabelUsage.Visible = true;
95                 this.ComboUsage.Visible = true;
96             }
97         }
98
99         private void ComboUsage_SelectedIndexChanged(object sender, EventArgs e)
100         {
101             switch (ComboUsage.SelectedIndex)
102             {
103                 case 0:
104                     this.Usage = MyCommon.TabUsageType.UserDefined;
105                     break;
106                 case 1:
107                     this.Usage = MyCommon.TabUsageType.Lists;
108                     break;
109                 case 2:
110                     this.Usage = MyCommon.TabUsageType.PublicSearch;
111                     break;
112                 default:
113                     this.Usage = MyCommon.TabUsageType.Undefined;
114                     break;
115             }
116         }
117     }
118 }