Exemplo n.º 1
0
        private void cmiDel_Click(object sender, EventArgs e)
        {
            DEBrowser tag = (DEBrowser)this.lvwBrowser.SelectedItems[0].Tag;

            if ((tag.Option & 8) == 8)
            {
                if (MessageBox.Show("是否删除选中浏览器?", "删除浏览器", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    PLBrowser browser2 = new PLBrowser();
                    try
                    {
                        tag.Creator = ClientData.LogonUser.LogId;
                        if (browser2.Delete(tag))
                        {
                            this.lvwBrowser.SelectedItems[0].Remove();
                            this.frmMain.RefreshBrowser();
                            this.frmMain.FileTypeRefresh(sender, e);
                        }
                    }
                    catch (EnvironmentException exception)
                    {
                        MessageBox.Show(exception.Message, "删除浏览器", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    }
                    catch
                    {
                        MessageBox.Show("删除浏览器失败!", "删除浏览器", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    }
                }
            }
            else if (((tag.Option & 0x10) == 0x10) && (MessageBox.Show("是否删除选中编辑器?", "删除编辑器", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK))
            {
                PLBrowser browser3 = new PLBrowser();
                try
                {
                    tag.Creator = ClientData.LogonUser.LogId;
                    if (browser3.Delete(tag))
                    {
                        this.lvwBrowser.SelectedItems[0].Remove();
                        this.frmMain.RefreshBrowser();
                        this.frmMain.FileTypeRefresh(sender, e);
                    }
                }
                catch (EnvironmentException exception2)
                {
                    MessageBox.Show(exception2.Message, "删除编辑器", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
                catch
                {
                    MessageBox.Show("删除编辑器失败!", "删除编辑器", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
            }
        }
Exemplo n.º 2
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.º 3
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);
            }
        }