Example #1
0
        private void loadSiteCollections()
        {
            var helper = SPDGDataHelper.Create(WorkingDefinition);

            ServerGeneratorDefinition serverDefinition = WorkingDefinition as ServerGeneratorDefinition;
            IEnumerable <string>      siteCollections;

            if (serverDefinition == null)
            {
                siteCollections = helper.GetAllSiteCollections(Guid.Empty);
            }
            else if (serverDefinition.UseExistingWebApplication != string.Empty)
            {
                siteCollections = helper.GetAllSiteCollections(new Guid(serverDefinition.UseExistingWebApplication));
            }
            else
            {
                return;
            }
            foreach (var siteColl in siteCollections)
            {
                ComboboxItem item = new ComboboxItem();
                item.Text  = siteColl;
                item.Value = siteColl;
                cboSiteCollection.Items.Add(item);
            }
        }
Example #2
0
        public override bool saveData()
        {
            try
            {
                WorkingDefinition.Username = txtUserName.Text.Trim();
                WorkingDefinition.Password = txtPassword.Text.Trim();
                WorkingDefinition.CredentialsOfCurrentUser = radioCurrentCredentials.Checked;
                if (WorkingDefinition.IsClientObjectModel)
                {
                    ((ClientGeneratorDefinition)WorkingDefinition).TenantName = txtTenantName.Text.Trim();
                }
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    var helper = SPDGDataHelper.Create(WorkingDefinition);
                    helper.ValidateCredentials();
                }
                catch (CredentialValidationException ex)
                {
                    MessageBox.Show(ex.Message);
                    return(false);
                }
                finally
                {
                    this.Cursor = Cursors.Default;
                }
                return(true);
            }
            catch (Exception ex)
            {
                if (ex.Message.IndexOf("Could not load file or assembly 'Microsoft.SharePoint") > -1)
                {
                    MessageBox.Show("Missing 'Microsoft.SharePoint.dll'. Check if SharePoint is installed on current machine!");
                    Errors.Log(ex);
                }
                else
                {
                    MessageBox.Show(ex.Message);
                    Errors.Log(ex);
                }

                return(false);
            }
        }
Example #3
0
        private void loadWebApplications()
        {
            try
            {
                var helper = SPDGDataHelper.Create(WorkingDefinition);

                foreach (var webApplication in helper.GetWebApplications())
                {
                    ComboboxItem item = new ComboboxItem();
                    item.Text  = webApplication.Name;
                    item.Value = webApplication.Id;
                    cboUseExistingWebApp.Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                Errors.Log(ex);
            }
        }