Пример #1
0
        private void tbox_OuputFolder_Click(object sender, EventArgs e)
        {
            var SelectFolderDlg = new FolderBrowserDialogEx();

            SelectFolderDlg.Description             = "Select a folder:";             //message
            SelectFolderDlg.ShowNewFolderButton     = true;
            SelectFolderDlg.ShowEditBox             = false;                          //editbox
            SelectFolderDlg.ShowBothFilesAndFolders = false;                          //show files and folders
            SelectFolderDlg.RootFolder = System.Environment.SpecialFolder.MyComputer; //start from computer

            DialogResult result = SelectFolderDlg.ShowDialog();

            if (result == DialogResult.OK)
            {
                DataAccess.Instance.g_Output_dir = SelectFolderDlg.SelectedPath;
                tbox_OuputFolder.Text            = SelectFolderDlg.SelectedPath;

                _outputFolderSelected = true;

                if (this.chk_SourceFolder.Checked)
                {
                    this.tbox_OuputFolder.Text = this.tbox_SourceFile.Text;
                }
            }
        }
Пример #2
0
        // Factory Methods
        public static FolderBrowserDialogEx PrinterBrowser()
        {
            FolderBrowserDialogEx x = new FolderBrowserDialogEx();

            // avoid MBRO comppiler warning when passing _rootFolderLocation as a ref:
            x.BecomePrinterBrowser();
            return(x);
        }
Пример #3
0
        /// <summary>
        /// User clicked on textbox, opendialog to select file or folder
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tbox_SourceFile_Click(object sender, EventArgs e)
        {
            var SelectFolderDlg = new FolderBrowserDialogEx();

            SelectFolderDlg.Description             = "Select a file or folder:";     //message
            SelectFolderDlg.ShowNewFolderButton     = true;
            SelectFolderDlg.ShowEditBox             = false;                          //editbox
            SelectFolderDlg.ShowBothFilesAndFolders = true;                           //show files and folders
            SelectFolderDlg.RootFolder = System.Environment.SpecialFolder.MyComputer; //start from computer

            DialogResult result = SelectFolderDlg.ShowDialog();

            if (result == DialogResult.OK)
            {
                DataAccess.Instance.g_WorkingDir = SelectFolderDlg.SelectedPath;
                tbox_SourceFile.Text             = SelectFolderDlg.SelectedPath;

                //check if file or folder
                if (File.Exists(DataAccess.Instance.g_WorkingDir)) //is a file
                {
                    //check the extension
                    var ext = Path.GetExtension(SelectFolderDlg.SelectedPath).ToLower();
                    if (ext == ".pdf")
                    {
                        chk_cbr2pdf.Checked    = false;
                        chk_cbr2pdf.Enabled    = false;
                        chk_pdf2cbr.Checked    = true;
                        chk_pdf2cbr.Enabled    = true;
                        chk_JoinImages.Enabled = true;
                    }
                    else if (ext == ".cbr" || ext == ".cbz")
                    {
                        chk_cbr2pdf.Checked    = true;
                        chk_cbr2pdf.Enabled    = true;
                        chk_pdf2cbr.Checked    = false;
                        chk_pdf2cbr.Enabled    = false;
                        chk_JoinImages.Enabled = false;
                    }
                }
                else //is a folder
                {
                    chk_cbr2pdf.Checked = true;
                    chk_cbr2pdf.Enabled = true;
                    chk_pdf2cbr.Checked = true;
                    chk_pdf2cbr.Enabled = true;
                }

                _fileSelected = true;

                if (this.chk_SourceFolder.Checked)
                {
                    _outputFolderSelected            = true;
                    DataAccess.Instance.g_Output_dir = Path.GetDirectoryName(SelectFolderDlg.SelectedPath);
                    this.tbox_OuputFolder.Text       = this.tbox_SourceFile.Text;
                }
            }
        }
