• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ

よく使われているワード(クリックで追加)

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

コミットメタ情報

リビジョンb73c3927594e5b31724e0479bee10c9456abb9ea (tree)
日時2011-02-16 01:14:21
作者azyobuzin <azyobuzin@user...>
コミッターazyobuzin

ログメッセージ

・@#の補完(まだ途中)
・RecentStatusesCollectionを扱うところをlockした
・StatusesListViewをWPF風にした
・StatusesListViewでズレに対処
・メイン画面のサイズ・位置の保存を実装

変更サマリ

  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/StatusesListView.cs"
  • 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/UpdateStatusPanel.Designer.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/UpdateStatusTextBox.Designer.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/UpdateStatusTextBox.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/UpdateStatusTextBox.resx"
  • 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/Settings/Settings.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/\202\302\202\242\202\351\202\361\202\351\202\361.csproj"

差分

--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/StatusesListView.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/StatusesListView.cs"
@@ -25,11 +25,14 @@ namespace Azyobuzi.Twirunrun
2525 this.DrawSubItem += this_DrawSubItem;
2626 }
2727
28+ private int oldCount;
29+
2830 private IList<StatusInfo> statuses;
2931 public IList<StatusInfo> Statuses
3032 {
3133 set
3234 {
35+ if (statuses != null) oldCount = statuses.Count;
3336 statuses = value;
3437 SetItemsCount();
3538 }
@@ -39,18 +42,36 @@ namespace Azyobuzi.Twirunrun
3942 }
4043 }
4144
42- public void SetItemsCount(int count)
45+ public void SetItemsCount(int count, int addCount)
4346 {
4447 this.Invoke((MethodInvoker)(() =>
4548 {
4649 VirtualListSize = count;
4750 this.AutoResizeColumn(1, ColumnHeaderAutoResizeStyle.ColumnContent);
51+
52+ if (addCount != 0)
53+ {
54+ var indexes = this.SelectedIndices.Cast<int>().ToArray();
55+ this.SelectedIndices.Clear();
56+ indexes.Select(oldIndex => oldIndex +
57+ (int)Settings.Instance.OrderType.SelectCase()
58+ .Case(OrderTypes.Ascending, () => -1)
59+ .Case(OrderTypes.Descending, () => +1)
60+ .Result
61+ )
62+ .ForEach(newIndex => this.SelectedIndices.Add(newIndex));
63+ }
4864 }));
4965 }
5066
5167 public void SetItemsCount()
5268 {
53- SetItemsCount(Statuses.Count);
69+ SetItemsCount(Statuses.Count, statuses.Count - oldCount);
70+ }
71+
72+ protected override void OnSelectedIndexChanged(EventArgs e)
73+ {
74+ base.OnSelectedIndexChanged(e);
5475 }
5576
5677 private ListViewItem CreateListViewItem(StatusInfo item)
@@ -87,22 +108,22 @@ namespace Azyobuzi.Twirunrun
87108 e.Item = item;
88109 }
89110
90- //ラベルは保留
91111 private void this_DrawSubItem(object sender, DrawListViewSubItemEventArgs e)
92112 {
93113 if (e.ItemIndex < 0 || e.ColumnIndex < 0) return;
94114
95115 e.Graphics.InterpolationMode = InterpolationMode.High;
96116
97- using (var b = new SolidBrush(
98- (e.ItemState & ListViewItemStates.Selected) == ListViewItemStates.Selected ?
99- SystemColors.Highlight : e.SubItem.BackColor))
117+ using (var b = (e.ItemState & ListViewItemStates.Selected) == ListViewItemStates.Selected ?
118+ (Brush)new LinearGradientBrush(e.Bounds, Color.FromArgb(240, 250, 255), Color.FromArgb(170, 240, 255), LinearGradientMode.Vertical)
119+ : (Brush)new SolidBrush(e.SubItem.BackColor))
100120 {
101121 e.Graphics.FillRectangle(b, e.Bounds);
102122 }
103123
104- var foreColor = (e.ItemState & ListViewItemStates.Selected) == ListViewItemStates.Selected ?
105- SystemColors.HighlightText : e.Item.ForeColor;
124+ //var foreColor = (e.ItemState & ListViewItemStates.Selected) == ListViewItemStates.Selected ?
125+ // SystemColors.HighlightText : e.Item.ForeColor;
126+ var foreColor = e.SubItem.ForeColor;
106127
107128 e.ColumnIndex.SelectCase()
108129 .Case(0, () =>//名前部
--- "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"
@@ -10,11 +10,12 @@ namespace Azyobuzi.Twirunrun
1010 {
1111 RecentStatusesCollection.Instance.CollectionChanged += (sender, e) =>
1212 {
13- Timeline.Statuses =
14- RecentStatusesCollection.Instance.AsParallel()
15- .Where(tweet => tweet.Type == StatusTypes.DirectMessage)
16- .OrderBy(Settings.Instance.OrderType)
17- .ToList();
13+ lock (RecentStatusesCollection.Instance)
14+ Timeline.Statuses =
15+ RecentStatusesCollection.Instance.AsParallel()
16+ .Where(tweet => tweet.Type == StatusTypes.DirectMessage)
17+ .OrderBy(Settings.Instance.OrderType)
18+ .ToList();
1819 };
1920 }
2021
@@ -30,9 +31,15 @@ namespace Azyobuzi.Twirunrun
3031 dm.Count == count
3132 )
3233 ).Select(dm => new StatusInfo(dm))
33- .Where(dm => !RecentStatusesCollection.Instance.AsParallel().Contains(dm))
34+ .AsEnumerable()
35+ .Where(dm =>
36+ {
37+ lock (RecentStatusesCollection.Instance)
38+ return !RecentStatusesCollection.Instance.AsParallel().Contains(dm);
39+ })
3440 .ToArray();
35- RecentStatusesCollection.Instance.AddRange(newDMs);
41+ lock (RecentStatusesCollection.Instance)
42+ RecentStatusesCollection.Instance.AddRange(newDMs);
3643 if (!first && newDMs.Any())
3744 this.NotifyNewItems(newDMs.OrderByDescending(_ => _));
3845 }
--- "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"
@@ -10,11 +10,12 @@ namespace Azyobuzi.Twirunrun
1010 {
1111 RecentStatusesCollection.Instance.CollectionChanged += (sender, e) =>
1212 {
13- Timeline.Statuses =
14- RecentStatusesCollection.Instance.AsParallel()
15- .Where(tweet => tweet.Type != StatusTypes.DirectMessage)
16- .OrderBy(Settings.Instance.OrderType)
17- .ToList();
13+ lock (RecentStatusesCollection.Instance)
14+ Timeline.Statuses =
15+ RecentStatusesCollection.Instance.AsParallel()
16+ .Where(tweet => tweet.Type != StatusTypes.DirectMessage)
17+ .OrderBy(Settings.Instance.OrderType)
18+ .ToList();
1819 };
1920 }
2021
@@ -29,9 +30,15 @@ namespace Azyobuzi.Twirunrun
2930 tweet.Count == count
3031 )
3132 .Select(tweet => new StatusInfo(tweet))
32- .Where(tweet => !RecentStatusesCollection.Instance.AsParallel().Contains(tweet))
33+ .AsEnumerable()
34+ .Where(tweet =>
35+ {
36+ lock (RecentStatusesCollection.Instance)
37+ return !RecentStatusesCollection.Instance.AsParallel().Contains(tweet);
38+ })
3339 .ToArray();
34- RecentStatusesCollection.Instance.AddRange(newTweets);
40+ lock (RecentStatusesCollection.Instance)
41+ RecentStatusesCollection.Instance.AddRange(newTweets);
3542 if (!first && newTweets.Any())
3643 this.NotifyNewItems(newTweets.OrderByDescending(_ => _));
3744 }
--- "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"
@@ -16,13 +16,14 @@ namespace Azyobuzi.Twirunrun
1616 RecentStatusesCollection.Instance.CollectionChanged += (sender, e) =>
1717 {
1818 //リストに反映
19- Timeline.Statuses =
20- RecentStatusesCollection.Instance.AsParallel()
21- .Where(tweet =>
22- tweet.Type != StatusTypes.DirectMessage &&
23- mentionCheckRegex.IsMatch(tweet.Text))
24- .OrderBy(Settings.Instance.OrderType)
25- .ToList();
19+ lock (RecentStatusesCollection.Instance)
20+ Timeline.Statuses =
21+ RecentStatusesCollection.Instance.AsParallel()
22+ .Where(tweet =>
23+ tweet.Type != StatusTypes.DirectMessage &&
24+ mentionCheckRegex.IsMatch(tweet.Text))
25+ .OrderBy(Settings.Instance.OrderType)
26+ .ToList();
2627 //新着通知
2728 if (e.NewItems.Count != 0 && !first)
2829 {
@@ -46,10 +47,18 @@ namespace Azyobuzi.Twirunrun
4647 tweet.Count == count
4748 )
4849 .Select(tweet => new StatusInfo(tweet))
49- .Where(tweet => !RecentStatusesCollection.Instance.AsParallel().Contains(tweet))
50+ .AsEnumerable()
51+ .Where(tweet =>
52+ {
53+ lock (RecentStatusesCollection.Instance)
54+ return !RecentStatusesCollection.Instance.AsParallel().Contains(tweet);
55+ })
5056 .ToArray();
5157 if (newTweets.Any())
52- RecentStatusesCollection.Instance.AddRange(newTweets);
58+ {
59+ lock (RecentStatusesCollection.Instance)
60+ RecentStatusesCollection.Instance.AddRange(newTweets);
61+ }
5362 first = false;
5463 }
5564 finally
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/UpdateStatusPanel.Designer.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/UpdateStatusPanel.Designer.cs"
@@ -28,19 +28,17 @@
2828 /// </summary>
2929 private void InitializeComponent()
3030 {
31- this.statusBox = new System.Windows.Forms.TextBox();
31+ this.statusBox = new UpdateStatusTextBox();
3232 this.updateBtn = new System.Windows.Forms.Button();
3333 this.restLbl = new System.Windows.Forms.Label();
3434 this.SuspendLayout();
3535 //
3636 // statusBox
3737 //
38- this.statusBox.AcceptsReturn = true;
3938 this.statusBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
4039 | System.Windows.Forms.AnchorStyles.Left)
4140 | System.Windows.Forms.AnchorStyles.Right)));
4241 this.statusBox.Location = new System.Drawing.Point(3, 3);
43- this.statusBox.Multiline = true;
4442 this.statusBox.Name = "statusBox";
4543 this.statusBox.Size = new System.Drawing.Size(144, 115);
4644 this.statusBox.TabIndex = 0;
@@ -82,7 +80,7 @@
8280
8381 #endregion
8482
85- private System.Windows.Forms.TextBox statusBox;
83+ private UpdateStatusTextBox statusBox;
8684 private System.Windows.Forms.Button updateBtn;
8785 private System.Windows.Forms.Label restLbl;
8886 }
--- /dev/null
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/UpdateStatusTextBox.Designer.cs"
@@ -0,0 +1,102 @@
1+namespace Azyobuzi.Twirunrun
2+{
3+ partial class UpdateStatusTextBox
4+ {
5+ /// <summary>
6+ /// 必要なデザイナー変数です。
7+ /// </summary>
8+ private System.ComponentModel.IContainer components = null;
9+
10+ /// <summary>
11+ /// 使用中のリソースをすべてクリーンアップします。
12+ /// </summary>
13+ /// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
14+ protected override void Dispose(bool disposing)
15+ {
16+ if (disposing && (components != null))
17+ {
18+ components.Dispose();
19+ }
20+ base.Dispose(disposing);
21+ }
22+
23+ #region コンポーネント デザイナーで生成されたコード
24+
25+ /// <summary>
26+ /// デザイナー サポートに必要なメソッドです。このメソッドの内容を
27+ /// コード エディターで変更しないでください。
28+ /// </summary>
29+ private void InitializeComponent()
30+ {
31+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
32+ this.textBox1 = new System.Windows.Forms.TextBox();
33+ this.listBox1 = new System.Windows.Forms.ListBox();
34+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
35+ this.splitContainer1.Panel1.SuspendLayout();
36+ this.splitContainer1.Panel2.SuspendLayout();
37+ this.splitContainer1.SuspendLayout();
38+ this.SuspendLayout();
39+ //
40+ // splitContainer1
41+ //
42+ this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
43+ this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
44+ this.splitContainer1.Location = new System.Drawing.Point(0, 0);
45+ this.splitContainer1.Name = "splitContainer1";
46+ //
47+ // splitContainer1.Panel1
48+ //
49+ this.splitContainer1.Panel1.Controls.Add(this.textBox1);
50+ //
51+ // splitContainer1.Panel2
52+ //
53+ this.splitContainer1.Panel2.Controls.Add(this.listBox1);
54+ this.splitContainer1.Panel2Collapsed = true;
55+ this.splitContainer1.Size = new System.Drawing.Size(150, 150);
56+ this.splitContainer1.SplitterDistance = 25;
57+ this.splitContainer1.TabIndex = 0;
58+ //
59+ // textBox1
60+ //
61+ this.textBox1.AcceptsReturn = true;
62+ this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
63+ this.textBox1.Location = new System.Drawing.Point(0, 0);
64+ this.textBox1.Multiline = true;
65+ this.textBox1.Name = "textBox1";
66+ this.textBox1.Size = new System.Drawing.Size(150, 150);
67+ this.textBox1.TabIndex = 0;
68+ this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown);
69+ this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
70+ //
71+ // listBox1
72+ //
73+ this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
74+ this.listBox1.FormattingEnabled = true;
75+ this.listBox1.ItemHeight = 12;
76+ this.listBox1.Location = new System.Drawing.Point(0, 0);
77+ this.listBox1.Name = "listBox1";
78+ this.listBox1.Size = new System.Drawing.Size(96, 100);
79+ this.listBox1.TabIndex = 0;
80+ //
81+ // UpdateStatusTextBox
82+ //
83+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
84+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
85+ this.Controls.Add(this.splitContainer1);
86+ this.Name = "UpdateStatusTextBox";
87+ this.splitContainer1.Panel1.ResumeLayout(false);
88+ this.splitContainer1.Panel1.PerformLayout();
89+ this.splitContainer1.Panel2.ResumeLayout(false);
90+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
91+ this.splitContainer1.ResumeLayout(false);
92+ this.ResumeLayout(false);
93+
94+ }
95+
96+ #endregion
97+
98+ private System.Windows.Forms.SplitContainer splitContainer1;
99+ private System.Windows.Forms.TextBox textBox1;
100+ private System.Windows.Forms.ListBox listBox1;
101+ }
102+}
--- /dev/null
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/UpdateStatusTextBox.cs"
@@ -0,0 +1,86 @@
1+using System;
2+using System.Collections.Generic;
3+using System.ComponentModel;
4+using System.Drawing;
5+using System.Data;
6+using System.Linq;
7+using System.Text;
8+using System.Windows.Forms;
9+
10+namespace Azyobuzi.Twirunrun
11+{
12+ public partial class UpdateStatusTextBox : UserControl
13+ {
14+ public UpdateStatusTextBox()
15+ {
16+ InitializeComponent();
17+ listBox1.DataSource = Settings.Instance.AtHashtagList;
18+ }
19+
20+ public void Clear()
21+ {
22+ textBox1.Clear();
23+ splitContainer1.Panel2Collapsed = true;
24+ }
25+
26+ [Browsable(true)]
27+ public override string Text
28+ {
29+ get
30+ {
31+ return textBox1.Text;
32+ }
33+ set
34+ {
35+ textBox1.Text = value;
36+ }
37+ }
38+
39+ private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
40+ {
41+ if (e.KeyChar == (char)Keys.Back)
42+ {
43+ if (textBox1.SelectionStart > 0 && "@@##".Contains(textBox1.Text[textBox1.SelectionStart - 1]))
44+ splitContainer1.Panel2Collapsed = true;
45+ else
46+ return;
47+ }
48+ else if (e.KeyChar == (char)Keys.Delete)
49+ {
50+ if (textBox1.SelectionStart != textBox1.TextLength && "@@##".Contains(textBox1.Text[textBox1.SelectionStart]))
51+ splitContainer1.Panel2Collapsed = true;
52+ else
53+ return;
54+ }
55+
56+ if ("@@##".Contains(e.KeyChar))
57+ splitContainer1.Panel2Collapsed = false;
58+ else if (!"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWSYZ_-0123456789".Contains(e.KeyChar))
59+ splitContainer1.Panel2Collapsed = true;
60+ }
61+
62+ public int TextLength
63+ {
64+ get
65+ {
66+ return textBox1.TextLength;
67+ }
68+ }
69+
70+ public void Select(int start, int length)
71+ {
72+ textBox1.Select(start, length);
73+ }
74+
75+ private void textBox1_KeyDown(object sender, KeyEventArgs e)
76+ {
77+ if (!splitContainer1.Panel2Collapsed)
78+ {
79+ if (e.KeyCode == Keys.Down && listBox1.SelectedIndex != listBox1.Items.Count - 1)
80+ listBox1.SelectedIndex++;
81+ else if (e.KeyCode == Keys.Up && listBox1.SelectedIndex > -1)
82+ listBox1.SelectedIndex--;
83+ }
84+ }
85+ }
86+}
--- /dev/null
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/UpdateStatusTextBox.resx"
@@ -0,0 +1,120 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<root>
3+ <!--
4+ Microsoft ResX Schema
5+
6+ Version 2.0
7+
8+ The primary goals of this format is to allow a simple XML format
9+ that is mostly human readable. The generation and parsing of the
10+ various data types are done through the TypeConverter classes
11+ associated with the data types.
12+
13+ Example:
14+
15+ ... ado.net/XML headers & schema ...
16+ <resheader name="resmimetype">text/microsoft-resx</resheader>
17+ <resheader name="version">2.0</resheader>
18+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23+ <value>[base64 mime encoded serialized .NET Framework object]</value>
24+ </data>
25+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27+ <comment>This is a comment</comment>
28+ </data>
29+
30+ There are any number of "resheader" rows that contain simple
31+ name/value pairs.
32+
33+ Each data row contains a name, and value. The row also contains a
34+ type or mimetype. Type corresponds to a .NET class that support
35+ text/value conversion through the TypeConverter architecture.
36+ Classes that don't support this are serialized and stored with the
37+ mimetype set.
38+
39+ The mimetype is used for serialized objects, and tells the
40+ ResXResourceReader how to depersist the object. This is currently not
41+ extensible. For a given mimetype the value must be set accordingly:
42+
43+ Note - application/x-microsoft.net.object.binary.base64 is the format
44+ that the ResXResourceWriter will generate, however the reader can
45+ read any of the formats listed below.
46+
47+ mimetype: application/x-microsoft.net.object.binary.base64
48+ value : The object must be serialized with
49+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50+ : and then encoded with base64 encoding.
51+
52+ mimetype: application/x-microsoft.net.object.soap.base64
53+ value : The object must be serialized with
54+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55+ : and then encoded with base64 encoding.
56+
57+ mimetype: application/x-microsoft.net.object.bytearray.base64
58+ value : The object must be serialized into a byte array
59+ : using a System.ComponentModel.TypeConverter
60+ : and then encoded with base64 encoding.
61+ -->
62+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64+ <xsd:element name="root" msdata:IsDataSet="true">
65+ <xsd:complexType>
66+ <xsd:choice maxOccurs="unbounded">
67+ <xsd:element name="metadata">
68+ <xsd:complexType>
69+ <xsd:sequence>
70+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
71+ </xsd:sequence>
72+ <xsd:attribute name="name" use="required" type="xsd:string" />
73+ <xsd:attribute name="type" type="xsd:string" />
74+ <xsd:attribute name="mimetype" type="xsd:string" />
75+ <xsd:attribute ref="xml:space" />
76+ </xsd:complexType>
77+ </xsd:element>
78+ <xsd:element name="assembly">
79+ <xsd:complexType>
80+ <xsd:attribute name="alias" type="xsd:string" />
81+ <xsd:attribute name="name" type="xsd:string" />
82+ </xsd:complexType>
83+ </xsd:element>
84+ <xsd:element name="data">
85+ <xsd:complexType>
86+ <xsd:sequence>
87+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89+ </xsd:sequence>
90+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93+ <xsd:attribute ref="xml:space" />
94+ </xsd:complexType>
95+ </xsd:element>
96+ <xsd:element name="resheader">
97+ <xsd:complexType>
98+ <xsd:sequence>
99+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100+ </xsd:sequence>
101+ <xsd:attribute name="name" type="xsd:string" use="required" />
102+ </xsd:complexType>
103+ </xsd:element>
104+ </xsd:choice>
105+ </xsd:complexType>
106+ </xsd:element>
107+ </xsd:schema>
108+ <resheader name="resmimetype">
109+ <value>text/microsoft-resx</value>
110+ </resheader>
111+ <resheader name="version">
112+ <value>2.0</value>
113+ </resheader>
114+ <resheader name="reader">
115+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116+ </resheader>
117+ <resheader name="writer">
118+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119+ </resheader>
120+</root>
\ No newline at end of file
--- "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"
@@ -34,14 +34,14 @@
3434 this.ファイルFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
3535 this.fileMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
3636 this.終了XToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
37+ this.ストリーミングSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
38+ this.streamingStateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
39+ this.startStopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
3740 this.postPanelSplitter = new System.Windows.Forms.Splitter();
3841 this.statusStrip1 = new System.Windows.Forms.StatusStrip();
3942 this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel();
4043 this.statusBrowserSplitter = new System.Windows.Forms.Splitter();
4144 this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
42- this.ストリーミングSToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
43- this.streamingStateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
44- this.startStopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
4545 this.timelineTabs = new Azyobuzi.Twirunrun.TwirunrunTabControl();
4646 this.statusBrowser1 = new Azyobuzi.Twirunrun.StatusBrowser();
4747 this.updateStatusPanel1 = new Azyobuzi.Twirunrun.UpdateStatusPanel();
@@ -83,6 +83,29 @@
8383 this.終了XToolStripMenuItem.Text = "終了(&X)";
8484 this.終了XToolStripMenuItem.Click += new System.EventHandler(this.終了XToolStripMenuItem_Click);
8585 //
86+ // ストリーミングSToolStripMenuItem
87+ //
88+ this.ストリーミングSToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
89+ this.streamingStateToolStripMenuItem,
90+ this.startStopToolStripMenuItem});
91+ this.ストリーミングSToolStripMenuItem.Name = "ストリーミングSToolStripMenuItem";
92+ this.ストリーミングSToolStripMenuItem.Size = new System.Drawing.Size(122, 22);
93+ this.ストリーミングSToolStripMenuItem.Text = "ストリーミング(&S)";
94+ //
95+ // streamingStateToolStripMenuItem
96+ //
97+ this.streamingStateToolStripMenuItem.Enabled = false;
98+ this.streamingStateToolStripMenuItem.Name = "streamingStateToolStripMenuItem";
99+ this.streamingStateToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
100+ this.streamingStateToolStripMenuItem.Text = "Stopped";
101+ //
102+ // startStopToolStripMenuItem
103+ //
104+ this.startStopToolStripMenuItem.Name = "startStopToolStripMenuItem";
105+ this.startStopToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
106+ this.startStopToolStripMenuItem.Text = "&Start";
107+ this.startStopToolStripMenuItem.Click += new System.EventHandler(this.startStopToolStripMenuItem_Click);
108+ //
86109 // postPanelSplitter
87110 //
88111 this.postPanelSplitter.Dock = System.Windows.Forms.DockStyle.Top;
@@ -127,29 +150,6 @@
127150 this.notifyIcon1.Visible = true;
128151 this.notifyIcon1.Click += new System.EventHandler(this.notifyIcon1_Click);
129152 //
130- // ストリーミングSToolStripMenuItem
131- //
132- this.ストリーミングSToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
133- this.streamingStateToolStripMenuItem,
134- this.startStopToolStripMenuItem});
135- this.ストリーミングSToolStripMenuItem.Name = "ストリーミングSToolStripMenuItem";
136- this.ストリーミングSToolStripMenuItem.Size = new System.Drawing.Size(122, 22);
137- this.ストリーミングSToolStripMenuItem.Text = "ストリーミング(&S)";
138- //
139- // streamingStateToolStripMenuItem
140- //
141- this.streamingStateToolStripMenuItem.Enabled = false;
142- this.streamingStateToolStripMenuItem.Name = "streamingStateToolStripMenuItem";
143- this.streamingStateToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
144- this.streamingStateToolStripMenuItem.Text = "Stopped";
145- //
146- // startStopToolStripMenuItem
147- //
148- this.startStopToolStripMenuItem.Name = "startStopToolStripMenuItem";
149- this.startStopToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
150- this.startStopToolStripMenuItem.Text = "&Start";
151- this.startStopToolStripMenuItem.Click += new System.EventHandler(this.startStopToolStripMenuItem_Click);
152- //
153153 // timelineTabs
154154 //
155155 this.timelineTabs.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -196,10 +196,13 @@
196196 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
197197 this.MainMenuStrip = this.menuStrip1;
198198 this.Name = "MainForm";
199+ this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
199200 this.Text = "ついるんるん";
200201 this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
201- this.Load += new System.EventHandler(this.Form1_Load);
202+ this.Load += new System.EventHandler(this.MainForm_Load);
202203 this.Shown += new System.EventHandler(this.MainForm_Shown);
204+ this.LocationChanged += new System.EventHandler(this.MainForm_BoundsChanged);
205+ this.SizeChanged += new System.EventHandler(this.MainForm_BoundsChanged);
203206 this.menuStrip1.ResumeLayout(false);
204207 this.menuStrip1.PerformLayout();
205208 this.fileMenuStrip.ResumeLayout(false);
--- "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"
@@ -102,7 +102,7 @@ namespace Azyobuzi.Twirunrun
102102 us.NewDirectMessage += us_NewDirectMessage;
103103 }
104104
105- private void Form1_Load(object sender, EventArgs e)
105+ private void MainForm_Load(object sender, EventArgs e)
106106 {
107107 Icons.AddCompleted =
108108 () => ((TimelineTabPage)timelineTabs.SelectedTab).Timeline.Refresh();
@@ -193,7 +193,8 @@ namespace Azyobuzi.Twirunrun
193193 us.Start(null, false);
194194 else
195195 us.Stop();
196- });
196+ })
197+ .Case("MainFormSetting", () => s.MainFormSetting.Restore(this));
197198 }
198199
199200 private void updateStatusPanel1_RunUpdateStatus(object sender, EventArgs e)
@@ -311,7 +312,7 @@ namespace Azyobuzi.Twirunrun
311312 {
312313 string message;
313314 Exception ex =
314- exception.InnerException == null && exception.InnerException is TwitterQueryException
315+ exception.InnerException == null && !(exception.InnerException is TwitterQueryException)
315316 ? exception : exception.InnerException;
316317 var twitterex = ex as TwitterQueryException;
317318 if (twitterex != null)
@@ -390,8 +391,11 @@ namespace Azyobuzi.Twirunrun
390391 private void us_NewTweet(object sender, NewTweetEventArgs e)
391392 {
392393 var newItem = new StatusInfo(e.Status);
393- if (!RecentStatusesCollection.Instance.AsParallel().Contains(newItem))
394- RecentStatusesCollection.Instance.Add(newItem);
394+ lock (RecentStatusesCollection.Instance)
395+ {
396+ if (!RecentStatusesCollection.Instance.AsParallel().Contains(newItem))
397+ RecentStatusesCollection.Instance.Add(newItem);
398+ }
395399 if (Settings.Instance.StreamingNotifyNewTweet)
396400 NotifyNewItems(new[] { newItem }, "Streaming 新着");
397401 }
@@ -399,8 +403,11 @@ namespace Azyobuzi.Twirunrun
399403 private void us_NewDirectMessage(object sender, NewDirectMessageEventArgs e)
400404 {
401405 var newItem = new StatusInfo(e.DirectMessage);
402- if (!RecentStatusesCollection.Instance.AsParallel().Contains(newItem))
403- RecentStatusesCollection.Instance.Add(newItem);
406+ lock (RecentStatusesCollection.Instance)
407+ {
408+ if (!RecentStatusesCollection.Instance.AsParallel().Contains(newItem))
409+ RecentStatusesCollection.Instance.Add(newItem);
410+ }
404411 if (Settings.Instance.StreamingNotifyNewTweet)
405412 NotifyNewItems(new[] { newItem }, "Streaming 新着DM");
406413 }
@@ -414,5 +421,13 @@ namespace Azyobuzi.Twirunrun
414421 {
415422 this.Visible = true;
416423 }
424+
425+ private void MainForm_BoundsChanged(object sender, EventArgs e)
426+ {
427+ if (this.WindowState == FormWindowState.Normal)
428+ Settings.Instance.MainFormSetting = FormSettings.FromForm(this);
429+ else
430+ Settings.Instance.MainFormSetting.WindowState = this.WindowState;
431+ }
417432 }
418433 }
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Settings/Settings.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Settings/Settings.cs"
@@ -743,6 +743,54 @@ namespace Azyobuzi.Twirunrun
743743 return autoRestart;
744744 }
745745 }
746+
747+
748+ //
749+ //MainFormの設定
750+ //
751+ private FormSettings mainFormSetting = new FormSettings()
752+ #region MainForm初期設定
753+ {
754+ Bounds = new Rectangle(200, 200, 450, 500),
755+ WindowState = FormWindowState.Normal
756+ };
757+ #endregion
758+ public FormSettings MainFormSetting
759+ {
760+ set
761+ {
762+ if (!mainFormSetting.Equals(value))
763+ {
764+ mainFormSetting = value;
765+ OnPropertyChanged("MainFormSetting");
766+ }
767+ }
768+ get
769+ {
770+ return mainFormSetting;
771+ }
772+ }
773+
774+
775+ //
776+ //@・#の履歴
777+ //
778+ private List<string> atHashtagList = new List<string>();
779+ public List<string> AtHashtagList
780+ {
781+ set
782+ {
783+ if (!atHashtagList.SequenceEqual(value))
784+ {
785+ atHashtagList = value;
786+ OnPropertyChanged("AtHashtagList");//あんまり意味無い
787+ }
788+ }
789+ get
790+ {
791+ return atHashtagList;
792+ }
793+ }
746794 }
747795
748796 public class FormSettings : IEquatable<FormSettings>
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/\202\302\202\242\202\351\202\361\202\351\202\361.csproj"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/\202\302\202\242\202\351\202\361\202\351\202\361.csproj"
@@ -103,6 +103,12 @@
103103 <Compile Include="Controls\TwirunrunTabControl.cs">
104104 <SubType>Component</SubType>
105105 </Compile>
106+ <Compile Include="Controls\UpdateStatusTextBox.cs">
107+ <SubType>UserControl</SubType>
108+ </Compile>
109+ <Compile Include="Controls\UpdateStatusTextBox.Designer.cs">
110+ <DependentUpon>UpdateStatusTextBox.cs</DependentUpon>
111+ </Compile>
106112 <Compile Include="DynamicScriptObject.cs" />
107113 <Compile Include="Events.cs" />
108114 <Compile Include="Extensions.cs" />
@@ -231,6 +237,9 @@
231237 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
232238 </Content>
233239 <Content Include="lib\UserStreamEx.XML" />
240+ <EmbeddedResource Include="Controls\UpdateStatusTextBox.resx">
241+ <DependentUpon>UpdateStatusTextBox.cs</DependentUpon>
242+ </EmbeddedResource>
234243 <EmbeddedResource Include="Forms\MainForm.resx">
235244 <DependentUpon>MainForm.cs</DependentUpon>
236245 </EmbeddedResource>