Example #1
0
        public PluginView CreateToolPluginView(PhactoryHost.ToolPlugin pluginTool)
        {
            PluginView pluginView = new PluginView(false);

            pluginView.Text = pluginTool.GetName();
            pluginView.Show(dockPanel);

            return(pluginView);
        }
Example #2
0
        public PluginView GetActivePluginView()
        {
            if (dockPanel.ActiveDocument == null)
            {
                return(null);
            }

            PluginView pluginView = dockPanel.ActiveDocument as PluginView;

            return(pluginView);
        }
Example #3
0
        public PluginView CreatePluginView(PhactoryHost.Database.Resource resource, bool isDependency)
        {
            PluginView pluginView = new PluginView(isDependency);

            string filename = resource.RelativePath;

            pluginView.Text     = new FileInfo(filename).Name;
            pluginView.Resource = resource;
            pluginView.Show(dockPanel);

            return(pluginView);
        }
Example #4
0
        public PhactoryHost.Database.Resource GetActivePluginResource()
        {
            PhactoryHost.Database.Resource resource = null;

            PluginView pluginView = GetActivePluginView();

            if (pluginView != null)
            {
                resource = pluginView.Resource;
            }

            return(resource);
        }
Example #5
0
        private void CloseResource()
        {
            PhactoryHost.Database.Resource resource = App.Controller.View.GetActivePluginResource();
            if (resource != null)
            {
                PluginView pluginView = FindPluginView(resource);
                if (pluginView != null)
                {
                    pluginView.Close();
                }
            }

            this.RefreshButtons();
        }
Example #6
0
        public void OnResourceDeleted(PhactoryHost.Database.Resource resource)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new OnResourceDeletedDelegate(OnResourceDeleted), new object[] { resource });
                return;
            }

            PluginView pluginView = FindPluginView(resource);

            if (pluginView != null)
            {
                App.Controller.PluginManager.OnResourceDeleted(pluginView, resource);
            }
        }
Example #7
0
        public void CloseAllResources()
        {
            List <PhactoryHost.Database.Resource> allEditedResources = App.Controller.View.GetAllEditedResources();

            foreach (PhactoryHost.Database.Resource resource in allEditedResources)
            {
                PluginView pluginView = FindPluginView(resource);
                if (pluginView != null)
                {
                    pluginView.Close();
                }
            }

            this.RefreshButtons();
        }
Example #8
0
        public PluginView FindPluginDependencyView(PhactoryHost.Database.Resource resource)
        {
            foreach (IDockContent content in dockPanel.Documents)
            {
                PluginView pluginView = content as PluginView;
                if (pluginView != null)
                {
                    if ((pluginView.IsDependency == true) && (pluginView.Resource.Id == resource.Id))
                    {
                        return(pluginView);
                    }
                }
            }

            return(null);
        }
Example #9
0
        public void OnResourceChanged(PhactoryHost.Database.Resource resource)
        {
            if (this.InvokeRequired)
            {
                Delegate method = new OnResourceChangedDelegate(OnResourceChanged);
                object[] args   = new object[] { resource };
                this.Invoke(method, args);
                return;
            }

            PluginView pluginView = FindPluginView(resource);

            if (pluginView != null)
            {
                App.Controller.PluginManager.OnResourceChanged(pluginView, resource);
            }
        }
Example #10
0
        public List <PhactoryHost.Database.Resource> GetAllEditedResources()
        {
            List <PhactoryHost.Database.Resource> allEditedResources = new List <PhactoryHost.Database.Resource>();

            foreach (IDockContent content in dockPanel.Documents)
            {
                PluginView pluginView = content as PluginView;
                if (pluginView != null)
                {
                    if (pluginView.IsDependency == false)
                    {
                        allEditedResources.Add(pluginView.Resource);
                    }
                }
            }

            return(allEditedResources);
        }
Example #11
0
 public void SetFocusedView(PluginView view)
 {
     view.DockHandler.Activate();
 }
Example #12
0
        public PluginView CreateToolPluginView(PhactoryHost.ToolPlugin pluginTool)
        {
            PluginView pluginView = new PluginView(false);

            pluginView.Text = pluginTool.GetName();
            pluginView.Show(dockPanel);

            return pluginView;
        }
Example #13
0
        public PluginView CreatePluginView(PhactoryHost.Database.Resource resource, bool isDependency)
        {
            PluginView pluginView = new PluginView(isDependency);

            string filename = resource.RelativePath;
            pluginView.Text = new FileInfo(filename).Name;
            pluginView.Resource = resource;
            pluginView.Show(dockPanel);

            return pluginView;
        }
Example #14
0
 public void SetFocusedView(PluginView view)
 {
     view.DockHandler.Activate();
 }