private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { if (treeView.SelectedItem != null) { (treeView.SelectedItem as TreeViewItem).IsExpanded = true; } var path = treeViewMachinesAndTasksHandler.GetNodePath(); listViewBrowseComputersHandler.LoadMachines(path); listView.SelectAll(); }
private void SelectedImage() { if (listView.SelectedItems.Count != 0) { var imagesDetail = (ImageData)listView.SelectedItems[0]; var path = treeViewMachinesAndTasksHandler.GetNodePath() + "\\" + imagesDetail.Name; if (!imagesDetail.ImageSource.Contains("Folder.ico")) { pathOutput = path; this.Close(); } } return; }
private void MenuItemTaskNew_Click(object sender, RoutedEventArgs e) { var taskOptionsDialog = new TaskOptions(); taskOptionsDialog.path = ""; taskOptionsDialog.nodePath = treeViewMachinesAndTasksHandler.GetNodePath(); taskOptionsDialog.clients = listViewMachinesAndTasksHandler.clients; taskOptionsDialog.ExecutedTasksHandlers = ExecutedTasksHandlers; foreach (TaskData item in listViewTasks.Items) { taskOptionsDialog.Names.Add(item.Name); } taskOptionsDialog.ShowDialog(); if (taskOptionsDialog.executed) { RunTask(taskOptionsDialog); } listViewMachinesAndTasksHandler.Refresh(); }
public void Refresh() { LoadList(treeViewHandler.GetNodePath()); }
private void CopyToClipBoard() { nodePathOld = treeViewMachinesAndTasksHandler.GetNodePath(); clipBoardImages.Clear(); for (int i = 0; i < listView.SelectedItems.Count; i++) { ImageData item = (ImageData)listView.SelectedItems[i]; if (!item.ImageSource.Contains("_Selected.ico")) { item.ImageSource = item.ImageSource.Replace(".ico", "_Selected.ico"); } clipBoardImages.Add(item); } for (int i = 0; i < listView.Items.Count; i++) { ImageData item = (ImageData)listView.Items[i]; int indexClipBoard = clipBoardImages.IndexOf(item); int index = listView.Items.IndexOf(item); listView.Items.Remove(item); if (indexClipBoard == -1) { item.ImageSource = item.ImageSource.Replace("_Selected.ico", ".ico"); listView.Items.Insert(index, item); } else { listView.Items.Insert(index, clipBoardImages[indexClipBoard]); } } }