예제 #1
0
파일: AddonManager.cs 프로젝트: nistck/Jx
        private void AddonsMainMenu_Click(object obj, EventArgs eventArgs)
        {
            ToolStripMenuItem key           = (ToolStripMenuItem)obj;
            DesignerAddon     designerAddon = this.designerAddonMenuDic[key];

            designerAddon.OnMainMenuItemClick();
        }
예제 #2
0
파일: AddonManager.cs 프로젝트: nistck/Jx
        public bool PreInitInternal()
        {
            DesignerAddon.Internal_InitApplicationData(MainForm.Instance, MainForm.Instance.MainMenu, MainForm.Instance.ToolStripGeneral, MainForm.Instance.DockPanel);
            List <Assembly> list = new List <Assembly>();

            ComponentManager.ComponentInfo[] componentsByType = ComponentManager.Instance.GetComponentsByType(ComponentManager.ComponentTypeFlags.DesignerAddon, true);
            for (int i = 0; i < componentsByType.Length; i++)
            {
                ComponentManager.ComponentInfo            componentInfo = componentsByType[i];
                ComponentManager.ComponentInfo.PathInfo[] allEntryPointsForThisPlatform = componentInfo.GetAllEntryPointsForThisPlatform();
                for (int j = 0; j < allEntryPointsForThisPlatform.Length; j++)
                {
                    ComponentManager.ComponentInfo.PathInfo pathInfo = allEntryPointsForThisPlatform[j];
                    Assembly item = AssemblyUtils.LoadAssemblyByRealFileName(pathInfo.Path, false);
                    if (item != null && !list.Contains(item))
                    {
                        list.Add(item);
                    }
                }
            }


            foreach (Assembly current in list)
            {
                Type[] types = current.GetTypes();
                for (int k = 0; k < types.Length; k++)
                {
                    Type type = types[k];
                    if (typeof(DesignerAddon).IsAssignableFrom(type) && !type.IsAbstract)
                    {
                        ConstructorInfo constructor = type.GetConstructor(new Type[0]);
                        DesignerAddon   item2       = (DesignerAddon)constructor.Invoke(null);
                        resourceEditorAddons.Add(item2);
                    }
                }
            }
            return(true);
        }