internal void SetStatus(MSNStatus newStatus) { if (this.status != newStatus) { MSNStatus status1 = this.status; this.status = newStatus; if (this.StatusChanged != null) { this.StatusChanged(this, new StatusChangeEventArgs(status1)); } if ((status1 == MSNStatus.Offline) && (this.ContactOnline != null)) { this.ContactOnline(this, new EventArgs()); } if ((newStatus == MSNStatus.Offline) && (this.ContactOffline != null)) { this.ContactOffline(this, new StatusChangeEventArgs(status1)); } } }
// Methods public ContactStatusChangeEventArgs(Contact contact, MSNStatus oldStatus) { this.Contact = contact; this.OldStatus = oldStatus; }
protected string ParseStatus(MSNStatus status) { switch (status) { case MSNStatus.Offline: { return "FLN"; } case MSNStatus.Hidden: { return "HDN"; } case MSNStatus.Online: { return "NLN"; } case MSNStatus.Away: { return "AWY"; } case MSNStatus.Busy: { return "BSY"; } case MSNStatus.BRB: { return "BRB"; } case MSNStatus.Lunch: { return "LUN"; } case MSNStatus.Phone: { return "PHN"; } case MSNStatus.Idle: { return "IDL"; } } return "Unknown status"; }
public void SetStatus(MSNStatus status) { if (!this.synSended) { throw new MSNException("Can't set status. You must call SynchronizeList() before you can set an initial status."); } object[] objArray1 = new object[5] { "CHG ", this.NewTrans(), " ", this.ParseStatus(status), " 0\r\n" } ; this.SocketSend(string.Concat(objArray1)); }
public Messenger() { this.messengerServer = IPAddress.Parse("64.4.13.17"); this.lastContactSynced = null; this.syncContactsCount = 0; this.networkConnected = false; this.InitialStatus = MSNStatus.Online; this.log = new ArrayList(); this.conversationQueue = new Queue(); this.conversationList = new ArrayList(); this.contacts = new Messenger.ContactList(); this.contactGroups = new Hashtable(); this.currentTransaction = 0; this.TextEncoding = new UTF8Encoding(); this.socketBuffer = new byte[0x8000]; this.synSended = false; this.totalMessage = ""; IPHostEntry entry1 = Dns.Resolve("messenger.hotmail.com"); IPAddress address1 = entry1.AddressList[0]; this.MessengerServer = address1; }
public Contact() { this.status = MSNStatus.Offline; this.updateVersion = 0; this.inList = false; }
// Methods public StatusChangeEventArgs(MSNStatus oldStatus) { this.OldStatus = oldStatus; }