Example #1
0
        private void tabCtrlFunction_SelectedIndexChanged(object sender, EventArgs e)
        {
            FormControlProperties formCtrlProps = new FormControlProperties();

            if (tabCtrlFunction.SelectedTab.Name == tabPageCopyByGroup.Name) {
                formCtrlProps.SourceFolderEnabled = true;
                formCtrlProps.TargetFolderEnabled = true;
                formCtrlProps.FileTypeEnabled = true;
                formCtrlProps.SortModeEnabled = true;
                formCtrlProps.ViewFileNameListEnabled = true;
                formCtrlProps.SpecFileListEnabled = true;

                formCtrlProps.FileTypeDefaultString = txtFileType.Text == "" ? "*" : txtFileType.Text;
            }
            else if (tabCtrlFunction.SelectedTab.Name == tabPageFileBatchChangeName.Name) {
                formCtrlProps.SourceFolderEnabled = true;
                formCtrlProps.TargetFolderEnabled = false;
                formCtrlProps.FileTypeEnabled = true;
                formCtrlProps.SortModeEnabled = true;
                formCtrlProps.ViewFileNameListEnabled = true;
                formCtrlProps.SpecFileListEnabled = true;

                formCtrlProps.FileTypeDefaultString = txtFileType.Text == "" ? "*" : txtFileType.Text;
            }
            else if (tabCtrlFunction.SelectedTab.Name == tabPageSporadicFunction.Name) {
                formCtrlProps.SourceFolderEnabled = true;
                formCtrlProps.TargetFolderEnabled = false;
                formCtrlProps.FileTypeEnabled = true;
                formCtrlProps.SortModeEnabled = false;
                formCtrlProps.ViewFileNameListEnabled = false;
                formCtrlProps.SpecFileListEnabled = false;

                formCtrlProps.FileTypeDefaultString = txtFileType.Text;
            }

            this.SetFormControlProperties(formCtrlProps);
        }
Example #2
0
        private void SetFormControlProperties(FormControlProperties formCtrlProps)
        {
            txtSourceFolder.Enabled =
                btnSourceFolderBrowser.Enabled = formCtrlProps.SourceFolderEnabled;

            txtTargetFolder.Enabled =
                btnTargetFolderBrowser.Enabled = formCtrlProps.TargetFolderEnabled;

            grpFileType.Enabled = formCtrlProps.FileTypeEnabled;
            txtFileType.Text = formCtrlProps.FileTypeDefaultString;

            grpSortMode.Enabled = formCtrlProps.SortModeEnabled;

            btnViewFileNameList.Enabled = formCtrlProps.ViewFileNameListEnabled;
            chkSpecFileList.Enabled =
                btnEditChangeFileList.Enabled = formCtrlProps.SpecFileListEnabled;

            if (formCtrlProps.SpecFileListEnabled)
                this.chkSpecFileList_CheckedChanged(chkSpecFileList, new EventArgs());
        }