Пример #4
0
        /// <summary>
        /// User clicked on textbox, opendialog to select file or folder
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tbox_SourceFile_Click(object sender, EventArgs e)
        {
            var SelectFolderDlg = new FolderBrowserDialogEx();

            SelectFolderDlg.Description             = "Select a file or folder:";     //message
            SelectFolderDlg.ShowNewFolderButton     = true;
            SelectFolderDlg.ShowEditBox             = false;                          //editbox
            SelectFolderDlg.ShowBothFilesAndFolders = true;                           //show files and folders
            SelectFolderDlg.RootFolder = System.Environment.SpecialFolder.MyComputer; //start from computer

            DialogResult result = SelectFolderDlg.ShowDialog();

            if (result == DialogResult.OK)
            {
                DataAccess.Instance.g_WorkingDir = SelectFolderDlg.SelectedPath;
                tbox_SourceFile.Text             = SelectFolderDlg.SelectedPath;

                //check if file or folder
                if (File.Exists(DataAccess.Instance.g_WorkingDir)) //is a file
                {
                    //check the extension
                    if ((Path.GetExtension(SelectFolderDlg.SelectedPath) == ".pdf") || (Path.GetExtension(SelectFolderDlg.SelectedPath) == ".PDF"))
                    {
                        chk_cbr2pdf.Checked = false;
                        chk_cbr2pdf.Enabled = false;
                        chk_pdf2cbr.Checked = true;
                        chk_pdf2cbr.Enabled = true;
                    }
                    else if ((Path.GetExtension(SelectFolderDlg.SelectedPath) == ".cbr") || (Path.GetExtension(SelectFolderDlg.SelectedPath) == ".CBR") ||
                             (Path.GetExtension(SelectFolderDlg.SelectedPath) == ".cbz") || (Path.GetExtension(SelectFolderDlg.SelectedPath) == ".CBZ"))
                    {
                        chk_cbr2pdf.Checked = true;
                        chk_cbr2pdf.Enabled = true;
                        chk_pdf2cbr.Checked = false;
                        chk_pdf2cbr.Enabled = false;
                    }
                }
                else //is a folder
                {
                    chk_cbr2pdf.Checked = true;
                    chk_cbr2pdf.Enabled = true;
                    chk_pdf2cbr.Checked = true;
                    chk_pdf2cbr.Enabled = true;
                }

                _fileSelected = true;
            }
        }
        public static FolderBrowserDialogEx ComputerBrowser()
        {
            FolderBrowserDialogEx x = new FolderBrowserDialogEx();
	    // avoid MBRO comppiler warning when passing _rootFolderLocation as a ref:
	    x.BecomeComputerBrowser();
            return x;
        }
Пример #6
0
        /// <summary>
        /// User clicked on textbox, opendialog to select file or folder
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tbox_SourceFile_Click(object sender, EventArgs e)
        {
            var SelectFolderDlg = new FolderBrowserDialogEx();
            SelectFolderDlg.Description = "Select a file or folder:"; //message
            SelectFolderDlg.ShowNewFolderButton = true;
            SelectFolderDlg.ShowEditBox = false;                     //editbox 
            SelectFolderDlg.ShowBothFilesAndFolders = true;          //show files and folders
            SelectFolderDlg.RootFolder = System.Environment.SpecialFolder.MyComputer; //start from computer

            DialogResult result = SelectFolderDlg.ShowDialog();
            if (result == DialogResult.OK)
            {
                DataAccess.Instance.g_WorkingDir = SelectFolderDlg.SelectedPath;
                tbox_SourceFile.Text = SelectFolderDlg.SelectedPath;

                //check if file or folder
                if (File.Exists(DataAccess.Instance.g_WorkingDir)) //is a file
                {
                    //check the extension
                    if ((Path.GetExtension(SelectFolderDlg.SelectedPath) == ".pdf") || (Path.GetExtension(SelectFolderDlg.SelectedPath) == ".PDF"))
                    {
                        chk_cbr2pdf.Checked = false;
                        chk_cbr2pdf.Enabled = false;
                        chk_pdf2cbr.Checked = true;
                        chk_pdf2cbr.Enabled = true;

                    }
                    else if ((Path.GetExtension(SelectFolderDlg.SelectedPath) == ".cbr") || (Path.GetExtension(SelectFolderDlg.SelectedPath) == ".CBR")
                        || (Path.GetExtension(SelectFolderDlg.SelectedPath) == ".cbz") || (Path.GetExtension(SelectFolderDlg.SelectedPath) == ".CBZ"))
                    {
                        chk_cbr2pdf.Checked = true;
                        chk_cbr2pdf.Enabled = true;
                        chk_pdf2cbr.Checked = false;
                        chk_pdf2cbr.Enabled = false;

                    }
                }
                else //is a folder
                {
                    chk_cbr2pdf.Checked = true;
                    chk_cbr2pdf.Enabled = true;
                    chk_pdf2cbr.Checked = true;
                    chk_pdf2cbr.Enabled = true;
                }

                _fileSelected = true;
               
            }

        }
