Exemplo n.º 1
0
        private void GetBaseToolAndEdit()
        {
            PLTool tool = new PLTool();

            try
            {
                this.allTools = tool.GetAllTools();
            }
            catch
            {
                MessageBox.Show("获取工具软件信息失败", "文件类型", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
            PLBrowser browser = new PLBrowser();

            try
            {
                this.allEditor = browser.GetAllEditors();
            }
            catch
            {
                MessageBox.Show("获取编辑器信息失败", "文件类型", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }
Exemplo n.º 2
0
        public void CreatList()
        {
            PLBrowser browser     = new PLBrowser();
            ArrayList allBrowsers = null;
            ArrayList allEditors  = null;

            try
            {
                allBrowsers = browser.GetAllBrowsers();
                allEditors  = browser.GetAllEditors();
            }
            catch (EnvironmentException exception)
            {
                MessageBox.Show(exception.Message, "编辑浏览器管理", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }
            catch
            {
                MessageBox.Show("显示编辑器、浏览器信息失败!", "编辑浏览器管理", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }
            for (int i = 0; i < allBrowsers.Count; i++)
            {
                DEBrowser browser2 = (DEBrowser)allBrowsers[i];
                string    str      = "";
                string    str2     = "";
                if ((browser2.Option & 1) == 1)
                {
                    str = "缺省浏览器";
                }
                if ((browser2.Option & 4) == 4)
                {
                    str2 = "系统浏览器";
                }
                else
                {
                    str2 = "定制浏览器";
                }
                string[]     items = new string[] { browser2.Name, str, str2, browser2.Creator, browser2.CreatTime.ToString("yyyy-MM-dd"), browser2.Description };
                ListViewItem item  = new ListViewItem(items)
                {
                    Tag        = browser2,
                    ImageIndex = ClientData.MyImageList.GetIconIndex("ICO_ENV_BROWER")
                };
                this.lvwBrowser.Items.Add(item);
            }
            for (int j = 0; j < allEditors.Count; j++)
            {
                DEBrowser browser3 = (DEBrowser)allEditors[j];
                string    str3     = "";
                string    str4     = "";
                if ((browser3.Option & 1) == 1)
                {
                    str3 = "缺省编辑器";
                }
                if ((browser3.Option & 0x10) == 0x10)
                {
                    str4 = "定制编辑器";
                }
                string[]     strArray2 = new string[] { browser3.Name, str3, str4, browser3.Creator, browser3.CreatTime.ToString("yyyy-MM-dd"), browser3.Description };
                ListViewItem item2     = new ListViewItem(strArray2)
                {
                    Tag        = browser3,
                    ImageIndex = ClientData.MyImageList.GetIconIndex("ICO_ENV_BROWER")
                };
                this.lvwBrowser.Items.Add(item2);
            }
        }