public void SignOut() { ExTraceGlobals.InstantMessagingTracer.TraceDebug((long)this.GetHashCode(), "InstantMessageManager.SignOut."); InstantMessageProvider instantMessageProvider = Interlocked.Exchange <InstantMessageProvider>(ref this.provider, null); if (instantMessageProvider != null) { if (this.payload != null) { InstantMessagePayloadUtilities.GenerateUnavailablePayload(this.payload, null, "Signed out manually.", InstantMessageFailure.ClientSignOut, false); } instantMessageProvider.Dispose(); } }
public void TerminateProvider(string reason) { ExTraceGlobals.InstantMessagingTracer.TraceDebug((long)this.GetHashCode(), "InstantMessageManager.TerminateProvider."); InstantMessageProvider instantMessageProvider = Interlocked.Exchange <InstantMessageProvider>(ref this.provider, null); if (instantMessageProvider != null) { if (this.payload != null) { InstantMessagePayloadUtilities.GenerateUnavailablePayload(this.payload, null, "Disconnected from IM by server due to timeout: " + reason, InstantMessageFailure.ServerTimeout, false); } instantMessageProvider.Dispose(); } }