/** When the socket reader receives a property update from runtime, it decodes object ID * property ID and the new value of the property. It then calls this method of * the target object, to update the new value in property cache. After updating the cache, * this method then fires appropriate event in skype.events to notify the UI of what has happened. * DispatchPropertyUpdate is executed in the socket reader thread. */ internal override void DispatchPropertyUpdate(uint propId, object value, bool hasValue) { switch (propId) { case 155: /* ContactGroup.P_TYPE */ cache[0] = hasValue; // if no value - invalidate cache if (hasValue) { cache_type = (SktContactGroup.TYPE)value; if (skypeRef.logging) skypeRef.Log("ContactGroup.P_TYPE = " + cache_type.ToString()); } else if (skypeRef.logging) skypeRef.Log("ContactGroup.P_TYPE - update without value"); skypeRef.events.FireOnContactGroupType(this, cache_type); break; case 154: /* ContactGroup.P_CUSTOM_GROUP_ID */ cache[1] = hasValue; // if no value - invalidate cache if (hasValue) { cache_custom_group_id = (uint)value; if (skypeRef.logging) skypeRef.Log("ContactGroup.P_CUSTOM_GROUP_ID = " + cache_custom_group_id.ToString()); } else if (skypeRef.logging) skypeRef.Log("ContactGroup.P_CUSTOM_GROUP_ID - update without value"); skypeRef.events.FireOnContactGroupCustomGroupId(this, cache_custom_group_id); break; case 151: /* ContactGroup.P_GIVEN_DISPLAYNAME */ cache[2] = hasValue; // if no value - invalidate cache if (hasValue) { cache_given_displayname = (String)value; if (skypeRef.logging) skypeRef.Log("ContactGroup.P_GIVEN_DISPLAYNAME = " + cache_given_displayname.ToString()); } else if (skypeRef.logging) skypeRef.Log("ContactGroup.P_GIVEN_DISPLAYNAME - update without value"); skypeRef.events.FireOnContactGroupGivenDisplayname(this, cache_given_displayname); break; case 152: /* ContactGroup.P_NROFCONTACTS */ cache[3] = hasValue; // if no value - invalidate cache if (hasValue) { cache_nrofcontacts = (uint)value; if (skypeRef.logging) skypeRef.Log("ContactGroup.P_NROFCONTACTS = " + cache_nrofcontacts.ToString()); } else if (skypeRef.logging) skypeRef.Log("ContactGroup.P_NROFCONTACTS - update without value"); skypeRef.events.FireOnContactGroupNrofcontacts(this, cache_nrofcontacts); break; case 153: /* ContactGroup.P_NROFCONTACTS_ONLINE */ cache[4] = hasValue; // if no value - invalidate cache if (hasValue) { cache_nrofcontacts_online = (uint)value; if (skypeRef.logging) skypeRef.Log("ContactGroup.P_NROFCONTACTS_ONLINE = " + cache_nrofcontacts_online.ToString()); } else if (skypeRef.logging) skypeRef.Log("ContactGroup.P_NROFCONTACTS_ONLINE - update without value"); skypeRef.events.FireOnContactGroupNrofcontactsOnline(this, cache_nrofcontacts_online); break; default: skypeRef.Error(String.Format("Invalid ContactGroup class property ID ({0})received from socket.", propId)); break; } }
internal void FetchTypeFromRuntime() { if (skypeRef.logging) skypeRef.Log("Fetching P_TYPE from runtime"); skypeRef.transport.SubmitPropertyRequest(10, 155, this.OID); if (skypeRef.transport.PropResponseWasOk(155)) { cache_type = (SktContactGroup.TYPE)skypeRef.decoder.DecodeUint(); cache[0] = true; } skypeRef.transport.ResumeSocketReaderFromPropRequest(); }
public OnContactGroupTypeArgs(SktContactGroup sender, SktContactGroup.TYPE newValue) { this.sender = sender; value = newValue; }