public ObservableCollection <Patient> generateTreeView(Boolean showName) { Technique t = new Technique(); ObservableCollection <Patient> allDatasetsActive = new ObservableCollection <Patient>(); if (ConnectionManager.ValidConnection == true) { try { using (SqlConnection conn = new SqlConnection(ConnectionManager.getConnection)) { conn.Open(); SqlCommand cmd = new SqlCommand("spr_TreeView_v001", conn); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader data = cmd.ExecuteReader(); TreeViewGenerator generator = new TreeViewGenerator(); allDatasetsActive = generator.GetCollection(data, showName, conn); data.Close(); } } catch (Exception e) { Console.WriteLine(e); } } return(allDatasetsActive); }
public void DrawTreeView(USDConfigurationData usdConfigData) { this.usdConfigData = usdConfigData; var usdTree = USDTree.GenerateUSDTree(usdConfigData); TreeViewGenerator.GenerateTreeViewFromHostedControls(treeView1, usdTree, checkBox1.Checked); }
public void AddObjectTree(string newObjectViewLoadedFilesComboBoxText) { if (String.IsNullOrEmpty(newObjectViewLoadedFilesComboBoxText)) { return; } XmlObjectsListWrapper selectedWrapper = LoadedListWrappers.GetValueOrDefault(newObjectViewLoadedFilesComboBoxText); TreeViewGenerator.CreateEmptyNewObjectFormTree(selectedWrapper, newObjectViewLoadedFilesComboBoxText); }
public DataSet Execute(DataSet data, TreeView treeView) { if (data == null) data = GetData(); TreeViewGenerator tv = new TreeViewGenerator(treeView.Nodes); tv.Execute(data.Tables[0]); return data; }
public DataSet Execute(DataSet data, TreeView treeView) { if (data == null) { data = GetData(); } TreeViewGenerator tv = new TreeViewGenerator(treeView.Nodes); tv.Execute(data.Tables[0]); return(data); }
public void AddSearchTree(MyStackPanel searchTreeFormsPanel, ComboBox searchTreeLoadedFilesComboBox, bool isGameFileTree = true, bool includeChildrenInOnHover = false, bool includeComments = false) { string selectedObject = searchTreeLoadedFilesComboBox.Text; if (String.IsNullOrEmpty(selectedObject)) { return; } XmlObjectsListWrapper selectedWrapper = LoadedListWrappers.GetWrapperFromDictionary(selectedObject); if (selectedObject.Split("_").Length > 1) { selectedWrapper = LoadedListWrappers.GetValueOrDefault(selectedObject); if (selectedWrapper == null) { MessageBox.Show( "The was an error in the file for " + selectedObject + ".\n\n" + "It is probably malformed xml, to check this, switch to the mod, open the \"File\" menu and click \"Validate Mod files\".", "File Loading Error!", MessageBoxButton.OK, MessageBoxImage.Error); return; } } XmlObjectsListWrapper leftObjectWrapper = searchTreeFormsPanel.StackPanelLoadedListWrappers.GetValueOrDefault(selectedObject); string gameWrapperKey = selectedWrapper.GenerateDictionaryKey(); if (leftObjectWrapper == null || leftObjectWrapper.XmlFile.FileSize < this.FILE_SIZE_THRESHOLD) { TreeViewItem nextTreeView = TreeViewGenerator.GetSearchTreeViewRecursive(selectedWrapper, gameWrapperKey, isGameTree: isGameFileTree, includeChildrenInOnHover: includeChildrenInOnHover, includeComments: includeComments); nextTreeView.Header = selectedObject; searchTreeFormsPanel.Children.Add(nextTreeView); } else { MessageBoxResult result = MessageBox.Show( "That is a large file and consumes a considerable amount of resources, you already have one of those objects in the view. Are you sure you want another? ", "Add Another Large Search Tree", MessageBoxButton.YesNo, MessageBoxImage.Exclamation); switch (result) { case MessageBoxResult.Yes: TreeViewItem nextTreeView = TreeViewGenerator.GetSearchTreeViewRecursive(selectedWrapper, gameWrapperKey, isGameTree: isGameFileTree, includeChildrenInOnHover: includeChildrenInOnHover, includeComments: includeComments); nextTreeView.Header = selectedObject; searchTreeFormsPanel.Children.Add(nextTreeView); break; } } }
public override void OnApplyTemplate() { base.OnApplyTemplate(); var textBox = Template.FindName("PART_EditableTextBox", this) as TextBox; MyTextBox = textBox; MyTextBox.Tag = this.Parent; MyTextBox.Uid = ObjectNode == null ? "" : ObjectNode.Name; XmlObjectsListWrapper wrapperToUse = MainWindowViewController.LoadedListWrappers.GetValueOrDefault(this.Uid); if (IsGameFileSearchTree) { TreeViewGenerator.AddTargetContextMenuToControl(MyTextBox, wrapperToUse); } MyTextBox.Background = BackgroundColorController.GetBackgroundColor(); this.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor()); }
public ObservableCollection <Patient> generateCustomTreeView(Filter filter, Boolean showName) { ObservableCollection <Patient> allDatasetsActive = null; int dateCompareResultFrom = 0; int dateCompareResultTo = 0; DateTime invalidDate = new DateTime(); invalidDate = DateTime.Parse("01/01/0001 00:00:00"); if (filter != null) { dateCompareResultFrom = DateTime.Compare(invalidDate, filter.AcquisitionDateFrom); dateCompareResultTo = DateTime.Compare(invalidDate, filter.AcquisitionDateTo); } if (ConnectionManager.ValidConnection == true) { try { using (SqlConnection conn = new SqlConnection(ConnectionManager.getConnection)) { conn.Open(); SqlCommand cmd = new SqlCommand("spr_CustomList_v001", conn); cmd.CommandType = CommandType.StoredProcedure; if (!String.IsNullOrEmpty(filter.PatientID)) { cmd.Parameters.Add("@IDContains", SqlDbType.VarChar).Value = filter.PatientID; } if (!String.IsNullOrEmpty(filter.Modality)) { cmd.Parameters.Add("@modality", SqlDbType.VarChar).Value = filter.Modality; } if (!String.IsNullOrEmpty(filter.Gender)) { cmd.Parameters.Add("@Sex", SqlDbType.VarChar).Value = filter.Gender; } if (filter.AcquisitionDateFrom != null && dateCompareResultFrom != 0) { cmd.Parameters.Add("@AcquireBetweenFrom", SqlDbType.Date).Value = filter.AcquisitionDateFrom; } if (filter.AcquisitionDateTo != null && dateCompareResultTo != 0) { cmd.Parameters.Add("@AcquireBetweenTo", SqlDbType.Date).Value = filter.AcquisitionDateTo; } if (filter.Batch != null) { cmd.Parameters.Add("@Batch", SqlDbType.Int).Value = filter.Batch; } SqlDataReader data = cmd.ExecuteReader(); TreeViewGenerator generator = new TreeViewGenerator(); allDatasetsActive = generator.GetCollection(data, showName, conn); data.Close(); } } catch (Exception e) { Console.WriteLine(e); } } return(allDatasetsActive); }