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(); } }
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(); } } }
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(); } } }
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(); } } }