Пример #1
0
 private void Tsmi_ReloadSetting_Click(object sender, EventArgs e)
 {
     InitUi.InitGlobalSetting();
 }
Пример #2
0
        public FormMain()
        {
            InitializeComponent();
            //线程安全开关,关闭这个就能跨线程访问控件
            //CheckForIllegalCrossThreadCalls = false;

            _pluginsImport = new PluginsImport();
            //导入插件
            Compose();

            //tab事件绑定
            tabControl1.DoubleClick += tabControl1_DoubleClick;
            //设置版本号标签靠右
            toolStripStatusLabel_productVersion.Alignment = ToolStripItemAlignment.Right;
            toolStripStatusLabel_productVersion.Text      = string.Format("Version:{0}@KeePwn", Application.ProductVersion);

            TabCore.Init(this, this.tabControl1);
            //TabCore.Init(this, this.customTabControl1);
            TabCore.CreateTabPage_ShellManager(_pluginsImport.Plugins);

            InitTreeView();
            InitUi.InitCustomShellType();
            InitUi.InitGlobalSetting();

            TreeNode treeNodeRoot1 = new TreeNode("Plugins");

            this.treeView_func.Nodes.AddRange(new TreeNode[] { treeNodeRoot1 });

            foreach (var plugin in _pluginsImport.Plugins)
            {
                //添加tabpage到TabCore中
                string title = plugin.PluginAttribute.Title;
                //TabCore.CreateNewTabPage(name, ucplugin.Content);

                //添加到Plugins节点中
                TreeNode treeNode1 = new TreeNode(title);
                treeNodeRoot1.Nodes.Add(treeNode1);

                //添加到Tsmi_Plugins中
                ToolStripMenuItem item = new ToolStripMenuItem();
                item.Name            = title;
                item.Text            = title;
                item.Checked         = true;
                item.Tag             = plugin;
                item.CheckOnClick    = true;
                item.CheckedChanged += item_CheckedChanged;
                Tsmi_Plugins.DropDownItems.Add(item);

                //绑定插件的事件
                plugin.HostService.ShowMsgInStatusBar = Host_ShowMsgInStatusBar;
                plugin.HostService.ShowMsgInAppDialog = Host_ShowMsgInAppDialog;
                plugin.HostService.CreateNewTabPage   = Host_CreateNewTabPage;
                plugin.HostService.SubmitCommand      = SubmitCommand;
                //ucplugin.Func.OnSubmit += Func_OnSubmit;
            }


            //test
            TreeNode treeNodeRoot2;

            treeNodeRoot2      = InitUi.GetCustomShellTypeTree();
            treeNodeRoot2.Name = "ShellType";
            treeNodeRoot2.Text = "ShellType";
            this.treeView_func.Nodes.AddRange(new TreeNode[] { treeNodeRoot2 });


            //显示免责声明
            InitUi.InitWelcome();
        }