Пример #7
0
        private void tbox_OuputFolder_Click(object sender, EventArgs e)
        {
            var SelectFolderDlg = new FolderBrowserDialogEx();
            SelectFolderDlg.Description = "Select a folder:"; //message
            SelectFolderDlg.ShowNewFolderButton = true;
            SelectFolderDlg.ShowEditBox = false;                     //editbox 
            SelectFolderDlg.ShowBothFilesAndFolders = false;          //show files and folders
            SelectFolderDlg.RootFolder = System.Environment.SpecialFolder.MyComputer; //start from computer

            DialogResult result = SelectFolderDlg.ShowDialog();
            if (result == DialogResult.OK)
            {
                DataAccess.Instance.g_Output_dir = SelectFolderDlg.SelectedPath;
                tbox_OuputFolder.Text = SelectFolderDlg.SelectedPath;

                _outputFolderSelected = true;

                if (this.chk_SourceFolder.Checked)
                {
                    this.tbox_OuputFolder.Text = this.tbox_SourceFile.Text;
                }
            }
        }
Пример #8
0
        /// <summary>
        /// User clicked on textbox, opendialog to select file or folder
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tbox_SourceFile_Click(object sender, EventArgs e)
        {
            var SelectFolderDlg = new FolderBrowserDialogEx();
            SelectFolderDlg.Description = "Select a file or folder:"; //message
            SelectFolderDlg.ShowNewFolderButton = true;
            SelectFolderDlg.ShowEditBox = false;                     //editbox 
            SelectFolderDlg.ShowBothFilesAndFolders = true;          //show files and folders
            SelectFolderDlg.RootFolder = System.Environment.SpecialFolder.MyComputer; //start from computer

            DialogResult result = SelectFolderDlg.ShowDialog();
            if (result == DialogResult.OK)
            {
                DataAccess.Instance.g_WorkingDir = SelectFolderDlg.SelectedPath;
                tbox_SourceFile.Text = SelectFolderDlg.SelectedPath;

                //check if file or folder
                if (File.Exists(DataAccess.Instance.g_WorkingDir)) //is a file
                {
                    //check the extension
                    var ext = Path.GetExtension(SelectFolderDlg.SelectedPath).ToLower();
                    if (ext == ".pdf")
                    {
                        chk_cbr2pdf.Checked = false;
                        chk_cbr2pdf.Enabled = false;
                        chk_pdf2cbr.Checked = true;
                        chk_pdf2cbr.Enabled = true;
                        chk_JoinImages.Enabled = true;

                    }
                    else if (ext == ".cbr" || ext == ".cbz")
                    {
                        chk_cbr2pdf.Checked = true;
                        chk_cbr2pdf.Enabled = true;
                        chk_pdf2cbr.Checked = false;
                        chk_pdf2cbr.Enabled = false;
                        chk_JoinImages.Enabled = false;
                    }
                }
                else //is a folder
                {
                    chk_cbr2pdf.Checked = true;
                    chk_cbr2pdf.Enabled = true;
                    chk_pdf2cbr.Checked = true;
                    chk_pdf2cbr.Enabled = true;
                }

                _fileSelected = true;

                if (this.chk_SourceFolder.Checked)
                {
                    _outputFolderSelected = true;
                    DataAccess.Instance.g_Output_dir = Path.GetDirectoryName(SelectFolderDlg.SelectedPath);
                    this.tbox_OuputFolder.Text = this.tbox_SourceFile.Text;
                }
            }

        }