示例#1
0
        public DLLUsageForm()
        {
            InitializeComponent();
            ProcessList = new ProcessList(treeView1);
            treeView1.MouseWheel += new MouseEventHandler(OnMouseWheel);

            dllusage.Properties.Settings settings = new dllusage.Properties.Settings();
            treeView1.Font = new Font(settings.FontFace, settings.FontHeight);

            ContextMenu cm = new ContextMenu();
            DefineContextMenu(cm, "Show dependencies", tsmDependencies_Click);
            DefineContextMenu(cm, "Console", tsmConsole_Click);
            DefineContextMenu(cm, "Explorer", tsmExplorer_Click);
            cm.MenuItems.Add("-");
            DefineContextMenu(cm, "Copy to clipboard", copyToClipboardToolStripMenuItem_Click);
            DefineContextMenu(cm, "Copy to clipboard in quotationmarks", copyToClipboardInquotationmarksToolStripMenuItem_Click);

            if (!FindProgram("depends.exe", ref DependsExe))
            {
                // special case: depends.exe may not reside on the path,
                // but the normal install location is easy enough
                DependsExe = null;
                tsmDependencies.Enabled = false;
                tsbDependencies.Enabled = false;
                cm.MenuItems[0].Enabled = false;
            }

            if (!FindProgram("cmd.exe", ref CmdExe))
            {
                CmdExe = null;
                tsmConsole.Enabled = false;
                tsbConsole.Enabled = false;
                cm.MenuItems[1].Enabled = false;
            }

            treeView1.ContextMenu = cm;

            Text = string.Format("DLLUSAGE {0}", GSharpTools.AppVersion.Get());
        }
示例#2
0
        private void DLLUsageForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            dllusage.Properties.Settings settings = new dllusage.Properties.Settings();

            settings.FontFace = treeView1.Font.Name;
            settings.FontHeight = treeView1.Font.SizeInPoints;
            settings.Save();
        }