Esempio n. 1
0
        private void InitMenu()
        {
            XmlDocument doc = new XmlDocument();
            //检测项目文档里面是否有插件的界面配置,如果没有,则使用默认配置,如果有,则使用配置文件里面的配置
            Guid      dllGuid = new Guid("f9bff4cd-5840-48c1-9a7b-2385c554d95b");
            XmlPlugin plugin  = ((ISecureContext)_context).YutaiProject.Plugins.FirstOrDefault(c => c.Guid == dllGuid);

            if (plugin != null)
            {
                if (string.IsNullOrEmpty(plugin.MenuXML))
                {
                    doc.Load(base.GetType().Assembly.GetManifestResourceStream("Yutai.Test.Menu.MenuLayout.xml"));
                }
                else
                {
                    FileInfo info = new FileInfo(FileHelper.GetFullPath(plugin.MenuXML));
                    if (info.Exists)
                    {
                        doc.Load(FileHelper.GetFullPath(plugin.MenuXML));
                    }
                    else
                    {
                        doc.Load(base.GetType().Assembly.GetManifestResourceStream("Yutai.Test.Menu.MenuLayout.xml"));
                    }
                }
            }
            else
            {
                doc.Load(base.GetType().Assembly.GetManifestResourceStream("Yutai.Test.Menu.MenuLayout.xml"));
            }
            RibbonFactory.CreateMenus(_commands.GetCommands(), (RibbonControl)_menuManager, _context.MainView.RibbonStatusBar as RibbonStatusBar, doc);
        }
Esempio n. 2
0
        private void InitMenus()
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(base.GetType().Assembly.GetManifestResourceStream("Yutai.Pipeline.Editor.Menu.MenuLayout.xml"));
            RibbonFactory.CreateMenus(_commands.GetCommands(), (RibbonControl)_menuManager,
                                      _context.MainView.RibbonStatusBar as RibbonStatusBar, doc);
        }
Esempio n. 3
0
        private void InitMenu()
        {
            XmlDocument doc       = new XmlDocument();
            string      resString = "Yutai.Plugins.Bookmark.Menu.MenuLayout.xml";

            doc.Load(base.GetType().Assembly.GetManifestResourceStream(resString));
            RibbonFactory.CreateMenus(_commands.GetCommands(), (RibbonControl)_menuManager,
                                      _context.MainView.RibbonStatusBar as RibbonStatusBar, doc);
        }
Esempio n. 4
0
        private void InitMenus()
        {
            XmlDocument doc      = new XmlDocument();
            Assembly    assembly = base.GetType().Assembly;
            Stream      stream   = assembly.GetManifestResourceStream(@"Yutai.Check.Menu.MenuLayout.xml");

            if (stream != null)
            {
                doc.Load(stream);
            }
            RibbonFactory.CreateMenus(_commands.GetCommands(), (RibbonControl)_menuManager,
                                      _context.MainView.RibbonStatusBar as RibbonStatusBar, doc);
        }
Esempio n. 5
0
        private void InitMenus()
        {
            XmlDocument doc = new XmlDocument();
            //检测项目文档里面是否有插件的界面配置,如果没有,则使用默认配置,如果有,则使用配置文件里面的配置
            Guid      dllGuid   = new Guid("5e933989-b5a4-4a45-a5b7-2d9ded61df0f");
            string    resString = "Yutai.Plugins.Template.Menu.MenuLayout.xml";
            XmlPlugin plugin    =
                ((ISecureContext)_context).YutaiProject?.Plugins.FirstOrDefault(
                    c => c.Guid == dllGuid);

            if (plugin != null)
            {
                if (string.IsNullOrEmpty(plugin.MenuXML))
                {
                    doc.Load(base.GetType().Assembly.GetManifestResourceStream(resString));
                }
                else
                {
                    FileInfo info = new FileInfo(FileHelper.GetFullPath(plugin.MenuXML));
                    if (info.Exists)
                    {
                        doc.Load(FileHelper.GetFullPath(plugin.MenuXML));
                    }
                    else
                    {
                        doc.Load(base.GetType().Assembly.GetManifestResourceStream(resString));
                    }
                }
            }
            else
            {
                doc.Load(base.GetType().Assembly.GetManifestResourceStream(resString));
            }

            RibbonFactory.CreateMenus(_commands.GetCommands(), (RibbonControl)_menuManager,
                                      _context.MainView.RibbonStatusBar as RibbonStatusBar, doc);
        }