Changeset 383
- Timestamp:
- 05/15/08 03:33:19 (6 months ago)
- Location:
- TwitterIrcGateway/branches/im-support/TwitterIrcGatewayCore
- Files:
-
- 2 modified
-
Session.cs (modified) (1 diff)
-
TwitterIMService.cs (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
TwitterIrcGateway/branches/im-support/TwitterIrcGatewayCore/Session.cs
r382 r383 941 941 _twitterIm.Logined += new EventHandler(twitterIm_Logined); 942 942 _twitterIm.AuthErrored += new EventHandler(twitterIm_AuthErrored); 943 _twitterIm.SocketErrorHandled += new EventHandler<TwitterIMService.ErrorEventArgs>(twitterIm_SocketErrorHandled); 943 944 _twitterIm.Open(); 945 } 946 947 void twitterIm_SocketErrorHandled(object sender, TwitterIMService.ErrorEventArgs e) 948 { 949 SendTwitterGatewayServerMessage("インスタントメッセージングサービスの接続でエラーが発生しました: " + e.Exception.Message); 944 950 } 945 951 void twitterIm_Logined(object sender, EventArgs e) -
TwitterIrcGateway/branches/im-support/TwitterIrcGatewayCore/TwitterIMService.cs
r382 r383 16 16 public event EventHandler<StatusUpdateReceivedEventArgs> StatusUpdateReceived; 17 17 public event EventHandler Logined; 18 public event EventHandler ErrorHandled; 18 public event EventHandler<ErrorEventArgs> ErrorHandled; 19 public event EventHandler<ErrorEventArgs> SocketErrorHandled; 19 20 public event EventHandler AuthErrored; 20 21 … … 32 33 _xmppConnection.OnError += new ErrorHandler(xmppConnection_OnError); 33 34 _xmppConnection.OnMessage += new agsXMPP.protocol.client.MessageHandler(xmppConnection_OnMessage); 35 _xmppConnection.OnSocketError += new ErrorHandler(xmppConnection_OnSocketError); 34 36 } 35 37 … … 92 94 } 93 95 96 void xmppConnection_OnSocketError(object sender, Exception ex) 97 { 98 OnSocketErrorHandled(ex); 99 } 100 94 101 void xmppConnection_OnError(object sender, Exception ex) 95 102 { 96 103 Trace.WriteLine(ex); 104 OnErrorHandled(ex); 97 105 } 98 106 #endregion … … 104 112 Logined(this, EventArgs.Empty); 105 113 } 106 private void OnErrorHandled( )114 private void OnErrorHandled(Exception ex) 107 115 { 108 116 if (ErrorHandled != null) 109 ErrorHandled(this, EventArgs.Empty); 117 ErrorHandled(this, new ErrorEventArgs(ex)); 118 } 119 private void OnSocketErrorHandled(Exception ex) 120 { 121 if (SocketErrorHandled != null) 122 SocketErrorHandled(this, new ErrorEventArgs(ex)); 110 123 } 111 124 private void OnAuthErrored() … … 118 131 if (StatusUpdateReceived != null) 119 132 StatusUpdateReceived(this, new StatusUpdateReceivedEventArgs(status)); 133 } 134 135 public class ErrorEventArgs : EventArgs 136 { 137 public Exception Exception { get; set; } 138 139 public ErrorEventArgs(Exception ex) 140 { 141 this.Exception = ex; 142 } 120 143 } 121 144
