From faa4baaafd8fc903fb8bc28891a99c735bfacf2a Mon Sep 17 00:00:00 2001 From: syo68k Date: Mon, 23 Aug 2010 07:25:19 +0000 Subject: [PATCH] =?utf8?q?API=E7=B0=A1=E6=98=93=E8=A8=88=E7=AE=97=E3=81=A7?= =?utf8?q?=E8=A8=88=E7=AE=97=E7=B5=90=E6=9E=9C=E3=81=8C=E8=A8=AD=E5=AE=9A?= =?utf8?q?=E7=94=BB=E9=9D=A2=E3=81=B8=E5=8F=8D=E6=98=A0=E3=81=95=E3=82=8C?= =?utf8?q?=E3=81=AA=E3=81=84=E3=83=90=E3=82=B0=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@749 e39ad16e-3079-482e-bb30-4b4d378143b6 --- Tween/ApiInformation.vb | 13 +++++++++++-- Tween/Twitter.vb | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Tween/ApiInformation.vb b/Tween/ApiInformation.vb index b8431f00..cbe092a4 100644 --- a/Tween/ApiInformation.vb +++ b/Tween/ApiInformation.vb @@ -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 diff --git a/Tween/Twitter.vb b/Tween/Twitter.vb index fc8d4329..8462d6b9 100644 --- a/Tween/Twitter.vb +++ b/Tween/Twitter.vb @@ -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() -- 2.11.0