예제 #1
0
        private void logsClearBtn_Click(object sender, RoutedEventArgs e)
        {
            YesNoDialog dialogResult = new YesNoDialog("Do you really want to clean all logs?");

            dialogResult.Owner = this;
            if ((bool)dialogResult.ShowDialog())
            {
                appRunner.CleanLogs();
            }
        }
예제 #2
0
        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            YesNoDialog dialogResult = new YesNoDialog("Do you really want to close?");

            dialogResult.Owner = this;
            if (!(bool)dialogResult.ShowDialog())
            {
                e.Cancel = true;
            }
            base.OnClosing(e);
        }
예제 #3
0
 private void deleteAppButton_Click(object sender, RoutedEventArgs e)
 {
     if (applicationsListBox.SelectedItem != null)
     {
         YesNoDialog dialogResult = new YesNoDialog("Do you really want to delene selected application?");
         dialogResult.Owner = this;
         if ((bool)dialogResult.ShowDialog())
         {
             appRunner.DeleteApplication();
             applicationsListBox.Items.Refresh();
         }
     }
 }
예제 #4
0
        private void deleteConfigButton_Click(object sender, RoutedEventArgs e)
        {
            if (configsCb.SelectedItem != null)
            {
                YesNoDialog dialogResult = new YesNoDialog("Do you really want to delete selected Config file?");
                dialogResult.Owner = this;
                if ((bool)dialogResult.ShowDialog())
                {
                    appRunner.DeleteConfig();

                    configsCb.Items.Refresh();
                }
            }
        }
예제 #5
0
 private void deleteActiveNodeButton_Click(object sender, RoutedEventArgs e)
 {
     if (activeNodesListBox.SelectedItems.Count > 0)
     {
         YesNoDialog dialogResult = new YesNoDialog("Do you really want to delene selected nodes?");
         dialogResult.Owner = this;
         if ((bool)dialogResult.ShowDialog())
         {
             List <ActiveNode> selectedActiveNodes = activeNodesListBox.SelectedItems.OfType <ActiveNode>().ToList();
             appRunner.DeleteNodes(selectedActiveNodes);
             activeNodesListBox.Items.Refresh();
         }
     }
 }
예제 #6
0
 private void CopyItem(SceneNodeView _sourceItem, SceneNodeView _targetItem)
 {
     //Alert if node sets as child of it's own child node
     if (_targetItem != null && _sourceItem.FindNodeInChildren(_targetItem) != null)
     {
         InfoDialog alertDialog = new InfoDialog("Scene node can not be a child node of own children!");
         alertDialog.Owner = this;
         alertDialog.Show();
     }
     else
     {
         //Asking user wether he want to drop the dragged TreeViewItem here or not
         YesNoDialog dialogResult = new YesNoDialog("Would you like to drop " + _sourceItem.node.id + " into " + _targetItem.node.id + "");
         dialogResult.Owner = this;
         if ((bool)dialogResult.ShowDialog())
         {
             try
             {
                 //finding Parent TreeViewItem of dragged TreeViewItem
                 SceneNodeView ParentItem = currentConfig.FindParentNode(_sourceItem);
                 if (ParentItem == null)
                 {
                     ((List <SceneNodeView>)sceneNodesTreeView.ItemsSource).Remove(_sourceItem);
                 }
                 else
                 {
                     ParentItem.children.Remove(_sourceItem);
                 }
                 //adding dragged TreeViewItem in target TreeViewItem
                 if (_targetItem == null)
                 {
                     ((List <SceneNodeView>)sceneNodesTreeView.ItemsSource).Add(_sourceItem);
                     _sourceItem.node.parent = null;
                 }
                 else
                 {
                     _targetItem.children.Add(_sourceItem);
                     _sourceItem.node.parent = _targetItem.node;
                 }
                 //Set SceneNode of _targetItem as parent node for _sourceItem Scene Node
             }
             catch
             {
             }
             sceneNodesTreeView.Items.Refresh();
         }
     }
 }