public override bool ReinitWithArguments(GrtValue value) { InitializingControls = true; try { Backend = new MySQLRoutineGroupEditorWrapper(value); Control editor = SetupEditorOnHost(tabPage2, true); /* * TODO: The editor is an mforms control, so drag/drop is managed there, but this is still pending. * editor.AllowDrop = true; * editor.DragEnter += new DragEventHandler(ddlEditor_DragEnter); * editor.DragOver += new DragEventHandler(ddlEditor_DragOver); * editor.DragDrop += new DragEventHandler(ddlEditor_DragDrop); */ routineGroupEditorBE.load_routines_sql(); RefreshFormData(); } finally { InitializingControls = false; } Invalidate(); return(true); }
public DbMysqlRoutineGroupEditor(GrtManager manager, GrtValue value) : base(manager) { InitializeComponent(); InitFormData(); ReinitWithArguments(value); }
public override bool ReinitWithArguments(GrtValue value) { InitializingControls = true; try { Backend = new UserEditorBE(GrtManager, value); nameTextBox.Text = userEditorBE.get_name(); passwordTextBox.Text = userEditorBE.get_password(); commentTextBox.Text = userEditorBE.get_comment(); roleTreeBE = userEditorBE.get_role_tree(); roleTreeBE.refresh(); if (roleTreeModel != null) roleTreeModel.DetachEvents(); roleTreeModel = new DifferenceByNameGrtTreeModel(roleTreeView, new List<String>(), roleTreeBE, false); roleTreeModel.AddColumn(roleTreeNodeText, (int)RoleTreeBE.Columns.Name, false); roleTreeView.Model = roleTreeModel; RefreshFormData(); } finally { InitializingControls = false; } Invalidate(); return true; }
public override bool ReinitWithArguments(GrtValue value) { InitializingControls = true; try { Backend = new UserEditorBE(value); nameTextBox.Text = userEditorBE.get_name(); passwordTextBox.Text = userEditorBE.get_password(); commentTextBox.Text = userEditorBE.get_comment(); roleTreeBE = userEditorBE.get_role_tree(); roleTreeBE.refresh(); if (roleTreeModel != null) { roleTreeModel.DetachEvents(); } roleTreeModel = new DifferenceByNameGrtTreeModel(roleTreeView, new List <String>(), roleTreeBE, false); roleTreeModel.AddColumn(roleTreeNodeText, (int)RoleTreeBE.Columns.Name, false); roleTreeView.Model = roleTreeModel; RefreshFormData(); } finally { InitializingControls = false; } Invalidate(); return(true); }
public override bool ReinitWithArguments(GrtValue value) { InitializingControls = true; try { Backend = new MySQLRoutineGroupEditorWrapper(GrtManager, value); Control editor = SetupEditorOnHost(tabPage2, true); /* * TODO: The editor is an mforms control, so drag/drop is managed there, but this is still pending. editor.AllowDrop = true; editor.DragEnter += new DragEventHandler(ddlEditor_DragEnter); editor.DragOver += new DragEventHandler(ddlEditor_DragOver); editor.DragDrop += new DragEventHandler(ddlEditor_DragDrop); */ routineGroupEditorBE.load_routines_sql(); RefreshFormData(); } finally { InitializingControls = false; } Invalidate(); return true; }
public DbMysqlRelationshipEditor(GrtManager manager, GrtValue value) : base(manager) { InitializeComponent(); if (IsEditingLiveObject) AdjustEditModeControls(mainTabControl); ReinitWithArguments(value); }
public DbMysqlRoutineEditor(GrtManager manager, GrtValue value) : base(manager) { InitializeComponent(); ReinitWithArguments(value); if (IsEditingLiveObject) { mainTabControl.TabPages.Remove(commentTabPage); AdjustEditModeControls(mainTabControl); } }
public DbMysqlViewEditor(GrtManager manager, GrtValue value) : base(manager) { InitializeComponent(); ReinitWithArguments(value); if (IsEditingLiveObject) { AdjustEditModeControls(mainTabControl); } }
public DbMysqlRoleEditor(GrtManager manager, GrtValue value) : base(manager) { InitializeComponent(); ReinitWithArguments(value); rolesTreeView.ItemDrag += new ItemDragEventHandler(rolesTreeView_ItemDrag); rolesTreeView.DragEnter += new DragEventHandler(rolesTreeView_DragEnter); rolesTreeView.DragOver += new DragEventHandler(rolesTreeView_DragOver); rolesTreeView.DragDrop += new DragEventHandler(rolesTreeView_DragDrop); }
public DbMysqlTableEditor(GrtManager manager, GrtValue value) : base(manager) { InitializeComponent(); ReinitWithArguments(value); if (IsEditingLiveObject) AdjustEditModeControls(mainTabControl); else collapsePictureBox_Click(null, null); // Start with a collapsed header section. // AdjustToSmallerLayout(); TODO: can go topPanel.Parent = mainTabControl.Parent; }
private void roleObjectsTreeView_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(typeof(List <GrtValue>)) == true) { List <GrtValue> selGrtValues = (List <GrtValue>)e.Data.GetData(typeof(List <GrtValue>)); foreach (GrtValue grtValue in selGrtValues) { RoleEditorBackend.add_object(grtValue); } } else if (e.Data.GetDataPresent(typeof(GrtValue)) == true) { GrtValue selGrtValue = (GrtValue)e.Data.GetData(typeof(GrtValue)); RoleEditorBackend.add_object(selGrtValue); } roleObjectListWrapper.refresh(); roleObjectListModel.RefreshModel(); }
public override bool ReinitWithArguments(GrtValue value) { InitializingControls = true; try { Backend = new RoleEditorBE(GrtManager, value); // (Re) Initialize backend. roleTreeBE = RoleEditorBackend.get_role_tree(); roleTreeBE.refresh(); roleObjectListWrapper = RoleEditorBackend.get_object_list(); roleObjectListWrapper.refresh(); rolePrivilegeListWrapper = RoleEditorBackend.get_privilege_list(); rolePrivilegeListWrapper.refresh(); if (roleTreeModel != null) { roleTreeModel.DetachEvents(); } roleTreeModel = new SimpleGrtTreeModel(rolesTreeView, roleTreeBE, false); roleTreeModel.AddColumn(roleNameNodeControl, (int)RoleTreeBE.Columns.Name, false); rolesTreeView.Model = roleTreeModel; if (roleObjectListModel != null) { roleObjectListModel.DetachEvents(); } roleObjectListModel = new SimpleGrtListModel(roleObjectsTreeView, roleObjectListWrapper, objectIconNodeControl, false); roleObjectListModel.AddColumn(objectNameNodeControl, (int)RoleObjectListWrapper.Columns.Name, false); roleObjectsTreeView.Model = roleObjectListModel; RefreshFormData(); } finally { InitializingControls = false; } Invalidate(); return(true); }
public override bool ReinitWithArguments(GrtValue value) { InitializingControls = true; SuspendLayout(); try { Backend = new MySQL.Grt.ImageEditorWrapper(GrtManager, value); RefreshFormData(); } finally { ResumeLayout(); InitializingControls = false; } Invalidate(); return true; }
public override bool ReinitWithArguments(GrtValue value) { InitializingControls = true; SuspendLayout(); try { Backend = new LayerEditorWrapper(value); RefreshFormData(); } finally { ResumeLayout(); InitializingControls = false; } Invalidate(); return(true); }
public override bool ReinitWithArguments(GrtValue value) { InitializingControls = true; try { Backend = new RoleEditorBE(GrtManager, value); // (Re) Initialize backend. roleTreeBE = RoleEditorBackend.get_role_tree(); roleTreeBE.refresh(); roleObjectListWrapper = RoleEditorBackend.get_object_list(); roleObjectListWrapper.refresh(); rolePrivilegeListWrapper = RoleEditorBackend.get_privilege_list(); rolePrivilegeListWrapper.refresh(); if (roleTreeModel != null) roleTreeModel.DetachEvents(); roleTreeModel = new SimpleGrtTreeModel(rolesTreeView, roleTreeBE, false); roleTreeModel.AddColumn(roleNameNodeControl, (int)RoleTreeBE.Columns.Name, false); rolesTreeView.Model = roleTreeModel; if (roleObjectListModel != null) roleObjectListModel.DetachEvents(); roleObjectListModel = new SimpleGrtListModel(roleObjectsTreeView, roleObjectListWrapper, objectIconNodeControl, false); roleObjectListModel.AddColumn(objectNameNodeControl, (int)RoleObjectListWrapper.Columns.Name, false); roleObjectsTreeView.Model = roleObjectListModel; RefreshFormData(); } finally { InitializingControls = false; } Invalidate(); return true; }
public override bool ReinitWithArguments(GrtValue value) { if (Backend != null && Backend.is_editor_dirty()) return false; // Will open the plugin in a new editor window instead. InitializingControls = true; try { Backend = new MySQL.Grt.StoredNoteEditorWrapper(GrtManager, value); SetupEditorOnHost(content, storedNoteEditorBE.is_sql_script()); storedNoteEditorBE.load_text(); EditorTextChanged(); } finally { InitializingControls = false; } Invalidate(); return true; }
public override bool ReinitWithArguments(GrtValue value) { InitializingControls = true; try { Backend = new MySQLRoutineEditorWrapper(GrtManager, value); dbObjectEditorPages = new DbObjectEditorPages(GrtManager, routineEditorBE); SetupEditorOnHost(panel2, true); routineEditorBE.load_routine_sql(); InitFormData(); RefreshFormData(); Backend.reset_editor_undo_stack(); } finally { InitializingControls = false; } Invalidate(); return(true); }
public override bool ReinitWithArguments(GrtValue value) { InitializingControls = true; try { Backend = new MySQLViewEditorWrapper(GrtManager, value); SetupEditorOnHost(panel1, true); viewEditorBE.load_view_sql(); InitFormData(); RefreshFormData(); Backend.reset_editor_undo_stack(); } finally { InitializingControls = false; } Invalidate(); return true; }
public override bool ReinitWithArguments(GrtValue value) { InitializingControls = true; try { Backend = new MySQLRoutineEditorWrapper(GrtManager, value); dbObjectEditorPages = new DbObjectEditorPages(GrtManager, routineEditorBE); SetupEditorOnHost(panel2, true); routineEditorBE.load_routine_sql(); InitFormData(); RefreshFormData(); Backend.reset_editor_undo_stack(); } finally { InitializingControls = false; } Invalidate(); return true; }
public override bool ReinitWithArguments(GrtValue value) { if (Backend != null && Backend.is_editor_dirty()) { return(false); // Will open the plugin in a new editor window instead. } InitializingControls = true; try { Backend = new MySQL.Grt.StoredNoteEditorWrapper(value); SetupEditorOnHost(content, storedNoteEditorBE.is_sql_script()); storedNoteEditorBE.load_text(); EditorTextChanged(); } finally { InitializingControls = false; } Invalidate(); return(true); }
public override bool ReinitWithArguments(GrtValue value) { InitializingControls = true; try { Backend = new MySQLViewEditorWrapper(value); SetupEditorOnHost(panel1, true); viewEditorBE.load_view_sql(); InitFormData(); RefreshFormData(); Backend.reset_editor_undo_stack(); } finally { InitializingControls = false; } Invalidate(); return(true); }
public virtual bool ReinitWithArguments(GrtValue value) { return false; }
public IntPtr OpenPlugin(GrtManager GrtManager, GrtModule GrtModule, string AssemblyName, string ClassName, GrtValue GrtList, GUIPluginFlags flags) { IntPtr ptr = IntPtr.Zero; try { // Load assembly Assembly assembly = Assembly.LoadFrom(System.IO.Path.Combine( Application.StartupPath, AssemblyName)); // Find class foreach (Type type in assembly.GetTypes()) { if (type.IsClass == true && type.FullName.EndsWith("." + ClassName)) { // use global grtManager Object[] args = { grtManager, GrtList }; if (typeof(DockablePlugin).IsAssignableFrom(type)) { // If ForceNewWindowFlag is not set and this is an object editor if ((GUIPluginFlags.ForceNewWindowFlag & flags) == 0 && (GUIPluginFlags.StandaloneWindowFlag & flags) == 0 && typeof(ObjectEditorPlugin).IsAssignableFrom(type)) { // Check if a plugin of this type is already open. If we can find one on the active // document page then reuse that. If not try the other pages and close the first // editor of that plugin type we find. DockablePlugin plugin = null; if (contentTabControl.ActiveDocument is IWorkbenchDocument) plugin = (contentTabControl.ActiveDocument as IWorkbenchDocument).FindPluginOfType(type); if (plugin == null) { foreach (ITabDocument document in contentTabControl.Documents) if (document is IWorkbenchDocument && document != contentTabControl.ActiveDocument) { if ((document as IWorkbenchDocument).ClosePluginOfType(type)) break; } } else { // If so, try to change the current GRT Object and exit if ((plugin as ObjectEditorView).EditorPlugin.ReinitWithArguments(GrtList)) { // Unregister plugin from back end. wbContext.close_gui_plugin(plugin.GetFixedPtr()); // return old Ptr as Ptr for the new editor return plugin.GetFixedPtr(); } else Logger.LogDebug("Plugins .NET", 1, String.Format("Object editor for {0} does not support reuse", ClassName)); } } ObjectEditorPlugin objectEditorPlugin = Activator.CreateInstance(type, args) as ObjectEditorPlugin; if (objectEditorPlugin != null) { objectEditorPlugin.Context = wbContext; ObjectEditorView pluginForm; if ((GUIPluginFlags.StandaloneWindowFlag & flags) != 0) pluginForm = new StandaloneWindowPlugin(objectEditorPlugin); else pluginForm = new ObjectEditorView(objectEditorPlugin); // Get fixed ptr ptr = pluginForm.GetFixedPtr(); if (ptr == IntPtr.Zero) throw new Exception("Internal error: could not pin memory for plugin."); } break; } else if (typeof(Plugin).IsAssignableFrom(type)) { Plugin plugin = Activator.CreateInstance(type, args) as Plugin; try { plugin.Execute(); } catch (Exception e) { Program.HandleException(e); } } } } } catch (Exception e) { Program.HandleException(e); } return ptr; }
/// <summary> /// Overloaded constructor taking the GRT Manager and GRT object to edit /// </summary> /// <param name="GrtManager">The GRT Manager</param> /// <param name="GrtObject">The object to edit</param> public Plugin(GrtManager GrtManager, GrtValue GrtObject) : this() { grtManager = GrtManager; grtObject = GrtObject; }
public DbMysqlUserEditor(GrtManager manager, GrtValue value) : base(manager) { InitializeComponent(); ReinitWithArguments(value); }
public void UpdateForView(UIForm Form) { if (changeTimer.Enabled) PushChanges(); // Make sure we are initializing Initializing = true; try { List<String> items; GrtValue newObjList; String objDescr; form = Form; if (null != form) objDescr = wbContext.get_description_for_selection(form, out newObjList, out items); else objDescr = wbContext.get_description_for_selection(out newObjList, out items); // update only if selection was changed if (!wbContext.are_lists_equal(activeObjList, newObjList)) { objSelComboBox.Items.Clear(); // Set description text if (null != activeObjList) activeObjList.Dispose(); activeObjList = newObjList; // Set properties NoItemsSelected = (null == items) || (0 == items.Count); MultipleItemsSelected = (items.Count > 1); // handle different number of selected items if (!NoItemsSelected) { objSelComboBox.SuspendLayout(); objSelComboBox.Items.Clear(); objSelComboBox.Items.AddRange(items.ToArray()); objSelComboBox.ResumeLayout(); objSelComboBox.SelectedIndex = 0; // lock on multi selection if (MultipleItemsSelected) { objDescr = "<double-click to overwrite multiple objects>"; ObjectDescriptionEnabled = false; } else ObjectDescriptionEnabled = true; } else { objSelComboBox.SuspendLayout(); objSelComboBox.Items.Clear(); objSelComboBox.Items.Add("No Selection"); objSelComboBox.ResumeLayout(); objSelComboBox.SelectedIndex = 0; objDescr = ""; ObjectDescriptionEnabled = false; } ObjectDescription = objDescr; } } finally { Initializing = false; } }
public PhysicalLayerEditor(GrtManager manager, GrtValue value) : base(manager) { InitializeComponent(); ReinitWithArguments(value); }
public StoredNoteEditor(GrtManager manager, GrtValue value) : base(manager) { InitializeComponent(); ReinitWithArguments(value); }
public PrintDialog(GrtManager GrtManager, GrtValue GrtList) : base(GrtManager, GrtList) { grtArguments = GrtList; }
public override bool ReinitWithArguments(GrtValue value) { if (Backend != null && !Backend.can_close()) return false; // Will open the plugin in a new editor window instead. InitializingControls = true; SuspendLayout(); try { // We have to remove the privileges tab here otherwise we leave it with a // dangling backend reference, which later crashes. // This will certainly flicker but due to the design (priv tab in a different form) // we have no other choice. if (dbObjectEditorPages != null) { privPageWasActive = mainTabControl.SelectedTab == dbObjectEditorPages.PrivilegesTabPage; mainTabControl.TabPages.Remove(dbObjectEditorPages.PrivilegesTabPage); } if (insertsTabPage.Controls.Count > 0) insertsTabPage.Controls.Clear(); Backend = new MySQLTableEditorWrapper(GrtManager, value); Control panel = tableEditorBE.get_trigger_panel(); triggersTabPage.Controls.Add(panel); panel.Dock = DockStyle.Fill; dbObjectEditorPages = new DbObjectEditorPages(GrtManager, tableEditorBE); InitFormData(); RefreshFormData(); { panel = tableEditorBE.get_inserts_panel(); insertsTabPage.Controls.Add(panel); panel.Parent = insertsTabPage; panel.Dock = DockStyle.Fill; } Backend.reset_editor_undo_stack(); } finally { ResumeLayout(true); InitializingControls = false; } return true; }
public void UpdateForView(UIForm Form) { if (changeTimer.Enabled) { PushChanges(); } // Make sure we are initializing Initializing = true; try { List <String> items; GrtValue newObjList; String objDescr; form = Form; if (null != form) { objDescr = wbContext.get_description_for_selection(form, out newObjList, out items); } else { objDescr = wbContext.get_description_for_selection(out newObjList, out items); } // update only if selection was changed if (!wbContext.are_lists_equal(activeObjList, newObjList)) { objSelComboBox.Items.Clear(); // Set description text if (null != activeObjList) { activeObjList.Dispose(); } activeObjList = newObjList; // Set properties NoItemsSelected = (null == items) || (0 == items.Count); MultipleItemsSelected = (items.Count > 1); // handle different number of selected items if (!NoItemsSelected) { objSelComboBox.SuspendLayout(); objSelComboBox.Items.Clear(); objSelComboBox.Items.AddRange(items.ToArray()); objSelComboBox.ResumeLayout(); objSelComboBox.SelectedIndex = 0; // lock on multi selection if (MultipleItemsSelected) { objDescr = "<double-click to overwrite multiple objects>"; ObjectDescriptionEnabled = false; } else { ObjectDescriptionEnabled = true; } } else { objSelComboBox.SuspendLayout(); objSelComboBox.Items.Clear(); objSelComboBox.Items.Add("No Selection"); objSelComboBox.ResumeLayout(); objSelComboBox.SelectedIndex = 0; objDescr = ""; ObjectDescriptionEnabled = false; } ObjectDescription = objDescr; } } finally { Initializing = false; } }
public virtual bool ReinitWithArguments(GrtValue value) { return(false); }
public PrintPreviewDialog(GrtManager GrtManager, GrtValue GrtList) : base(GrtManager, GrtList) { grtArguments = GrtList; }
public ImageEditor(GrtManager manager, GrtValue value) : base(manager) { InitializeComponent(); ReinitWithArguments(value); }