예제 #1
0
        private bool ValidateStep3()
        {
            CreateRepository3 RealCurrentUserControl = (CreateRepository3)CurrentUserControl;

            if (String.IsNullOrEmpty(((CreateRepository3)CurrentUserControl).textBox1.Text))
            {
                MessageBox.Show(Program.RessourceManager.GetString("STEP3_ERROR1"));
                return(false);
            }

            ResultLocalPath = ((CreateRepository3)CurrentUserControl).textBox1.Text;

            //Check if the selected folder is not a subdirectory of an existing replication
            if (_ListOfRepositoryUI != null && (_ListOfRepositoryUI.Exists(x => ResultLocalPath.StartsWith(x.LocalPath + Path.DirectorySeparatorChar))) || _ListOfRepositoryUI.Exists(x => ResultLocalPath.Equals(x.LocalPath, StringComparison.OrdinalIgnoreCase)))
            {
                MessageBox.Show(Program.RessourceManager.GetString("STEP3_ERROR2"));
                return(false);
            }

            DirectoryInfo DI = new DirectoryInfo(ResultLocalPath);

            if (DI.GetDirectories().Count() > 0 || DI.GetFiles().Count() > 0)
            {
                if (MessageBox.Show(Program.RessourceManager.GetString("STEP3_ERROR3"), "", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No)
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #2
0
        private void LoadStep3()
        {
            CurrentStep = 3;

            panelMain.Controls.Clear();
            CurrentUserControl = new CreateRepository3();
            CreateRepository3 RealCurrentUserControl = (CreateRepository3)CurrentUserControl;

            panelMain.Controls.Add(CurrentUserControl);

            if (ResultLocalPath != null)
            {
                RealCurrentUserControl.textBox1.Text = ResultLocalPath;
            }

            bt_Next.Text = Program.RessourceManager.GetString("STEP0_FINISH");
            bt_Next.Focus();
        }