public ActionGroupEditSession(ActionGroupDesignerFrontend frontend, ProjectBackend project, string containerName, string groupToEdit, bool autoCommitChanges) { this.groupToEdit = groupToEdit; this.containerName = containerName; this.frontend = frontend; this.project = project; this.autoCommitChanges = autoCommitChanges; if (groupToEdit != null) { group = project.ActionGroups [groupToEdit]; if (group == null) { throw new InvalidOperationException("Unknown action group: " + groupToEdit); } Load(group); undoManager = new UndoRedoManager(); undoQueue = new UndoQueue(); undoManager.UndoQueue = undoQueue; undoManager.RootObject = groupCopy; groupToolbar = new ActionGroupToolbar(frontend, groupCopy); } else { if (!autoCommitChanges) { throw new System.NotSupportedException(); } Stetic.Wrapper.Container container = project.GetTopLevelWrapper(containerName, true); groupToolbar = new ActionGroupToolbar(frontend, container.LocalActionGroups); } // Don't delay the creation of the designer because when used in combination with the // widget designer, change events are subscribed since the begining designer = UserInterface.CreateActionGroupDesigner(project, groupToolbar); designer.Editor.GroupModified += OnModified; designer.Toolbar.AllowActionBinding = allowActionBinding; designer.Destroyed += delegate { designer = null; Dispose(); }; }
public ActionGroupEditSession (ActionGroupDesignerFrontend frontend, ProjectBackend project, string containerName, string groupToEdit, bool autoCommitChanges) { this.groupToEdit = groupToEdit; this.containerName = containerName; this.frontend = frontend; this.project = project; this.autoCommitChanges = autoCommitChanges; if (groupToEdit != null) { group = project.ActionGroups [groupToEdit]; if (group == null) throw new InvalidOperationException ("Unknown action group: " + groupToEdit); Load (group); undoManager = new UndoRedoManager (); undoQueue = new UndoQueue (); undoManager.UndoQueue = undoQueue; undoManager.RootObject = groupCopy; groupToolbar = new ActionGroupToolbar (frontend, groupCopy); } else { if (!autoCommitChanges) throw new System.NotSupportedException (); Stetic.Wrapper.Container container = project.GetTopLevelWrapper (containerName, true); groupToolbar = new ActionGroupToolbar (frontend, container.LocalActionGroups); } // Don't delay the creation of the designer because when used in combination with the // widget designer, change events are subscribed since the begining designer = UserInterface.CreateActionGroupDesigner (project, groupToolbar); designer.Editor.GroupModified += OnModified; designer.Toolbar.AllowActionBinding = allowActionBinding; designer.Destroyed += delegate { designer = null; Dispose (); }; }