Beispiel #1
0
 private void Tsmi_ReloadShellType_Click(object sender, EventArgs e)
 {
     InitUi.InitCustomShellType();
 }
Beispiel #2
0
        public FormMain()
        {
            InitializeComponent();
            //CheckForIllegalCrossThreadCalls = false;

            //目录初始化
            if (!Directory.Exists("Bin"))
            {
                Directory.CreateDirectory("Bin");
            }
            if (!Directory.Exists("Plugins"))
            {
                Directory.CreateDirectory("Plugins");
            }
            if (!Directory.Exists("Plugins/Config"))
            {
                Directory.CreateDirectory("Plugins/Config");
            }
            if (!Directory.Exists("Languages"))
            {
                Directory.CreateDirectory("Languages");
            }

            /*使用MEF导入插件
             * MEF的使用步骤:
             * 1.导出标指定对象[Export];
             * 2.在宿主代码中设定[Import];
             * 3.组合部件(主要是将宿主中Import和导出Export对象进行引用链接);
             * 4.使用导入的对象。*/
            //----导入插件----
            _pluginsImport = new PluginsImport();
            _host          = new Host(this);//该接口类实例将作为参数传递给MEF导入类的构造函数,方便导入对象使用
            Compose();
            //----导入插件结束----


            //----数据初始化----
            InitUi.InitCustomShellType(); //读取指定目录的CustomShellType文件内容到程序中,并进行相关设置
            InitUi.InitGlobalSetting();   //读取指定目录的Setting文件内容到程序中,并进行相关设置
            //----数据初始化结束----


            //----UI处理----
            //tabControl事件绑定
            tabControl1.DoubleClick += tabControl1_DoubleClick;//添加双击Tab选项卡标题则关闭选项卡的事件处理函数
            //设置版本号
            toolStripStatusLabel_productVersion.Text = string.Format("Version:{0}@KeePwn", Assembly.GetExecutingAssembly().GetName().Version);
            //tabControl初始化
            TabCore.Init(this, this.tabControl1);//TabCore类的作用主要是在TabControl中添加新的TabPage


            //treenode
            TreeNode treeNodeRoot1;

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

            //加载Plugins菜单项
            LoadPluginsInUi(_pluginsImport.Plugins.OrderBy(p => p.PluginSetting.IndexInList).ThenBy(p => p.PluginInfo.Name));
            //----UI处理结束----


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

            //auto load plugins
            AutoLoadPlugins(_pluginsImport.Plugins);
        }
Beispiel #3
0
 private void Tsmi_ReloadSetting_Click(object sender, EventArgs e)
 {
     InitUi.InitGlobalSetting(AppEnvironment.AppPath);
 }
Beispiel #4
0
 /// <summary>
 /// 获取CustomShellType节点DbManager的子节点名字列表
 /// </summary>
 /// <param name="shellTypeName"></param>
 /// <returns></returns>
 public string[] GetDbNodeFuncCodeNameList(string shellTypeName)
 {
     return(InitUi.GetDbNodeFuncCodeNameList(shellTypeName));
 }
Beispiel #5
0
 /// <summary>
 /// 获取所有自定义ShellType名称并生成数组
 /// </summary>
 /// <returns></returns>
 public string[] GetCustomShellTypeNameList()
 {
     return(InitUi.GetCustomShellTypeNameList());
 }
Beispiel #6
0
 /// <summary>
 /// 获取指定ShellType的<serviceExample></serviceExample>一句话木马语句
 /// </summary>
 /// <param name="shellTypeName"></param>
 /// <returns></returns>
 public string GetCustomShellTypeServerCode(string shellTypeName)
 {
     return(InitUi.GetCustomShellTypeServerCode(shellTypeName));
 }