public MsnChatWindow(Conversation conversation, MainWindow clientwindow, Contact contact)
        {
            InitializeComponent();

            this.MessageCollection = new MessageCollection();
            this.MessageCollection.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(MessageCollection_CollectionChanged);

            if (contact == null && conversation.Contacts.Count > 0)
            {
                contact = conversation.Contacts[0];
            }

            this.m_conversation = conversation;
            AddEvent();

            this.m_clientwindow = clientwindow;

            if (contact != null)
            {
                this.m_conversation.Invite(contact);
            }
        }
 private void Logout()
 {
     MainWindow window = new MainWindow();
     window.Show();
     this.Close();
 }
Example #3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Window = ((ChatClient.MainWindow)(target));

            #line 7 "..\..\MainWindow.xaml"
                this.Window.Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing);

            #line default
            #line hidden

            #line 7 "..\..\MainWindow.xaml"
                this.Window.KeyDown += new System.Windows.Input.KeyEventHandler(this.Window_KeyDown);

            #line default
            #line hidden

            #line 7 "..\..\MainWindow.xaml"
                this.Window.Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.AdressBox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 3:
                this.UserNameBox = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.Connect_btn = ((System.Windows.Controls.Button)(target));

            #line 181 "..\..\MainWindow.xaml"
                this.Connect_btn.Click += new System.Windows.RoutedEventHandler(this.Connect_btn_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.Disconnect_btn = ((System.Windows.Controls.Button)(target));

            #line 182 "..\..\MainWindow.xaml"
                this.Disconnect_btn.Click += new System.Windows.RoutedEventHandler(this.Disconnect_btn_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.UserNameLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.MessageField = ((System.Windows.Controls.TextBox)(target));

            #line 199 "..\..\MainWindow.xaml"
                this.MessageField.PreviewDragEnter += new System.Windows.DragEventHandler(this.MessageField_PreviewDragEnter);

            #line default
            #line hidden
                return;

            case 8:
                this.UploadButton = ((System.Windows.Controls.Button)(target));

            #line 200 "..\..\MainWindow.xaml"
                this.UploadButton.Click += new System.Windows.RoutedEventHandler(this.UploadButton_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.SendMessagebtn = ((System.Windows.Controls.Button)(target));

            #line 230 "..\..\MainWindow.xaml"
                this.SendMessagebtn.Click += new System.Windows.RoutedEventHandler(this.SendMessagebtn_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.DataHandler = ((System.Windows.Controls.ListBox)(target));

            #line 231 "..\..\MainWindow.xaml"
                this.DataHandler.Drop += new System.Windows.DragEventHandler(this.DataHandler_Drop);

            #line default
            #line hidden

            #line 231 "..\..\MainWindow.xaml"
                this.DataHandler.DragLeave += new System.Windows.DragEventHandler(this.MessageField_PreviewDragLeave);

            #line default
            #line hidden
                return;

            case 11:

            #line 234 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.RemoveMenuItem_Click);

            #line default
            #line hidden
                return;

            case 12:
                this.StatusLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 13:
                this.ConnectionLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 14:
                this.UsersList = ((System.Windows.Controls.ListBox)(target));
                return;

            case 15:
                this.Scroll = ((System.Windows.Controls.ScrollViewer)(target));
                return;

            case 16:
                this.MessageBox = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }