GetTopLevelWrapper() 공개 메소드

public GetTopLevelWrapper ( string name, bool throwIfNotFound ) : Container
name string
throwIfNotFound bool
리턴 Stetic.Wrapper.Container
예제 #1
0
 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;
             }
         }
     }
 }
예제 #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);
            }
        }
예제 #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();
            };
        }
예제 #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);
        }
예제 #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);
		}
예제 #6
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 (); };
		}