示例#1
0
        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();
            }
        }
示例#2
0
        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();
            }
        }