private void createMSN() { client = new MSNClient(testSender, "846266"); client.Msg = Msg; client.Prefix = "1: "; client.SendFinish += new SendFinishEventHandler(client_SendFinish); client.HadSomeError += new HadSomeErrorEventHandler(client_HadSomeError); client.SendOneOfflineFinish += new SendOneOfflineFinishEventHandler(client_SendOneFinish); client.SendOneOnlineFinish += new SendOneOnlineFinishEventHandler(client_SendOneFinish); client.SynchronizationCompleted += new SynchronizationCompletedEventHandler(client_SynchronizationCompleted); client.Login(); }
private void CreateMSN() { if (!running || msnList.Count >= this.threadcount) { return; } if (msnList.Count > 0 && onLoging) { return; } string name; try { name = this.senders.Get(); } catch (NotDataException) { if (this.autoReload) { exclude.Clear(); this.senders.ReLoad(); Console.WriteLine("reload"); CreateMSN(); return; } Console.WriteLine("All Sender Finish"); running = false; return; } count++; MSNClient client = new MSNClient(name, "846266"); client.Msg = Msg; client.Prefix = string.Format("{0} ", count); client.Exclude = exclude; client.Online = online; client.SendFinish += new SendFinishEventHandler(client_SendFinish); client.HadSomeError += new HadSomeErrorEventHandler(client_HadSomeError); client.SendOneOfflineFinish += new SendOneOfflineFinishEventHandler(client_SendOneFinish); client.SendOneOnlineFinish += new SendOneOnlineFinishEventHandler(client_SendOneFinish); client.SynchronizationCompleted += new SynchronizationCompletedEventHandler(client_SynchronizationCompleted); client.ContactService_AfterCompleted += new ContactService_AfterCompletedEventHandler(client_ContactService_AfterCompleted); client.ContactService_ServiceOperationFailed += new ContactService_ServiceOperationFailedEventHandler(client_ContactService_ServiceOperationFailed); lock (this) { this.msnList[name] = client; } onLoging = true; client.Login(); }
private void createMSN() { if (!running) { return; } if (msnList.Count > threadcount) { return; } string name; try { name = this.senders.Get(); } catch (NotDataException) { Console.WriteLine("All Sender Finish"); running = false; return; } count++; MSNClient client = new MSNClient(name, "846266"); client.Prefix = string.Format("{0} ", count); client.HadSomeError += new HadSomeErrorEventHandler(client_HadSomeError); client.SynchronizationCompleted += new SynchronizationCompletedEventHandler(client_SynchronizationCompleted); client.ContactService_AfterCompleted += new ContactService_AfterCompletedEventHandler(client_ContactService_AfterCompleted); client.ContactService_ServiceOperationFailed += new ContactService_ServiceOperationFailedEventHandler(client_ContactService_ServiceOperationFailed); lock (this) { this.msnList[name] = client; } client.Login(); }
private void createMSN() { if (!running) return; if (msnList.Count > threadcount) return; string name; try { name = this.senders.Get(); } catch (NotDataException) { Console.WriteLine("All Sender Finish"); running = false; return; } count ++; MSNClient client = new MSNClient(name, "846266"); client.Prefix = string.Format("{0} ", count); client.HadSomeError += new HadSomeErrorEventHandler(client_HadSomeError); client.SynchronizationCompleted += new SynchronizationCompletedEventHandler(client_SynchronizationCompleted); client.ContactService_AfterCompleted+=new ContactService_AfterCompletedEventHandler(client_ContactService_AfterCompleted); client.ContactService_ServiceOperationFailed+=new ContactService_ServiceOperationFailedEventHandler(client_ContactService_ServiceOperationFailed); lock (this) { this.msnList[name] = client; } client.Login(); }
private void CreateMSN() { if (!running || msnList.Count >= this.threadcount) return; if (msnList.Count > 0 && onLoging) return; string name; try { name = this.senders.Get(); } catch (NotDataException) { if (this.autoReload) { exclude.Clear(); this.senders.ReLoad(); Console.WriteLine("reload"); CreateMSN(); return; } Console.WriteLine("All Sender Finish"); running = false; return; } count ++; MSNClient client = new MSNClient(name, "846266"); client.Msg = Msg; client.Prefix = string.Format("{0} ", count); client.Exclude = exclude; client.Online = online; client.SendFinish += new SendFinishEventHandler(client_SendFinish); client.HadSomeError += new HadSomeErrorEventHandler(client_HadSomeError); client.SendOneOfflineFinish += new SendOneOfflineFinishEventHandler(client_SendOneFinish); client.SendOneOnlineFinish += new SendOneOnlineFinishEventHandler(client_SendOneFinish); client.SynchronizationCompleted += new SynchronizationCompletedEventHandler(client_SynchronizationCompleted); client.ContactService_AfterCompleted += new ContactService_AfterCompletedEventHandler(client_ContactService_AfterCompleted); client.ContactService_ServiceOperationFailed += new ContactService_ServiceOperationFailedEventHandler(client_ContactService_ServiceOperationFailed); lock (this) { this.msnList[name] = client; } onLoging = true; client.Login(); }