コード例 #1
0
        private void TsbtnLoadTemplates_Click(object sender, EventArgs e)
        {
            if (TxtDirectoryPath.TextLength == 0)
            {
                FbdDirectory.RootFolder   = Environment.SpecialFolder.MyComputer;
                FbdDirectory.SelectedPath = TxtDirectoryPath.Text;
                DialogResult result = FbdDirectory.ShowDialog();
                if (result == DialogResult.OK)
                {
                    TxtDirectoryPath.Text = FbdDirectory.SelectedPath + "\\";
                }
            }

            if (TxtDirectoryPath.TextLength > 0)
            {
                TsprgbLoadUpdate.Value = TsprgbLoadUpdate.Maximum;
                TsprgbLoadUpdate.Value = 25;
                TsprgbLoadUpdate.Value = TsprgbLoadUpdate.Maximum / 2;

                if (!string.IsNullOrEmpty(TxtDirectoryPath.Text) && Directory.Exists(TxtDirectoryPath.Text))
                {
                    BsCrmTemplates         = _bindingSourceService.LoadCrmTemplatesToBindingSource(BsCrmTemplates);
                    TsprgbLoadUpdate.Value = TsprgbLoadUpdate.Maximum;
                    ResetProgressBar(3500);
                    ShowInfoNote("Loading completed!");
                }
                else
                {
                    ShowErrorNote(MySettings.DirectoryErrorText);
                    TxtDirectoryPath.Focus();
                    TsprgbLoadUpdate.Value = 0;
                    //ResetProgressBar(3500);
                }
            }
        }
コード例 #2
0
        private void BtnDirectoryFolderDialog_Click(object sender, EventArgs e)
        {
            FbdDirectory.RootFolder   = Environment.SpecialFolder.MyComputer;
            FbdDirectory.SelectedPath = TxtDirectoryPath.Text;
            DialogResult result = FbdDirectory.ShowDialog();

            if (result == DialogResult.OK)
            {
                TxtDirectoryPath.Text = FbdDirectory.SelectedPath + "\\";
            }
        }