public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary,
     WizardRunKind runKind, object[] customParams)
 {
     var window = new TemplateForm();
     window.ShowDialog();
     if (window.DialogResult.Value)
     {
         PopulateReplacementDictionary(window);
     }
     else
     {
         throw new WizardCancelledException();
     }
 }
Exemple #2
0
        public void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary,
                               WizardRunKind runKind, object[] customParams)
        {
            var window = new TemplateForm();

            window.ShowDialog();
            if (window.DialogResult.Value)
            {
                PopulateReplacementDictionary(window);
            }
            else
            {
                throw new WizardCancelledException();
            }
        }
Exemple #3
0
        private void PopulateReplacementDictionary(TemplateForm window)
        {
            var replacementsDictionary = new Dictionary <string, string>();

            if (!String.IsNullOrEmpty(window.ClientID.Text))
            {
                replacementsDictionary.Add("$ClientID$", window.ClientID.Text);
            }

            if (!String.IsNullOrEmpty(window.CallbackURL.Text))
            {
                replacementsDictionary.Add("$CallbackURL$", window.CallbackURL.Text);
            }

            replacementsDictionary.Add("$EncryptionPassword$", Guid.NewGuid().ToString());
            replacementsDictionary.Add("$EncryptionSalt$", Guid.NewGuid().ToString());

            var  sb    = new StringBuilder();
            bool first = true;

            foreach (var next in window.Scopes)
            {
                if (next.IsChecked)
                {
                    if (!first)
                    {
                        sb.Append(", ");
                    }
                    else
                    {
                        first = false;
                    }
                    sb.Append("\"").Append(next.Item).Append("\"");
                }
            }
            replacementsDictionary.Add("$scopes$", sb.ToString());
            ChildWizard.InheritedParams = replacementsDictionary;
        }
        private void PopulateReplacementDictionary(TemplateForm window)
        {
            var replacementsDictionary = new Dictionary<string, string>();

            if (!String.IsNullOrEmpty(window.ClientID.Text))
            {
                replacementsDictionary.Add("$ClientID$", window.ClientID.Text);
            }

            if (!String.IsNullOrEmpty(window.CallbackURL.Text))
            {
                replacementsDictionary.Add("$CallbackURL$", window.CallbackURL.Text);
            }

            replacementsDictionary.Add("$EncryptionPassword$", Guid.NewGuid().ToString());
            replacementsDictionary.Add("$EncryptionSalt$", Guid.NewGuid().ToString());

            var sb = new StringBuilder();
            bool first = true;
            foreach (var next in window.Scopes)
            {
                if (next.IsChecked)
                {
                    if (!first)
                    {
                        sb.Append(", ");
                    }
                    else
                    {
                        first = false;
                    }
                    sb.Append("\"").Append(next.Item).Append("\"");
                }
            }
            replacementsDictionary.Add("$scopes$", sb.ToString());
            ChildWizard.InheritedParams = replacementsDictionary;
        }