Exemplo n.º 1
0
 /// <summary>
 /// 添加通讯网关 click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void addGatewayClick(object sender, RoutedEventArgs e)
 {
     Dialogs.GatewayDialog dialog = new Dialogs.GatewayDialog();
     dialog.Owner = MainWindow.Instance;
     dialog.Title = "添加通讯网关";
     if (dialog.ShowDialog() == true)
     {
         var data = dialog.Data;
         this.Nodes.Add(new Models.GatewayNode(data));
         this.IsExpanded = true;
     }
 }
Exemplo n.º 2
0
        protected override void OnDoublicClick(object sender, MouseButtonEventArgs e)
        {
            var data = this.Gateway.Clone <CommunicationDriver>();

            Dialogs.GatewayDialog dialog = new Dialogs.GatewayDialog(data);
            dialog.Owner = MainWindow.Instance;
            dialog.Title = this.Text;
            if (dialog.ShowDialog() == true)
            {
                this.Gateway = dialog.Data;
                this.Gateway.ChangedProperties.Clear();
                this.UpdateText();
            }
        }