Exemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            this.DoubleBuffered(true);
            listView.DoubleBuffered(true);

            if (File.Exists(Settings.path))
            {
                set = XMLSerializer.FromXMLFile <Settings>(Settings.path);
            }
            else
            {
                set = new Settings(true);
                XMLSerializer.ToXMLFile <Settings>(set, Settings.path);
            }

            foreach (string f in set.schExtensionList)
            {
                cbFilter.Items.Add(f);
            }
            if (cbFilter.Items.Count > 0)
            {
                cbFilter.SelectedIndex = 0;
            }

            tw.DoWork           += Tw_DoWork;
            tw.OnCompleted      += Tw_OnCompleted;
            tw.OnProcessChanged += Tw_OnProcessChanged;

            //chkLstFolder.Items.Add(@"D:\Source\NetClient5\branches", true);
            //chkLstFolder.Items.Add(@"D:\csharp", true);
            //cbCondition.Text = "ImageViewer";

            ControlState(false);
        }
Exemplo n.º 2
0
        private void contextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            string file = listView.SelectedItems[0].Group.ToString();

            contextMenuStrip.Close();
            switch (e.ClickedItem.Name)
            {
            case "cmOpenFile":
                listView_MouseDoubleClick(this, null);
                break;

            case "cmOpenNotepad":
                if (string.IsNullOrWhiteSpace(set.NotepadPlusPath))
                {
                    MessageBox.Show("Notepad++ 실행파일을 선택해주세요.");
                    OpenFileDialog d = new OpenFileDialog();
                    d.Filter           = "EXE|*.exe";
                    d.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
                    if (d.ShowDialog() == DialogResult.OK)
                    {
                        set.NotepadPlusPath = d.FileName;
                        XMLSerializer.ToXMLFile <Settings>(set, Settings.path);
                    }
                    else
                    {
                        MessageBox.Show("Notepad++ 실행파일을 선택해야 사용하실 수 있습니다.");
                        return;
                    }
                }
                Process.Start(set.NotepadPlusPath, string.Format("\"{0}\" -n{1}", file, listView.SelectedItems[0].Text));
                break;

            case "cmOpenFolder":
                Process.Start("explorer.exe", "/select, " + file);
                break;
            }
        }