示例#1
0
		void OnBackendChanging ()
		{
			selection = null;
				
			if (BackendChanging != null)
				BackendChanging ();
		}
示例#2
0
		internal WidgetInfo (Project project, Component c): base (project, c.Name)
		{
			type = c.Type.Name;
		}
示例#3
0
		protected void ClearCollections ()
		{
			lock (types) {
				types.Clear ();
			}
			
			Component[] comps;
			lock (components) {
				// All components should have been cleared by the backend,
				// just make sure it did
				comps = new Component [components.Count];
				components.Values.CopyTo (comps, 0);
				components.Clear ();
			}
			
			foreach (Component c in comps) {
				c.Dispose ();
			}
		}
示例#4
0
		internal void DisposeComponent (Component c)
		{
			lock (components) {
				components.Remove (c.Backend);
			}
		}
示例#5
0
		internal void NotifyRootWidgetChanged ()
		{
			object rw = session.RootWidget;
			if (rw != null)
				rootWidget = app.GetComponent (session.RootWidget, null, null);
			else
				rootWidget = null;

			UpdateWidget ();
			if (RootComponentChanged != null)
				RootComponentChanged (this, EventArgs.Empty);
		}
示例#6
0
		internal void NotifySelectionChanged (object ob, bool canCut, bool canCopy, bool canPaste, bool canDelete)
		{
			this.canCut = canCut;
			this.canCopy = canCopy;
			this.canPaste = canPaste;
			this.canDelete = canDelete;
			
			if (ob != null)
				selection = app.GetComponent (ob, null, null);
			else
				selection = null;

			if (SelectionChanged != null)
				SelectionChanged (this, EventArgs.Empty);
		}
示例#7
0
		void CreateSession ()
		{
			try {
				session = project.ProjectBackend.CreateWidgetDesignerSession (frontend, componentName, editedProject.ProjectBackend, autoCommitChanges);
				ResetCustomWidget ();
				rootWidget = app.GetComponent (session.RootWidget, null, null);
			} catch (Exception ex) {
				Console.WriteLine (ex);
				Gtk.Label lab = new Gtk.Label ();
				lab.Text = Mono.Unix.Catalog.GetString ("The designer could not be loaded.") + "\n\n" + ex.Message;
				lab.Wrap = true;
				lab.WidthRequest = 400;
				AddCustomWidget (lab);
				session = null;
			}
		}
示例#8
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 ();
			}
		}
		public ComponentSignalEventArgs (Project p, Component c, Signal oldSignal, Signal signal): base (p, c)
		{
			this.oldSignal = oldSignal;
			this.signal = signal;
		}
 internal ComponentNameEventArgs(Project p, Component c, string oldName) : base(p, c)
 {
     this.oldName = oldName;
 }
 internal ComponentEventArgs(Project p, Component c)
 {
     project   = p;
     component = c;
 }
		internal ComponentNameEventArgs (Project p, Component c, string oldName): base (p, c)
		{
			this.oldName = oldName;
		}
		internal ComponentEventArgs (Project p, Component c)
		{
			project = p;
			component = c;
		}