Inheritance: System.MarshalByRefObject
コード例 #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;
        }
コード例 #2
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();
        }
コード例 #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);
        }
コード例 #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);
		}
コード例 #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 ();
		}
コード例 #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();
        }
コード例 #7
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();
            }
        }
コード例 #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;
        }
コード例 #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);
		}
コード例 #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);
        }
コード例 #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;
        }
コード例 #12
0
ファイル: WidgetActionBar.cs プロジェクト: Kalnor/monodevelop
		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;
		}
コード例 #13
0
ファイル: WidgetDesigner.cs プロジェクト: Kalnor/monodevelop
		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 ();
		}
コード例 #14
0
ファイル: WidgetDesigner.cs プロジェクト: Kalnor/monodevelop
		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 ();
			}
		}
コード例 #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;
		}
コード例 #16
0
 internal WidgetEditSession CreateWidgetDesignerSession(WidgetDesignerFrontend frontend, string windowName, Stetic.ProjectBackend editingBackend, bool autoCommitChanges)
 {
     return(new WidgetEditSession(this, frontend, windowName, editingBackend, autoCommitChanges));
 }
コード例 #17
0
ファイル: ProjectBackend.cs プロジェクト: Kalnor/monodevelop
		internal WidgetEditSession CreateWidgetDesignerSession (WidgetDesignerFrontend frontend, string windowName, Stetic.ProjectBackend editingBackend, bool autoCommitChanges)
		{
			return new WidgetEditSession (this, frontend, windowName, editingBackend, autoCommitChanges);
		}
コード例 #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));
        }
コード例 #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;
		}
コード例 #20
0
ファイル: ProjectBackend.cs プロジェクト: Kalnor/monodevelop
//		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);
		}