上限機能の設定が完成
@@ -65,6 +65,16 @@ | ||
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
68 | + public static int MaxCount | |
69 | + { | |
70 | + set{ | |
71 | + LogSettings_.MaxCount = value; | |
72 | + } | |
73 | + get{ | |
74 | + return LogSettings_.MaxCount; | |
75 | + } | |
76 | + } | |
77 | + | |
68 | 78 | public static int C1 { |
69 | 79 | set { |
70 | 80 | LogSettings_.C1 = value; |
@@ -138,6 +148,7 @@ | ||
138 | 148 | this.Location = new Point(50, 50); |
139 | 149 | this.Size = new Size(390, 336); |
140 | 150 | this.Bottom_panel = 124; |
151 | + this.MaxCount = 50; | |
141 | 152 | |
142 | 153 | this.C1 = 40; |
143 | 154 | this.C2 = 120; |
@@ -157,6 +168,9 @@ | ||
157 | 168 | [XmlElement("bottom_panel")] |
158 | 169 | public int Bottom_panel { set; get; } |
159 | 170 | |
171 | + [XmlElement("max_count")] | |
172 | + public int MaxCount { set; get; } | |
173 | + | |
160 | 174 | //各コラムの幅 |
161 | 175 | [XmlElement("c1")] |
162 | 176 | public int C1 { set; get; } |
@@ -28,20 +28,83 @@ | ||
28 | 28 | /// </summary> |
29 | 29 | private void InitializeComponent() |
30 | 30 | { |
31 | + this.label1 = new System.Windows.Forms.Label(); | |
32 | + this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); | |
33 | + this.okBtn = new System.Windows.Forms.Button(); | |
34 | + this.cancelBtn = new System.Windows.Forms.Button(); | |
35 | + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); | |
31 | 36 | this.SuspendLayout(); |
32 | 37 | // |
38 | + // label1 | |
39 | + // | |
40 | + this.label1.AutoSize = true; | |
41 | + this.label1.Location = new System.Drawing.Point(12, 45); | |
42 | + this.label1.Name = "label1"; | |
43 | + this.label1.Size = new System.Drawing.Size(140, 12); | |
44 | + this.label1.TabIndex = 2; | |
45 | + this.label1.Text = "ログの上限を決めてください :"; | |
46 | + // | |
47 | + // numericUpDown1 | |
48 | + // | |
49 | + this.numericUpDown1.Location = new System.Drawing.Point(70, 70); | |
50 | + this.numericUpDown1.Maximum = new decimal(new int[] { | |
51 | + 2147483647, | |
52 | + 0, | |
53 | + 0, | |
54 | + 0}); | |
55 | + this.numericUpDown1.Name = "numericUpDown1"; | |
56 | + this.numericUpDown1.Size = new System.Drawing.Size(130, 19); | |
57 | + this.numericUpDown1.TabIndex = 3; | |
58 | + // | |
59 | + // okBtn | |
60 | + // | |
61 | + this.okBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); | |
62 | + this.okBtn.Location = new System.Drawing.Point(99, 138); | |
63 | + this.okBtn.Name = "okBtn"; | |
64 | + this.okBtn.Size = new System.Drawing.Size(75, 23); | |
65 | + this.okBtn.TabIndex = 4; | |
66 | + this.okBtn.Text = "OK"; | |
67 | + this.okBtn.UseVisualStyleBackColor = true; | |
68 | + this.okBtn.Click += new System.EventHandler(this.okBtn_Click); | |
69 | + // | |
70 | + // cancelBtn | |
71 | + // | |
72 | + this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); | |
73 | + this.cancelBtn.Location = new System.Drawing.Point(180, 138); | |
74 | + this.cancelBtn.Name = "cancelBtn"; | |
75 | + this.cancelBtn.Size = new System.Drawing.Size(75, 23); | |
76 | + this.cancelBtn.TabIndex = 5; | |
77 | + this.cancelBtn.Text = "Cancel"; | |
78 | + this.cancelBtn.UseVisualStyleBackColor = true; | |
79 | + this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click); | |
80 | + // | |
33 | 81 | // MaxSettingsForm |
34 | 82 | // |
35 | 83 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); |
36 | 84 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
37 | - this.ClientSize = new System.Drawing.Size(292, 273); | |
85 | + this.ClientSize = new System.Drawing.Size(267, 173); | |
86 | + this.Controls.Add(this.label1); | |
87 | + this.Controls.Add(this.cancelBtn); | |
88 | + this.Controls.Add(this.numericUpDown1); | |
89 | + this.Controls.Add(this.okBtn); | |
38 | 90 | this.Name = "MaxSettingsForm"; |
39 | 91 | this.Text = "つぶやきログ"; |
40 | 92 | this.TitleText = "ログ設定"; |
93 | + this.Controls.SetChildIndex(this.okBtn, 0); | |
94 | + this.Controls.SetChildIndex(this.numericUpDown1, 0); | |
95 | + this.Controls.SetChildIndex(this.cancelBtn, 0); | |
96 | + this.Controls.SetChildIndex(this.label1, 0); | |
97 | + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); | |
41 | 98 | this.ResumeLayout(false); |
99 | + this.PerformLayout(); | |
42 | 100 | |
43 | 101 | } |
44 | 102 | |
45 | 103 | #endregion |
104 | + | |
105 | + private System.Windows.Forms.Label label1; | |
106 | + private System.Windows.Forms.NumericUpDown numericUpDown1; | |
107 | + private System.Windows.Forms.Button okBtn; | |
108 | + private System.Windows.Forms.Button cancelBtn; | |
46 | 109 | } |
47 | 110 | } |
\ No newline at end of file |
@@ -13,6 +13,20 @@ | ||
13 | 13 | public MaxSettingsForm() |
14 | 14 | { |
15 | 15 | InitializeComponent(); |
16 | + this.DialogResult = DialogResult.Cancel; | |
16 | 17 | } |
18 | + | |
19 | + private void cancelBtn_Click(object sender, EventArgs e) | |
20 | + { | |
21 | + this.Close(); | |
22 | + } | |
23 | + | |
24 | + private void okBtn_Click(object sender, EventArgs e) | |
25 | + { | |
26 | + LogSettingsManager.MaxCount = (int)numericUpDown1.Value; | |
27 | + LogSettingsManager.Save(); | |
28 | + this.DialogResult = DialogResult.OK; | |
29 | + this.Close(); | |
30 | + } | |
17 | 31 | } |
18 | 32 | } |