dev
リビジョン | 26cda27512bc6921959e566f6bf7424b1df8b746 (tree) |
---|---|
日時 | 2013-11-04 18:21:44 |
作者 | ANIKITI <anikiti07@gmai...> |
コミッター | ANIKITI |
イベントビューアのイベント別 TabPage を MyCommon.EVENTTYPE から持ってきて作成するよう変更
@@ -29,9 +29,7 @@ | ||
29 | 29 | private void InitializeComponent() |
30 | 30 | { |
31 | 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EventViewerDialog)); |
32 | - this.TabPageUnfav = new System.Windows.Forms.TabPage(); | |
33 | 32 | this.SaveLogButton = new System.Windows.Forms.Button(); |
34 | - this.TabPageFollow = new System.Windows.Forms.TabPage(); | |
35 | 33 | this.CheckBoxFilter = new System.Windows.Forms.CheckBox(); |
36 | 34 | this.TabPageAll = new System.Windows.Forms.TabPage(); |
37 | 35 | this.EventList = new System.Windows.Forms.ListView(); |
@@ -41,16 +39,10 @@ | ||
41 | 39 | this.ColumnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); |
42 | 40 | this.CheckRegex = new System.Windows.Forms.CheckBox(); |
43 | 41 | this.TextBoxKeyword = new System.Windows.Forms.TextBox(); |
44 | - this.TabPageFav = new System.Windows.Forms.TabPage(); | |
45 | 42 | this.StatusLabelCount = new System.Windows.Forms.ToolStripStatusLabel(); |
46 | 43 | this.OK_Button = new System.Windows.Forms.Button(); |
47 | 44 | this.StatusStrip1 = new System.Windows.Forms.StatusStrip(); |
48 | - this.TabPageAddLists = new System.Windows.Forms.TabPage(); | |
49 | 45 | this.TabEventType = new System.Windows.Forms.TabControl(); |
50 | - this.TabPageRemoveLists = new System.Windows.Forms.TabPage(); | |
51 | - this.TabPageListsCreated = new System.Windows.Forms.TabPage(); | |
52 | - this.TabPageBlock = new System.Windows.Forms.TabPage(); | |
53 | - this.TabPageUserUpdate = new System.Windows.Forms.TabPage(); | |
54 | 46 | this.ButtonRefresh = new System.Windows.Forms.Button(); |
55 | 47 | this.CheckExcludeMyEvent = new System.Windows.Forms.CheckBox(); |
56 | 48 | this.SaveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); |
@@ -59,13 +51,6 @@ | ||
59 | 51 | this.TabEventType.SuspendLayout(); |
60 | 52 | this.SuspendLayout(); |
61 | 53 | // |
62 | - // TabPageUnfav | |
63 | - // | |
64 | - resources.ApplyResources(this.TabPageUnfav, "TabPageUnfav"); | |
65 | - this.TabPageUnfav.Name = "TabPageUnfav"; | |
66 | - this.TabPageUnfav.Tag = "Unfavorite"; | |
67 | - this.TabPageUnfav.UseVisualStyleBackColor = true; | |
68 | - // | |
69 | 54 | // SaveLogButton |
70 | 55 | // |
71 | 56 | resources.ApplyResources(this.SaveLogButton, "SaveLogButton"); |
@@ -73,13 +58,6 @@ | ||
73 | 58 | this.SaveLogButton.UseVisualStyleBackColor = true; |
74 | 59 | this.SaveLogButton.Click += new System.EventHandler(this.SaveLogButton_Click); |
75 | 60 | // |
76 | - // TabPageFollow | |
77 | - // | |
78 | - resources.ApplyResources(this.TabPageFollow, "TabPageFollow"); | |
79 | - this.TabPageFollow.Name = "TabPageFollow"; | |
80 | - this.TabPageFollow.Tag = "Follow"; | |
81 | - this.TabPageFollow.UseVisualStyleBackColor = true; | |
82 | - // | |
83 | 61 | // CheckBoxFilter |
84 | 62 | // |
85 | 63 | resources.ApplyResources(this.CheckBoxFilter, "CheckBoxFilter"); |
@@ -141,13 +119,6 @@ | ||
141 | 119 | this.TextBoxKeyword.Name = "TextBoxKeyword"; |
142 | 120 | this.TextBoxKeyword.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBoxKeyword_KeyPress); |
143 | 121 | // |
144 | - // TabPageFav | |
145 | - // | |
146 | - resources.ApplyResources(this.TabPageFav, "TabPageFav"); | |
147 | - this.TabPageFav.Name = "TabPageFav"; | |
148 | - this.TabPageFav.Tag = "Favorite"; | |
149 | - this.TabPageFav.UseVisualStyleBackColor = true; | |
150 | - // | |
151 | 122 | // StatusLabelCount |
152 | 123 | // |
153 | 124 | this.StatusLabelCount.Name = "StatusLabelCount"; |
@@ -167,58 +138,15 @@ | ||
167 | 138 | resources.ApplyResources(this.StatusStrip1, "StatusStrip1"); |
168 | 139 | this.StatusStrip1.Name = "StatusStrip1"; |
169 | 140 | // |
170 | - // TabPageAddLists | |
171 | - // | |
172 | - resources.ApplyResources(this.TabPageAddLists, "TabPageAddLists"); | |
173 | - this.TabPageAddLists.Name = "TabPageAddLists"; | |
174 | - this.TabPageAddLists.Tag = "ListMemberAdded"; | |
175 | - this.TabPageAddLists.UseVisualStyleBackColor = true; | |
176 | - // | |
177 | 141 | // TabEventType |
178 | 142 | // |
179 | 143 | resources.ApplyResources(this.TabEventType, "TabEventType"); |
180 | 144 | this.TabEventType.Controls.Add(this.TabPageAll); |
181 | - this.TabEventType.Controls.Add(this.TabPageFav); | |
182 | - this.TabEventType.Controls.Add(this.TabPageUnfav); | |
183 | - this.TabEventType.Controls.Add(this.TabPageFollow); | |
184 | - this.TabEventType.Controls.Add(this.TabPageAddLists); | |
185 | - this.TabEventType.Controls.Add(this.TabPageRemoveLists); | |
186 | - this.TabEventType.Controls.Add(this.TabPageListsCreated); | |
187 | - this.TabEventType.Controls.Add(this.TabPageBlock); | |
188 | - this.TabEventType.Controls.Add(this.TabPageUserUpdate); | |
189 | 145 | this.TabEventType.Name = "TabEventType"; |
190 | 146 | this.TabEventType.SelectedIndex = 0; |
191 | 147 | this.TabEventType.SelectedIndexChanged += new System.EventHandler(this.TabEventType_SelectedIndexChanged); |
192 | 148 | this.TabEventType.Selecting += new System.Windows.Forms.TabControlCancelEventHandler(this.TabEventType_Selecting); |
193 | 149 | // |
194 | - // TabPageRemoveLists | |
195 | - // | |
196 | - resources.ApplyResources(this.TabPageRemoveLists, "TabPageRemoveLists"); | |
197 | - this.TabPageRemoveLists.Name = "TabPageRemoveLists"; | |
198 | - this.TabPageRemoveLists.Tag = "ListMemberRemoved"; | |
199 | - this.TabPageRemoveLists.UseVisualStyleBackColor = true; | |
200 | - // | |
201 | - // TabPageListsCreated | |
202 | - // | |
203 | - resources.ApplyResources(this.TabPageListsCreated, "TabPageListsCreated"); | |
204 | - this.TabPageListsCreated.Name = "TabPageListsCreated"; | |
205 | - this.TabPageListsCreated.Tag = "ListCreated"; | |
206 | - this.TabPageListsCreated.UseVisualStyleBackColor = true; | |
207 | - // | |
208 | - // TabPageBlock | |
209 | - // | |
210 | - resources.ApplyResources(this.TabPageBlock, "TabPageBlock"); | |
211 | - this.TabPageBlock.Name = "TabPageBlock"; | |
212 | - this.TabPageBlock.Tag = "Block"; | |
213 | - this.TabPageBlock.UseVisualStyleBackColor = true; | |
214 | - // | |
215 | - // TabPageUserUpdate | |
216 | - // | |
217 | - resources.ApplyResources(this.TabPageUserUpdate, "TabPageUserUpdate"); | |
218 | - this.TabPageUserUpdate.Name = "TabPageUserUpdate"; | |
219 | - this.TabPageUserUpdate.Tag = "UserUpdate"; | |
220 | - this.TabPageUserUpdate.UseVisualStyleBackColor = true; | |
221 | - // | |
222 | 150 | // ButtonRefresh |
223 | 151 | // |
224 | 152 | resources.ApplyResources(this.ButtonRefresh, "ButtonRefresh"); |
@@ -263,9 +191,7 @@ | ||
263 | 191 | |
264 | 192 | #endregion |
265 | 193 | |
266 | - internal System.Windows.Forms.TabPage TabPageUnfav; | |
267 | 194 | internal System.Windows.Forms.Button SaveLogButton; |
268 | - internal System.Windows.Forms.TabPage TabPageFollow; | |
269 | 195 | internal System.Windows.Forms.CheckBox CheckBoxFilter; |
270 | 196 | internal System.Windows.Forms.TabPage TabPageAll; |
271 | 197 | internal System.Windows.Forms.ListView EventList; |
@@ -275,16 +201,10 @@ | ||
275 | 201 | internal System.Windows.Forms.ColumnHeader ColumnHeader4; |
276 | 202 | internal System.Windows.Forms.CheckBox CheckRegex; |
277 | 203 | internal System.Windows.Forms.TextBox TextBoxKeyword; |
278 | - internal System.Windows.Forms.TabPage TabPageFav; | |
279 | 204 | internal System.Windows.Forms.ToolStripStatusLabel StatusLabelCount; |
280 | 205 | internal System.Windows.Forms.Button OK_Button; |
281 | 206 | internal System.Windows.Forms.StatusStrip StatusStrip1; |
282 | - internal System.Windows.Forms.TabPage TabPageAddLists; | |
283 | 207 | internal System.Windows.Forms.TabControl TabEventType; |
284 | - internal System.Windows.Forms.TabPage TabPageRemoveLists; | |
285 | - internal System.Windows.Forms.TabPage TabPageListsCreated; | |
286 | - internal System.Windows.Forms.TabPage TabPageBlock; | |
287 | - internal System.Windows.Forms.TabPage TabPageUserUpdate; | |
288 | 208 | internal System.Windows.Forms.Button ButtonRefresh; |
289 | 209 | internal System.Windows.Forms.CheckBox CheckExcludeMyEvent; |
290 | 210 | internal System.Windows.Forms.SaveFileDialog SaveFileDialog1; |
@@ -73,6 +73,12 @@ namespace OpenTween | ||
73 | 73 | |
74 | 74 | private void EventViewerDialog_Shown(object sender, EventArgs e) |
75 | 75 | { |
76 | + // タブ初期化 | |
77 | + foreach (var tabPage in CreateTabsFromUserStreamsEvent()) | |
78 | + { | |
79 | + TabEventType.TabPages.Add(tabPage); | |
80 | + } | |
81 | + | |
76 | 82 | EventList.BeginUpdate(); |
77 | 83 | _curTab = TabEventType.SelectedTab; |
78 | 84 | CreateFilterdEventSource(); |
@@ -266,5 +272,17 @@ namespace OpenTween | ||
266 | 272 | _event.Id.ToString()); |
267 | 273 | } |
268 | 274 | } |
275 | + | |
276 | + private static IEnumerable<TabPage> CreateTabsFromUserStreamsEvent() | |
277 | + { | |
278 | + return Enum.GetNames(typeof(MyCommon.EVENTTYPE)) | |
279 | + .Where(e => e != "None" && e != "All") | |
280 | + .Select(e => new TabPage(e) | |
281 | + { | |
282 | + // Name = "TabPage" + e, | |
283 | + Tag = e, | |
284 | + UseVisualStyleBackColor = true | |
285 | + }); | |
286 | + } | |
269 | 287 | } |
270 | 288 | } |
@@ -3530,7 +3530,8 @@ namespace OpenTween | ||
3530 | 3530 | evt.Target = ""; |
3531 | 3531 | break; |
3532 | 3532 | case "unfollow": |
3533 | - return; | |
3533 | + evt.Target = "@" + eventData.Target.ScreenName; | |
3534 | + break; | |
3534 | 3535 | case "favorite": |
3535 | 3536 | case "unfavorite": |
3536 | 3537 | evt.Target = "@" + eventData.TargetObject.User.ScreenName + ":" + WebUtility.HtmlDecode(eventData.TargetObject.Text); |
@@ -3589,6 +3590,8 @@ namespace OpenTween | ||
3589 | 3590 | case "list_member_added": |
3590 | 3591 | case "list_member_removed": |
3591 | 3592 | case "list_updated": |
3593 | + case "list_user_subscribed": | |
3594 | + case "list_user_unsubscribed": | |
3592 | 3595 | evt.Target = eventData.TargetObject.FullName; |
3593 | 3596 | break; |
3594 | 3597 | case "block": |
@@ -3605,9 +3608,6 @@ namespace OpenTween | ||
3605 | 3608 | case "list_created": |
3606 | 3609 | evt.Target = ""; |
3607 | 3610 | break; |
3608 | - case "list_user_subscribed": | |
3609 | - case "list_user_unsubscribed": | |
3610 | - return; | |
3611 | 3611 | default: |
3612 | 3612 | MyCommon.TraceOut("Unknown Event:" + evt.Event + Environment.NewLine + content); |
3613 | 3613 | break; |