Example #1
0
        private void LoadStep1()
        {
            CurrentStep = 1;

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

            panelMain.Controls.Add(CurrentUserControl);

            bt_Back.Visible = true;
            bt_Next.Enabled = true;
            bt_Back.Enabled = true;

            if (ResultSiteURL != null)
            {
                RealCurrentUserControl.txt_AlfrescoURL.Text  = ResultSiteURL;
                RealCurrentUserControl.pnl_ServerURL.Visible = true;
            }
            if (ResultLogin != null)
            {
                RealCurrentUserControl.txt_Login.Text = ResultLogin;
            }
            if (ResultPassword != null)
            {
                RealCurrentUserControl.txt_Password.Text = ResultPassword;
            }

            bt_Next.Focus();
        }
Example #2
0
        private bool ValidateStep1()
        {
            CreateRepository1 RealCurrentUserControl = (CreateRepository1)CurrentUserControl;

            if (String.IsNullOrEmpty(RealCurrentUserControl.txt_Login.Text))
            {
                MessageBox.Show(Program.RessourceManager.GetString("STEP1_ERROR2"));
                return(false);
            }

            if (String.IsNullOrEmpty(RealCurrentUserControl.txt_Password.Text))
            {
                MessageBox.Show(Program.RessourceManager.GetString("STEP1_ERROR3"));
                return(false);
            }

            ResultLogin    = RealCurrentUserControl.txt_Login.Text;
            ResultPassword = RealCurrentUserControl.txt_Password.Text;

            if (String.IsNullOrEmpty(RealCurrentUserControl.txt_AlfrescoURL.Text))
            {
                lbl_Connecting.Visible = false;
                RealCurrentUserControl.pnl_ServerURL.Visible = true;
                return(false);
            }

            ResultSiteURL = RealCurrentUserControl.txt_AlfrescoURL.Text;

            //Init connector
            Type t = _Connectors.FirstOrDefault(x => x.FullName.Equals(ResultSelectedType));

            if (t == null)
            {
                MessageBox.Show(Program.RessourceManager.GetString("STEP1_ERROR4"));
                return(false);
            }

            TargetRepositories = new List <string>();

            lbl_Connecting.Visible = true;
            bt_Next.Enabled        = false;
            bt_Back.Enabled        = false;
            this.Refresh();

            bool Result = GetRepositorySites(TargetRepositories, t, RealCurrentUserControl.txt_AlfrescoURL.Text, RealCurrentUserControl.txt_Login.Text, RealCurrentUserControl.txt_Password.Text);

            /*
             * // Create function delegate (it can be any delegate)
             * var FunFunc = new Func<List<string>, Type, String, String, String, bool>(GetRepositorySites);
             * // Start executing function on thread pool with parameters
             * IAsyncResult FunFuncResult = FunFunc.BeginInvoke(TargetRepositories, t, ((CreateRepository1)CurrentUserControl).txt_AlfrescoURL.Text, ((CreateRepository1)CurrentUserControl).txt_Login.Text, ((CreateRepository1)CurrentUserControl).txt_Password.Text, null, null);
             *
             * // Wait for asynchronous call completion and get result
             * bool Result = FunFunc.EndInvoke(FunFuncResult);
             */
            lbl_Connecting.Visible = false;
            RealCurrentUserControl.pnl_ServerURL.Visible = true;

            if (!Result)
            {
                MessageBox.Show(Program.RessourceManager.GetString("STEP1_ERROR5"));
                bt_Next.Enabled = true;
                bt_Back.Enabled = true;
                return(false);
            }


            return(true);
        }