public void Dispose() { sourceProject.ComponentTypesChanged -= OnSourceProjectLibsChanged; sourceProject.ProjectReloaded -= OnSourceProjectReloaded; gproject.ModifiedChanged -= new EventHandler(OnModifiedChanged); gproject.Changed -= new EventHandler(OnChanged); gproject.ProjectReloaded -= OnProjectReloaded; gproject.ProjectReloading -= OnProjectReloading; // gproject.WidgetMemberNameChanged -= new Stetic.Wrapper.WidgetNameChangedHandler (OnWidgetNameChanged); if (!autoCommitChanges) { // Don't dispose the project here! it will be disposed by the frontend if (widget != null) { widget.SelectionChanged -= OnSelectionChanged; // Don't dispose the widget. It will be disposed when destroyed together // with the container widget = null; } } if (plug != null) { plug.Destroy(); } gproject = null; rootWidget = null; frontend = null; System.Runtime.Remoting.RemotingServices.Disconnect(this); disposed = true; }
internal WidgetDesigner(Project project, string componentName, bool autoCommitChanges) : base(project.App) { this.componentName = componentName; this.autoCommitChanges = autoCommitChanges; this.project = project; frontend = new WidgetDesignerFrontend(this); if (autoCommitChanges) { editedProject = project; } else { editedProject = new Project(project.App); } editedProject.SignalAdded += OnSignalAdded; editedProject.SignalRemoved += OnSignalRemoved; editedProject.SignalChanged += OnSignalChanged; editedProject.ComponentNameChanged += OnComponentNameChanged; editedProject.ComponentTypesChanged += OnComponentTypesChanged; project.BackendChanged += OnProjectBackendChanged; editedProject.BackendChanged += OnProjectBackendChanged; CreateSession(); }
public WidgetEditSession(ProjectBackend sourceProject, WidgetDesignerFrontend frontend, string windowName, Stetic.ProjectBackend editingBackend, bool autoCommitChanges) { this.frontend = frontend; this.autoCommitChanges = autoCommitChanges; undoManager = new ContainerUndoRedoManager(); undoQueue = new UndoQueue(); undoManager.UndoQueue = undoQueue; sourceWidget = windowName; this.sourceProject = sourceProject; if (!autoCommitChanges) { // Reuse the action groups and icon factory of the main project gproject = editingBackend; // Attach will prevent the destruction of the action group list by gproject gproject.AttachActionGroups(sourceProject.ActionGroups); gproject.IconFactory = sourceProject.IconFactory; gproject.FileName = sourceProject.FileName; gproject.ImagesRootPath = sourceProject.ImagesRootPath; gproject.ResourceProvider = sourceProject.ResourceProvider; gproject.WidgetLibraries = (ArrayList)sourceProject.WidgetLibraries.Clone(); gproject.InternalWidgetLibraries = (ArrayList)sourceProject.InternalWidgetLibraries.Clone(); gproject.TargetGtkVersion = sourceProject.TargetGtkVersion; sourceProject.ComponentTypesChanged += OnSourceProjectLibsChanged; sourceProject.ProjectReloaded += OnSourceProjectReloaded; rootWidget = editingBackend.GetTopLevelWrapper(sourceWidget, false); if (rootWidget == null) { // Copy the widget to edit from the source project // When saving the file, this project will be merged with the main project. sourceProject.CopyWidgetToProject(windowName, gproject, windowName); rootWidget = gproject.GetTopLevelWrapper(windowName, true); } gproject.Modified = false; } else { rootWidget = sourceProject.GetTopLevelWrapper(windowName, true); gproject = sourceProject; } rootWidget.Select(); undoManager.RootObject = rootWidget; gproject.ModifiedChanged += new EventHandler(OnModifiedChanged); gproject.Changed += new EventHandler(OnChanged); gproject.ProjectReloaded += new EventHandler(OnProjectReloaded); gproject.ProjectReloading += new EventHandler(OnProjectReloading); // gproject.WidgetMemberNameChanged += new Stetic.Wrapper.WidgetNameChangedHandler (OnWidgetNameChanged); }
public WidgetEditSession (ProjectBackend sourceProject, WidgetDesignerFrontend frontend, string windowName, Stetic.ProjectBackend editingBackend, bool autoCommitChanges) { this.frontend = frontend; this.autoCommitChanges = autoCommitChanges; undoManager = new ContainerUndoRedoManager (); undoQueue = new UndoQueue (); undoManager.UndoQueue = undoQueue; sourceWidget = windowName; this.sourceProject = sourceProject; if (!autoCommitChanges) { // Reuse the action groups and icon factory of the main project gproject = editingBackend; // Attach will prevent the destruction of the action group list by gproject gproject.AttachActionGroups (sourceProject.ActionGroups); gproject.IconFactory = sourceProject.IconFactory; gproject.FileName = sourceProject.FileName; gproject.ImagesRootPath = sourceProject.ImagesRootPath; gproject.ResourceProvider = sourceProject.ResourceProvider; gproject.WidgetLibraries = (ArrayList) sourceProject.WidgetLibraries.Clone (); gproject.InternalWidgetLibraries = (ArrayList) sourceProject.InternalWidgetLibraries.Clone (); gproject.TargetGtkVersion = sourceProject.TargetGtkVersion; sourceProject.ComponentTypesChanged += OnSourceProjectLibsChanged; sourceProject.ProjectReloaded += OnSourceProjectReloaded; rootWidget = editingBackend.GetTopLevelWrapper (sourceWidget, false); if (rootWidget == null) { // Copy the widget to edit from the source project // When saving the file, this project will be merged with the main project. sourceProject.CopyWidgetToProject (windowName, gproject, windowName); rootWidget = gproject.GetTopLevelWrapper (windowName, true); } gproject.Modified = false; } else { rootWidget = sourceProject.GetTopLevelWrapper (windowName, true); gproject = sourceProject; } rootWidget.Select (); undoManager.RootObject = rootWidget; gproject.ModifiedChanged += new EventHandler (OnModifiedChanged); gproject.Changed += new EventHandler (OnChanged); gproject.ProjectReloaded += new EventHandler (OnProjectReloaded); gproject.ProjectReloading += new EventHandler (OnProjectReloading); // gproject.WidgetMemberNameChanged += new Stetic.Wrapper.WidgetNameChangedHandler (OnWidgetNameChanged); }
internal WidgetDesigner (Project project, string componentName): base (project.App) { this.componentName = componentName; this.project = project; frontend = new WidgetDesignerFrontend (this); project.SignalAdded += OnSignalAdded; project.SignalRemoved += OnSignalRemoved; project.SignalChanged += OnSignalChanged; project.ComponentNameChanged += OnComponentNameChanged; project.ComponentTypesChanged += OnComponentTypesChanged; project.BackendChanged += OnProjectBackendChanged; CreateSession (); }
internal WidgetDesigner(Project project, string componentName) : base(project.App) { this.componentName = componentName; this.project = project; frontend = new WidgetDesignerFrontend(this); project.SignalAdded += OnSignalAdded; project.SignalRemoved += OnSignalRemoved; project.SignalChanged += OnSignalChanged; project.ComponentNameChanged += OnComponentNameChanged; project.ComponentTypesChanged += OnComponentTypesChanged; project.BackendChanged += OnProjectBackendChanged; CreateSession(); }
protected override void OnDestroyed() { try { if (disposed) { return; } if (project.App.ActiveProject == editedProject) { project.App.ActiveProject = null; } disposed = true; frontend.disposed = true; editedProject.SignalAdded -= OnSignalAdded; editedProject.SignalRemoved -= OnSignalRemoved; editedProject.SignalChanged -= OnSignalChanged; editedProject.ComponentNameChanged -= OnComponentNameChanged; editedProject.BackendChanged -= OnProjectBackendChanged; editedProject.ComponentTypesChanged -= OnComponentTypesChanged; project.BackendChanged -= OnProjectBackendChanged; if (session != null) { session.Dispose(); session = null; } if (!autoCommitChanges) { editedProject.Dispose(); } System.Runtime.Remoting.RemotingServices.Disconnect(frontend); frontend = null; rootWidget = null; selection = null; } finally { base.OnDestroyed(); } }
public void Dispose() { project.ComponentTypesChanged -= OnSourceProjectLibsChanged; project.ProjectReloaded -= OnSourceProjectReloaded; project.Changed -= new ProjectChangedEventHandler(OnChanged); project.ProjectReloaded -= OnProjectReloaded; project.ProjectReloading -= OnProjectReloading; // project.WidgetMemberNameChanged -= new Stetic.Wrapper.WidgetNameChangedHandler (OnWidgetNameChanged); if (plug != null) { plug.Destroy(); } rootWidget = null; frontend = null; System.Runtime.Remoting.RemotingServices.Disconnect(this); disposed = true; }
public WidgetEditSession (ProjectBackend sourceProject, WidgetDesignerFrontend frontend, string windowName) { this.frontend = frontend; undoManager = new ContainerUndoRedoManager (); undoQueue = new UndoQueue (); undoManager.UndoQueue = undoQueue; sourceWidget = windowName; this.project = sourceProject; rootWidget = sourceProject.GetTopLevelWrapper (windowName, true); rootWidget.Select (); undoManager.RootObject = rootWidget; this.project.Changed += new ProjectChangedEventHandler (OnChanged); this.project.ProjectReloaded += new EventHandler (OnProjectReloaded); this.project.ProjectReloading += new EventHandler (OnProjectReloading); // this.project.WidgetMemberNameChanged += new Stetic.Wrapper.WidgetNameChangedHandler (OnWidgetNameChanged); }
public WidgetEditSession(ProjectBackend sourceProject, WidgetDesignerFrontend frontend, string windowName) { this.frontend = frontend; undoManager = new ContainerUndoRedoManager(); undoQueue = new UndoQueue(); undoManager.UndoQueue = undoQueue; sourceWidget = windowName; this.project = sourceProject; rootWidget = sourceProject.GetTopLevelWrapper(windowName, true); rootWidget.Select(); undoManager.RootObject = rootWidget; this.project.Changed += new ProjectChangedEventHandler(OnChanged); this.project.ProjectReloaded += new EventHandler(OnProjectReloaded); this.project.ProjectReloading += new EventHandler(OnProjectReloading); // this.project.WidgetMemberNameChanged += new Stetic.Wrapper.WidgetNameChangedHandler (OnWidgetNameChanged); }
public WidgetActionBar(WidgetDesignerFrontend frontend, Stetic.Wrapper.Widget rootWidget) { this.frontend = frontend; editors = new Hashtable(); wrappers = new Hashtable(); sensitives = new Hashtable(); invisibles = new Hashtable(); toggles = new ArrayList(); IconSize = IconSize.Menu; Orientation = Orientation.Horizontal; ToolbarStyle = ToolbarStyle.BothHoriz; combo = new WidgetTreeCombo(); comboItem = new ToolItem(); comboItem.Add(combo); comboItem.ShowAll(); Insert(comboItem, -1); ShowAll(); RootWidget = rootWidget; }
public WidgetActionBar (WidgetDesignerFrontend frontend, Stetic.Wrapper.Widget rootWidget) { this.frontend = frontend; editors = new Hashtable (); wrappers = new Hashtable (); sensitives = new Hashtable (); invisibles = new Hashtable (); toggles = new ArrayList (); IconSize = IconSize.Menu; Orientation = Orientation.Horizontal; ToolbarStyle = ToolbarStyle.BothHoriz; combo = new WidgetTreeCombo (); comboItem = new ToolItem (); comboItem.Add (combo); comboItem.ShowAll (); Insert (comboItem, -1); ShowAll (); RootWidget = rootWidget; }
internal WidgetDesigner (Project project, string componentName, bool autoCommitChanges): base (project.App) { this.componentName = componentName; this.autoCommitChanges = autoCommitChanges; this.project = project; frontend = new WidgetDesignerFrontend (this); if (autoCommitChanges) editedProject = project; else editedProject = new Project (project.App); editedProject.SignalAdded += OnSignalAdded; editedProject.SignalRemoved += OnSignalRemoved; editedProject.SignalChanged += OnSignalChanged; editedProject.ComponentNameChanged += OnComponentNameChanged; editedProject.ComponentTypesChanged += OnComponentTypesChanged; project.BackendChanged += OnProjectBackendChanged; editedProject.BackendChanged += OnProjectBackendChanged; CreateSession (); }
protected override void OnDestroyed () { try { if (disposed) return; if (project.App.ActiveProject == editedProject) project.App.ActiveProject = null; disposed = true; frontend.disposed = true; editedProject.SignalAdded -= OnSignalAdded; editedProject.SignalRemoved -= OnSignalRemoved; editedProject.SignalChanged -= OnSignalChanged; editedProject.ComponentNameChanged -= OnComponentNameChanged; editedProject.BackendChanged -= OnProjectBackendChanged; editedProject.ComponentTypesChanged -= OnComponentTypesChanged; project.BackendChanged -= OnProjectBackendChanged; if (session != null) { session.Dispose (); session = null; } if (!autoCommitChanges) editedProject.Dispose (); System.Runtime.Remoting.RemotingServices.Disconnect (frontend); frontend = null; rootWidget = null; selection = null; } finally { base.OnDestroyed (); } }
public void Dispose () { sourceProject.ComponentTypesChanged -= OnSourceProjectLibsChanged; sourceProject.ProjectReloaded -= OnSourceProjectReloaded; gproject.ModifiedChanged -= new EventHandler (OnModifiedChanged); gproject.Changed -= new EventHandler (OnChanged); gproject.ProjectReloaded -= OnProjectReloaded; gproject.ProjectReloading -= OnProjectReloading; // gproject.WidgetMemberNameChanged -= new Stetic.Wrapper.WidgetNameChangedHandler (OnWidgetNameChanged); if (!autoCommitChanges) { // Don't dispose the project here! it will be disposed by the frontend if (widget != null) { widget.SelectionChanged -= OnSelectionChanged; // Don't dispose the widget. It will be disposed when destroyed together // with the container widget = null; } } if (plug != null) plug.Destroy (); gproject = null; rootWidget = null; frontend = null; System.Runtime.Remoting.RemotingServices.Disconnect (this); disposed = true; }
internal WidgetEditSession CreateWidgetDesignerSession(WidgetDesignerFrontend frontend, string windowName, Stetic.ProjectBackend editingBackend, bool autoCommitChanges) { return(new WidgetEditSession(this, frontend, windowName, editingBackend, autoCommitChanges)); }
internal WidgetEditSession CreateWidgetDesignerSession (WidgetDesignerFrontend frontend, string windowName, Stetic.ProjectBackend editingBackend, bool autoCommitChanges) { return new WidgetEditSession (this, frontend, windowName, editingBackend, autoCommitChanges); }
// internal WidgetEditSession CreateWidgetDesignerSession (WidgetDesignerFrontend frontend, string windowName, Stetic.ProjectBackend editingBackend, bool autoCommitChanges) // { // return new WidgetEditSession (this, frontend, windowName, editingBackend, autoCommitChanges); // } internal WidgetEditSession CreateWidgetDesignerSession(WidgetDesignerFrontend frontend, string windowName) { return(new WidgetEditSession(this, frontend, windowName)); }
public void Dispose () { project.ComponentTypesChanged -= OnSourceProjectLibsChanged; project.ProjectReloaded -= OnSourceProjectReloaded; project.Changed -= new ProjectChangedEventHandler (OnChanged); project.ProjectReloaded -= OnProjectReloaded; project.ProjectReloading -= OnProjectReloading; // project.WidgetMemberNameChanged -= new Stetic.Wrapper.WidgetNameChangedHandler (OnWidgetNameChanged); if (plug != null) plug.Destroy (); rootWidget = null; frontend = null; System.Runtime.Remoting.RemotingServices.Disconnect (this); disposed = true; }
// internal WidgetEditSession CreateWidgetDesignerSession (WidgetDesignerFrontend frontend, string windowName, Stetic.ProjectBackend editingBackend, bool autoCommitChanges) // { // return new WidgetEditSession (this, frontend, windowName, editingBackend, autoCommitChanges); // } internal WidgetEditSession CreateWidgetDesignerSession (WidgetDesignerFrontend frontend, string windowName) { return new WidgetEditSession (this, frontend, windowName); }