OSDN Git Service

API簡易計算で計算結果が設定画面へ反映されないバグ修正
authorsyo68k <syo68k@users.sourceforge.jp>
Mon, 23 Aug 2010 07:25:19 +0000 (07:25 +0000)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sat, 18 Feb 2012 14:14:55 +0000 (23:14 +0900)
git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@749 e39ad16e-3079-482e-bb30-4b4d378143b6

Tween/ApiInformation.vb
Tween/Twitter.vb

index b8431f0..cbe092a 100644 (file)
@@ -26,7 +26,7 @@ Public Class ApiInfo
         Me.RemainCount = _RemainCount
         Me.ResetTime = _ResetTime
         Me.ResetTimeInSeconds = _ResetTimeInSeconds
-        Me.UsingCount = _ResetTimeInSeconds
+        Me.UsingCount = _UsingCount
     End Sub
 End Class
 
@@ -59,7 +59,7 @@ Public Class ApiInformation
         _RemainCount = -1
         _ResetTime = New DateTime
         _ResetTimeInSeconds = -1
-        'UsingCountは初期化対象外
+        '_UsingCount = -1
         RaiseEvent Changed(Me, New ApiInformationChangedEventArgs)
     End Sub
 
@@ -187,6 +187,15 @@ Public Class ApiInformation
         _ResetTime = ResetTimeFromHttpHeader
         Raise_Changed()
     End Sub
+
+    Public Sub WriteBackEventArgs(ByVal arg As ApiInformationChangedEventArgs)
+        _MaxCount = arg.ApiInfo.MaxCount
+        _RemainCount = arg.ApiInfo.RemainCount
+        _ResetTime = arg.ApiInfo.ResetTime
+        _ResetTimeInSeconds = arg.ApiInfo.ResetTimeInSeconds
+        _UsingCount = arg.ApiInfo.UsingCount
+        Raise_Changed()
+    End Sub
 End Class
 
 
index fc8d432..8462d6b 100644 (file)
@@ -2441,6 +2441,7 @@ Public Class Twitter
             arg.ApiInfo.RemainCount = Integer.Parse(xdoc.SelectSingleNode("/hash/remaining-hits").InnerText)
             arg.ApiInfo.ResetTime = DateTime.Parse(xdoc.SelectSingleNode("/hash/reset-time").InnerText)
             arg.ApiInfo.ResetTimeInSeconds = Integer.Parse(xdoc.SelectSingleNode("/hash/reset-time-in-seconds").InnerText)
+            arg.ApiInfo.UsingCount = info.UsingCount
 
             info.MaxCount = arg.ApiInfo.MaxCount
             info.RemainCount = arg.ApiInfo.RemainCount
@@ -2448,6 +2449,7 @@ Public Class Twitter
             info.ResetTimeInSeconds = arg.ApiInfo.ResetTimeInSeconds
 
             RaiseEvent ApiInformationChanged(Me, arg)
+            TwitterApiInfo.WriteBackEventArgs(arg)
             Return True
         Catch ex As Exception
             TwitterApiInfo.Initialize()