예제 #1
0
        private void BtnRemovePartialContent_Click(Object sender, RoutedEventArgs e)
        {
            TextBlock btn = sender as TextBlock;

            System.Diagnostics.Debug.Assert(btn != null);
            if (btn == null)
            {
                goto end;
            }

            PartialContent content = btn.DataContext as PartialContent;

            System.Diagnostics.Debug.Assert(content != null);
            if (content == null)
            {
                goto end;
            }

            ViewModel vm = this.ViewModel;

            if (vm == null)
            {
                goto end;
            }

            Boolean didRemoveContent = vm.RemovePartialContent(content);

            if (!didRemoveContent)
            {
                MessageBox.Show("Failed to delete message");
            }

end:
            return;
        }
예제 #2
0
        private void RadioProtocolChecked(Object sender, RoutedEventArgs e)
        {
            ConnectionType selectedType = ConnectionType.Unused;

            if (sender == this.rbUdp)
            {
                selectedType = ConnectionType.UDP;
            }
            else if (sender == this.rbTcp)
            {
                selectedType = ConnectionType.TCP;
            }

            System.Diagnostics.Debug.Assert(selectedType != ConnectionType.Unused);
            if (selectedType == ConnectionType.Unused)
            {
                goto end;
            }

            ViewModel vm = this.ViewModel;

            System.Diagnostics.Debug.Assert(vm != null);

            vm.SwitchConnectionType(selectedType);

end:
            return;
        }
예제 #3
0
        public MainWindow()
        {
            this.InitializeComponent();

            ViewModel vm = this.ViewModel;

            vm.PartialMessageSent += this.Vm_PartialMessageSent;
            vm.MessageLogAdded    += this.Vm_MessageLogAdded;
        }
예제 #4
0
        private void BtnSend_Click(Object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;

            System.Diagnostics.Debug.Assert(btn != null);
            if (btn == null)
            {
                goto end;
            }

            ViewModel vm = this.ViewModel;

            if (vm == null)
            {
                goto end;
            }

            vm.Send( );

end:
            return;
        }
예제 #5
0
        private void BtnAddMessageContent_MouseUp(Object sender, MouseButtonEventArgs e)
        {
            Image senderControl = sender as Image;

            System.Diagnostics.Debug.Assert(senderControl != null);

            if (senderControl == null)
            {
                goto end;
            }

            ViewModel vm = senderControl.DataContext as ViewModel;

            System.Diagnostics.Debug.Assert(vm != null);
            if (vm == null)
            {
                goto end;
            }

            vm.AddPartialContent("");

end:
            return;
        }