private void FetchXmlBuilder_Load(object sender, EventArgs e) { LogUse("Load"); CheckIntegrationTools(); SetupDockControls(); ApplySettings(true); RebuildRepositoryMenu(null); TreeNodeHelper.AddContextMenu(null, dockControlBuilder, settings.QueryOptions); EnableControls(true); }
private void TvSiteMapNodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { TreeNode selectedNode = e.Node; selectedNode.TreeView.SelectedNode = selectedNode; var collec = (Dictionary <string, ITLec.CRMFormXml.Property>)selectedNode.Tag; TreeNodeHelper.AddContextMenu(e.Node, this); Control existingControl = panelContainer.Controls.Count > 0 ? panelContainer.Controls[0] : null; if (existingControl != null) { panelContainer.Controls.Remove(existingControl); existingControl.Dispose(); GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); } panelContainer.Controls.Clear(); BaseMainFormXmlUserControl ctrl = null; string fullNodeName = TreeNodeHelper.FullNodeName(selectedNode); if (collec != null) { ctrl = new ITLec.FormXmlManager.Controls.MainFormXmlSectionControl(fullNodeName, collec); if (ctrl != null) { ctrl.Saving += CtrlSaving; ctrl.Dock = DockStyle.Fill; panelContainer.Controls.Add(ctrl); ctrl.BringToFront(); if (existingControl != null) { panelContainer.Controls.Remove(existingControl); } tsbItemSave.Visible = true; } } ManageMenuDisplay(); }
private void TvSiteMapNodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { TreeNode selectedNode = e.Node; selectedNode.TreeView.SelectedNode = selectedNode; var collec = (Dictionary <string, string>)selectedNode.Tag; TreeNodeHelper.AddContextMenu(e.Node, this); Control existingControl = panelContainer.Controls.Count > 0 ? panelContainer.Controls[0] : null; if (existingControl != null) { panelContainer.Controls.Remove(existingControl); existingControl.Dispose(); GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); } switch (selectedNode.Text.Split(' ')[0]) { case "SiteMap": { var ctrl = new SiteMapControl(collec); ctrl.Saved += CtrlSaved; panelContainer.Controls.Add(ctrl); ctrl.BringToFront(); if (existingControl != null) { panelContainer.Controls.Remove(existingControl); } tsbItemSave.Visible = true; } break; case "Area": { if (collec.Count == 0) { collec.Add("Id", string.Format("tempId_{0}", DateTime.Now.Ticks)); } var ctrl = new AreaControl(collec, webResourcesImageCache, webResourcesHtmlCache, Service); ctrl.Saved += CtrlSaved; panelContainer.Controls.Add(ctrl); ctrl.BringToFront(); if (existingControl != null) { panelContainer.Controls.Remove(existingControl); } tsbItemSave.Visible = true; } break; case "SubArea": { if (collec.Count == 0) { collec.Add("Id", string.Format("tempId_{0}", DateTime.Now.Ticks)); } var ctrl = new SubAreaControl(collec, entityCache, webResourcesImageCache, webResourcesHtmlCache, Service); ctrl.Saved += CtrlSaved; panelContainer.Controls.Add(ctrl); ctrl.BringToFront(); if (existingControl != null) { panelContainer.Controls.Remove(existingControl); } tsbItemSave.Visible = true; } break; case "Group": { if (collec.Count == 0) { collec.Add("Id", string.Format("tempId_{0}", DateTime.Now.Ticks)); } var ctrl = new GroupControl(collec); ctrl.Saved += CtrlSaved; panelContainer.Controls.Add(ctrl); ctrl.BringToFront(); if (existingControl != null) { panelContainer.Controls.Remove(existingControl); } tsbItemSave.Visible = true; } break; case "Privilege": { var ctrl = new PrivilegeControl(collec); ctrl.Saved += CtrlSaved; panelContainer.Controls.Add(ctrl); ctrl.BringToFront(); if (existingControl != null) { panelContainer.Controls.Remove(existingControl); } tsbItemSave.Visible = true; } break; case "Description": { var ctrl = new DescriptionControl(collec); ctrl.Saved += CtrlSaved; panelContainer.Controls.Add(ctrl); ctrl.BringToFront(); if (existingControl != null) { panelContainer.Controls.Remove(existingControl); } tsbItemSave.Visible = true; } break; case "Title": { var ctrl = new TitleControl(collec); ctrl.Saved += CtrlSaved; panelContainer.Controls.Add(ctrl); ctrl.BringToFront(); if (existingControl != null) { panelContainer.Controls.Remove(existingControl); } tsbItemSave.Visible = true; } break; default: { panelContainer.Controls.Clear(); tsbItemSave.Visible = false; } break; } ManageMenuDisplay(); }
private void tvDefinitionNodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { TreeNode selectedNode = e.Node; selectedNode.TreeView.SelectedNode = selectedNode; var collec = (Dictionary <string, string>)selectedNode.Tag; TreeNodeHelper.AddContextMenu(e.Node, this); Control existingControl = panelContainer.Controls.Count > 0 ? panelContainer.Controls[0] : null; this.deleteToolStripMenuItem.Text = "Delete " + selectedNode.Text; UserControl ctrl = null; switch (selectedNode.Text.Split(' ')[0]) { case "ShuffleDefinition": ctrl = new ShuffleDefinitionControl(collec, this); break; case "DataBlock": ctrl = new DataBlockControl(collec, this); break; case "SolutionBlock": ctrl = new SolutionBlockControl(collec, this); break; case "Export": if (selectedNode.Parent != null && selectedNode.Parent.Text.StartsWith("DataBlock")) { ctrl = new DataBlockExportControl(collec, this); } else if (selectedNode.Parent != null && selectedNode.Parent.Text.StartsWith("SolutionBlock")) { ctrl = new SolutionBlockExportControl(collec, this); } break; case "Import": if (selectedNode.Parent != null && selectedNode.Parent.Text.StartsWith("DataBlock")) { ctrl = new DataBlockImportControl(collec, this); } else if (selectedNode.Parent != null && selectedNode.Parent.Text.StartsWith("SolutionBlock")) { ctrl = new SolutionBlockImportControl(collec, this); } break; case "Relation": ctrl = new RelationControl(collec, selectedNode, this); break; case "Attribute": if (selectedNode.Parent != null && selectedNode.Parent.Text.StartsWith("Attributes")) { ctrl = new ExportAttributeControl(collec, this); } else if (selectedNode.Parent != null && selectedNode.Parent.Text.StartsWith("Match")) { ctrl = new ImportAttributeControl(collec, this); } break; case "Filter": ctrl = new FilterControl(collec, this); break; case "Sort": ctrl = new SortControl(collec, this); break; case "Match": ctrl = new ImportMatchControl(collec, this); break; case "Settings": ctrl = new SettingsControl(collec, this); break; case "Solution": if (selectedNode.Parent != null && selectedNode.Parent.Text.StartsWith("PreRequisites")) { ctrl = new PreReqSolutionControl(collec, this); } break; default: { panelContainer.Controls.Clear(); tsbItemSave.Visible = false; } break; } if (ctrl != null) { panelContainer.Controls.Add(ctrl); ctrl.BringToFront(); if (existingControl != null) { panelContainer.Controls.Remove(existingControl); } tsbItemSave.Visible = true; } ManageMenuDisplay(); }