OSDN Git Service

ToolStripAPIGaugeをコンストラクタでの動的追加ではなくデザイナの管理下に移動
authorKimura Youichi <kim.upsilon@bucyou.net>
Sat, 7 Feb 2015 16:45:22 +0000 (01:45 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sat, 7 Feb 2015 16:54:14 +0000 (01:54 +0900)
OpenTween/Tween.Designer.cs
OpenTween/Tween.cs
OpenTween/Tween.resx

index 3f6b287..a23df88 100644 (file)
@@ -21,6 +21,7 @@
             this.StatusStrip1 = new System.Windows.Forms.StatusStrip();
             this.StatusLabelUrl = new System.Windows.Forms.ToolStripStatusLabel();
             this.StatusLabel = new OpenTween.OpenTweenCustomControl.ToolStripLabelHistory();
+            this.toolStripApiGauge = new OpenTween.ToolStripAPIGauge();
             this.HashStripSplitButton = new System.Windows.Forms.ToolStripSplitButton();
             this.ContextMenuPostMode = new System.Windows.Forms.ContextMenuStrip(this.components);
             this.ToolStripMenuItemUrlMultibyteSplit = new System.Windows.Forms.ToolStripMenuItem();
             this.StatusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.StatusLabelUrl,
             this.StatusLabel,
+            this.toolStripApiGauge,
             this.HashStripSplitButton});
             this.StatusStrip1.Name = "StatusStrip1";
             this.StatusStrip1.ShowItemToolTips = true;
             resources.ApplyResources(this.StatusLabel, "StatusLabel");
             this.StatusLabel.DoubleClick += new System.EventHandler(this.StatusLabel_DoubleClick);
             // 
+            // toolStripApiGauge
+            // 
+            this.toolStripApiGauge.ApiEndpoint = null;
+            this.toolStripApiGauge.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right;
+            this.toolStripApiGauge.DoubleClickEnabled = true;
+            this.toolStripApiGauge.Name = "toolStripApiGauge";
+            resources.ApplyResources(this.toolStripApiGauge, "toolStripApiGauge");
+            this.toolStripApiGauge.DoubleClick += new System.EventHandler(this.ApiUsageInfoMenuItem_Click);
+            // 
             // HashStripSplitButton
             // 
             this.HashStripSplitButton.AutoToolTip = false;
         internal System.Windows.Forms.ToolStripMenuItem IconSize48_2ToolStripMenuItem;
         internal System.Windows.Forms.ToolStripSeparator ToolStripSeparator45;
         internal System.Windows.Forms.ToolStripMenuItem LockListSortOrderToolStripMenuItem;
+        private ToolStripAPIGauge toolStripApiGauge;
 
     }
 }
\ No newline at end of file
index 6aabfa3..501cfa4 100644 (file)
@@ -174,7 +174,6 @@ namespace OpenTween
         private StringFormat sfTab = new StringFormat();
 
         //////////////////////////////////////////////////////////////////////////////////////////////////////////
-        private ToolStripAPIGauge _apiGauge;
         private TabInformations _statuses;
 
         // ListViewItem のキャッシュ関連
@@ -356,7 +355,6 @@ namespace OpenTween
                 {
                     _bwFollower.Dispose();
                 }
-                this._apiGauge.Dispose();
                 if (IconCache != null)
                 {
                     this.IconCache.CancelAsync();
@@ -9271,7 +9269,7 @@ namespace OpenTween
         {
             if (_curTab == null)
             {
-                this._apiGauge.ApiEndpoint = null;
+                this.toolStripApiGauge.ApiEndpoint = null;
             }
             else
             {
@@ -9319,7 +9317,7 @@ namespace OpenTween
                             break;
                     }
 
-                    this._apiGauge.ApiEndpoint = endpointName;
+                    this.toolStripApiGauge.ApiEndpoint = endpointName;
                 }
                 else
                 {
@@ -9367,7 +9365,7 @@ namespace OpenTween
 
                     if (update)
                     {
-                        this._apiGauge.ApiEndpoint = endpointName;
+                        this.toolStripApiGauge.ApiEndpoint = endpointName;
                     }
                 }
             }
@@ -12227,12 +12225,6 @@ namespace OpenTween
             // メイリオフォント指定時にタブの最小幅が広くなる問題の対策
             this.ListTab.HandleCreated += (s, e) => NativeMethods.SetMinTabWidth((TabControl)s, 40);
 
-            this._apiGauge = new ToolStripAPIGauge();
-            this._apiGauge.BorderSides = ToolStripStatusLabelBorderSides.Right;
-            this._apiGauge.DoubleClickEnabled = true;
-            this._apiGauge.DoubleClick += this.ApiUsageInfoMenuItem_Click;
-            this.StatusStrip1.Items.Insert(2, this._apiGauge);
-
             this.ImageSelector.Visible = false;
             this.ImageSelector.Enabled = false;
             this.ImageSelector.FilePickDialog = OpenFileDialog1;
index 18e37f6..8651ac5 100644 (file)
   </data>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="StatusLabelUrl.Size" type="System.Drawing.Size, System.Drawing">
-    <value>477, 23</value>
+    <value>401, 23</value>
   </data>
   <data name="StatusLabelUrl.Text" xml:space="preserve">
     <value>ToolStripStatusLabel1</value>
   <data name="StatusLabel.ToolTipText" xml:space="preserve">
     <value>Starting...</value>
   </data>
+  <data name="toolStripApiGauge.Size" type="System.Drawing.Size, System.Drawing">
+    <value>76, 23</value>
+  </data>
+  <data name="toolStripApiGauge.Text" xml:space="preserve">
+    <value>API ???/???</value>
+  </data>
+  <data name="toolStripApiGauge.ToolTipText" xml:space="preserve">
+    <value>API rest unknown ???/???
+(reset after ??? minutes)</value>
+  </data>
   <metadata name="ContextMenuPostMode.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>651, 17</value>
   </metadata>
   <data name="&gt;&gt;StatusLabel.Type" xml:space="preserve">
     <value>OpenTween.OpenTweenCustomControl.ToolStripLabelHistory, OpenTween, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null</value>
   </data>
+  <data name="&gt;&gt;toolStripApiGauge.Name" xml:space="preserve">
+    <value>toolStripApiGauge</value>
+  </data>
+  <data name="&gt;&gt;toolStripApiGauge.Type" xml:space="preserve">
+    <value>OpenTween.ToolStripAPIGauge, OpenTween, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null</value>
+  </data>
   <data name="&gt;&gt;HashStripSplitButton.Name" xml:space="preserve">
     <value>HashStripSplitButton</value>
   </data>