Inheritance: System.MarshalByRefObject
Exemplo n.º 1
0
        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();
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
		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);
		}
Exemplo n.º 5
0
		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 ();
		}
Exemplo n.º 6
0
        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();
            }
        }
Exemplo n.º 8
0
        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;
        }
Exemplo n.º 9
0
		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);
		}
Exemplo n.º 10
0
        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);
        }
Exemplo n.º 11
0
        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;
        }
Exemplo n.º 12
0
		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;
		}
Exemplo n.º 13
0
		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 ();
		}
Exemplo n.º 14
0
		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 ();
			}
		}
Exemplo n.º 15
0
		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;
		}
Exemplo n.º 16
0
 internal WidgetEditSession CreateWidgetDesignerSession(WidgetDesignerFrontend frontend, string windowName, Stetic.ProjectBackend editingBackend, bool autoCommitChanges)
 {
     return(new WidgetEditSession(this, frontend, windowName, editingBackend, autoCommitChanges));
 }
Exemplo n.º 17
0
		internal WidgetEditSession CreateWidgetDesignerSession (WidgetDesignerFrontend frontend, string windowName, Stetic.ProjectBackend editingBackend, bool autoCommitChanges)
		{
			return new WidgetEditSession (this, frontend, windowName, editingBackend, autoCommitChanges);
		}
Exemplo n.º 18
0
//		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));
        }
Exemplo n.º 19
0
		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;
		}
Exemplo n.º 20
0
//		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);
		}