BogheApp.SessionWindow.SessionWindowName_Closing C# (CSharp) Method

SessionWindowName_Closing() private method

private SessionWindowName_Closing ( object sender, System e ) : void
sender object
e System
return void
        private void SessionWindowName_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (this.AVSession != null && this.AVSession.IsActive)
            {
                if (this.AVSession.State == MyInviteSession.InviteState.INCOMING)
                {
                    this.soundService.StopRingTone();
                }
                else if (this.AVSession.State == MyInviteSession.InviteState.INPROGRESS)
                {
                    this.soundService.StopRingBackTone();
                }
                this.AVSession.HangUpCall();
            }
            if (this.ChatSession != null && this.ChatSession.IsActive)
            {
                this.ChatSession.HangUp();
            }

            lock (this.fileTransferSessions)
            {
                this.fileTransferSessions.ForEach((x) =>
                {
                    if (x != null && x.IsActive)
                    {
                        x.HangUp();
                    }
                });
            }
        }