• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisionfc38135a14e221e4a1f2ca8ea8e8364437735b94 (tree)
Time2011-01-18 18:59:13
Authorazyobuzin <azyobuzin@user...>
Commiterazyobuzin

Log Message

Ownerプロパティを廃止してGetMainFormメソッドを作成

Change Summary

  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/DirectMessagesTimelineTabPage.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/HomeTimelineTabPage.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/MentionsTabPage.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/TimelineTabPage.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/TwirunrunTabControl.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Extensions.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Forms/MainForm.Designer.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Forms/MainForm.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/TabInfo.cs"

Incremental Difference

--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/DirectMessagesTimelineTabPage.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/DirectMessagesTimelineTabPage.cs"
@@ -5,8 +5,8 @@ namespace Azyobuzi.Twirunrun
55 {
66 public class DirectMessagesTimelineTabPage : TimelineTabPage
77 {
8- public DirectMessagesTimelineTabPage(TwirunrunTabControl owner, TabInfo tabsettings)
9- : base(owner, tabsettings)
8+ public DirectMessagesTimelineTabPage(/*TwirunrunTabControl owner, */TabInfo tabsettings)
9+ : base(/*owner, */tabsettings)
1010 {
1111 RecentStatusesCollection.Instance.CollectionChanged += (sender, e) =>
1212 {
@@ -28,7 +28,7 @@ namespace Azyobuzi.Twirunrun
2828 NotifyStarted();
2929 RecentStatusesCollection.Instance.AddRange(
3030 new[] { DirectMessageType.SentTo, DirectMessageType.SentBy }.SelectMany(type =>
31- Owner.Owner.TwitterContext.DirectMessage.Where(dm =>
31+ this.GetMainForm().TwitterContext.DirectMessage.Where(dm =>
3232 dm.Type == type &&
3333 dm.Page == page &&
3434 dm.Count == count
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/HomeTimelineTabPage.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/HomeTimelineTabPage.cs"
@@ -5,8 +5,8 @@ namespace Azyobuzi.Twirunrun
55 {
66 public class HomeTimelineTabPage : TimelineTabPage
77 {
8- public HomeTimelineTabPage(TwirunrunTabControl owner, TabInfo tabsettings)
9- : base(owner, tabsettings)
8+ public HomeTimelineTabPage(/*TwirunrunTabControl owner, */TabInfo tabsettings)
9+ : base(/*owner, */tabsettings)
1010 {
1111 RecentStatusesCollection.Instance.CollectionChanged += (sender, e) =>
1212 {
@@ -28,7 +28,7 @@ namespace Azyobuzi.Twirunrun
2828 {
2929 NotifyStarted();
3030 RecentStatusesCollection.Instance.AddRange(
31- Owner.Owner.TwitterContext.Status.Where(tweet =>
31+ this.GetMainForm().TwitterContext.Status.Where(tweet =>
3232 tweet.Type == StatusType.Home &&
3333 tweet.Page == page &&
3434 tweet.Count == count
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/MentionsTabPage.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/MentionsTabPage.cs"
@@ -6,8 +6,8 @@ namespace Azyobuzi.Twirunrun
66 {
77 public class MentionsTabPage : TimelineTabPage
88 {
9- public MentionsTabPage(TwirunrunTabControl owner, TabInfo tabsettings)
10- : base(owner, tabsettings)
9+ public MentionsTabPage(/*TwirunrunTabControl owner, */TabInfo tabsettings)
10+ : base(/*owner, */tabsettings)
1111 {
1212 var mentionCheckRegex = new Regex(
1313 string.Format(@"[@@]{0}(\W|$)", Settings.Instance.MyScreenName.RegexEscape()),
@@ -36,7 +36,7 @@ namespace Azyobuzi.Twirunrun
3636 {
3737 NotifyStarted();
3838 RecentStatusesCollection.Instance.AddRange(
39- Owner.Owner.TwitterContext.Status.Where(tweet =>
39+ this.GetMainForm().TwitterContext.Status.Where(tweet =>
4040 tweet.Type == StatusType.Mentions &&
4141 tweet.Page == page &&
4242 tweet.Count == count
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/TimelineTabPage.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/TimelineTabPage.cs"
@@ -7,21 +7,21 @@ namespace Azyobuzi.Twirunrun
77 {
88 public abstract class TimelineTabPage : TabPage
99 {
10- public TimelineTabPage(TwirunrunTabControl owner, TabInfo tabsettings)
10+ public TimelineTabPage(/*TwirunrunTabControl owner, */TabInfo tabsettings)
1111 {
12- Owner = owner;
12+ //Owner = owner;
1313 TabSettings = tabsettings;
1414 this.Text = TabSettings.Name;
1515 Timeline.Dock = DockStyle.Fill;
1616 this.Controls.Add(Timeline);
1717 TabSettings.PropertyChanged += TabSettings_PropertyChanged;
1818 Timeline.SelectedIndexChanged += (sender, e) =>
19- Owner.Owner.ShowDetailStatus(Timeline.Statuses[Timeline.SelectedIndex]);
19+ this.GetMainForm().ShowDetailStatus(Timeline.Statuses[Timeline.SelectedIndex]);
2020 Timeline.DoubleClick += (sender, e) =>
2121 {
2222 if (Timeline.SelectedIndex == -1) return;
2323 var selecting = Timeline.Statuses[Timeline.SelectedIndex];
24- Owner.Owner.UpdateStatusPanel.SetReplyTo(
24+ this.GetMainForm().UpdateStatusPanel.SetReplyTo(
2525 selecting.Type == StatusTypes.Retweet ?
2626 selecting.Tweet.Retweet.ID : selecting.Id,
2727 new[] { selecting.User.Identifier.ScreenName },
@@ -30,7 +30,7 @@ namespace Azyobuzi.Twirunrun
3030 };
3131 }
3232
33- public TwirunrunTabControl Owner { private set; get; }
33+ //public TwirunrunTabControl Owner { private set; get; }
3434
3535 public StatusesListBox Timeline = new StatusesListBox();
3636
@@ -57,7 +57,7 @@ namespace Azyobuzi.Twirunrun
5757 {
5858 refreshing = true;
5959 this.Invoke((MethodInvoker)(() => this.Text = "更新中..."));
60- Owner.Owner.StatusChange(TabSettings.Name + "を更新中");
60+ this.GetMainForm().StatusChange(TabSettings.Name + "を更新中");
6161 }
6262
6363 /// <summary>
@@ -65,7 +65,7 @@ namespace Azyobuzi.Twirunrun
6565 /// </summary>
6666 protected void NotifyCompleted()
6767 {
68- Owner.Owner.StatusChange(TabSettings.Name + ":取得しました");
68+ this.GetMainForm().StatusChange(TabSettings.Name + ":取得しました");
6969 refreshing = false;
7070 this.Invoke((MethodInvoker)(() => this.Text = TabSettings.Name));
7171 }
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/TwirunrunTabControl.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/TwirunrunTabControl.cs"
@@ -9,6 +9,6 @@ namespace Azyobuzi.Twirunrun
99 {
1010 public class TwirunrunTabControl : AnisTabControl
1111 {
12- public ITwirunrunMainForm Owner { get; set; }
12+ //public ITwirunrunMainForm Owner { get; set; }
1313 }
1414 }
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Extensions.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Extensions.cs"
@@ -3,13 +3,14 @@ using System.Collections;
33 using System.Collections.Generic;
44 using System.Collections.Specialized;
55 using System.Drawing;
6+using System.IO;
67 using System.Linq;
78 using System.Net;
89 using System.Text;
910 using System.Text.RegularExpressions;
1011 using System.Web;
12+using System.Windows.Forms;
1113 using System.Xml.Linq;
12-using System.IO;
1314
1415 namespace Azyobuzi.Twirunrun
1516 {
@@ -295,6 +296,11 @@ namespace Azyobuzi.Twirunrun
295296 {
296297 return source.RegexMatch(@"^https?://[\w\d/%#$&?()~_.=+-!]+$");
297298 }
299+
300+ public static ITwirunrunMainForm GetMainForm(this Control control)
301+ {
302+ return control.FindForm() as ITwirunrunMainForm;
303+ }
298304 }
299305
300306 //public class StringRegex
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Forms/MainForm.Designer.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Forms/MainForm.Designer.cs"
@@ -109,7 +109,6 @@
109109 this.timelineTabs.Dock = System.Windows.Forms.DockStyle.Fill;
110110 this.timelineTabs.Location = new System.Drawing.Point(0, 104);
111111 this.timelineTabs.Name = "timelineTabs";
112- this.timelineTabs.Owner = null;
113112 this.timelineTabs.SelectedIndex = 0;
114113 this.timelineTabs.Size = new System.Drawing.Size(371, 156);
115114 this.timelineTabs.SortTabDragDrop = true;
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Forms/MainForm.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Forms/MainForm.cs"
@@ -17,7 +17,7 @@ namespace Azyobuzi.Twirunrun
1717 public MainForm()
1818 {
1919 InitializeComponent();
20- timelineTabs.Owner = this;
20+ //timelineTabs.Owner = this;
2121 }
2222
2323 private string statusBrowserUri = "file:///" + (Application.StartupPath + @"\html\resultPage.html").Replace('\\', '/');
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/TabInfo.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/TabInfo.cs"
@@ -216,9 +216,9 @@ namespace Azyobuzi.Twirunrun
216216 public TimelineTabPage CreateTabPage(TwirunrunTabControl tabControl)
217217 {
218218 return this.Type.SelectCase()
219- .Case(TabTypes.Home, () => new HomeTimelineTabPage(tabControl, this))
220- .Case(TabTypes.Mentions, () => new MentionsTabPage(tabControl, this))
221- .Case(TabTypes.DirectMessages, () => new DirectMessagesTimelineTabPage(tabControl, this))
219+ .Case(TabTypes.Home, () => new HomeTimelineTabPage(/*tabControl, */this))
220+ .Case(TabTypes.Mentions, () => new MentionsTabPage(/*tabControl, */this))
221+ .Case(TabTypes.DirectMessages, () => new DirectMessagesTimelineTabPage(/*tabControl, */this))
222222 .Result as TimelineTabPage;
223223 //TODO
224224 }