GetTopLevelWrapper() public method

public GetTopLevelWrapper ( string name, bool throwIfNotFound ) : Container
name string
throwIfNotFound bool
return Stetic.Wrapper.Container
 void OnProjectReloaded(object s, EventArgs a)
 {
     // Called when the underlying project has changed. Object references need to be updated.
     if (autoCommitChanges)
     {
         if (designer != null)
         {
             if (groupToEdit != null)
             {
                 groupToolbar.ActiveGroup = project.ActionGroups [groupToEdit];
             }
             else
             {
                 Stetic.Wrapper.Container container = project.GetTopLevelWrapper(containerName, true);
                 groupToolbar.ActionGroups = container.LocalActionGroups;
             }
         }
     }
     else
     {
         // We only need to remap the actions
         group = project.ActionGroups [groupToEdit];
         actionCopyMap.Clear();
         foreach (Wrapper.Action dupac in groupCopy.Actions)
         {
             Wrapper.Action ac = group.GetAction(dupac.Name);
             if (ac != null)
             {
                 actionCopyMap [dupac] = ac;
             }
         }
     }
 }
Example #2
0
        public WidgetComponent GetComponent(string name)
        {
            object ob = ProjectBackend.GetTopLevelWrapper(name, false);

            if (ob != null)
            {
                return((WidgetComponent)App.GetComponent(ob, name, null));
            }
            else
            {
                return(null);
            }
        }
Example #3
0
        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();
            };
        }
Example #4
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);
        }
Example #5
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);
		}
		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 (); };
		}