예제 #1
0
        private void miExportMultipleConfigs_Click(object sender, RoutedEventArgs e)
        {
            //THis is not present in WPF
            System.Windows.Forms.FolderBrowserDialog fbdConfigFolder = new System.Windows.Forms.FolderBrowserDialog();

            SelectApp selectApp = new SelectApp();

            selectApp.SetListBoxSelectMode = System.Windows.Forms.SelectionMode.MultiSimple;
            string str  = "";
            string path = "";

            if (selectApp.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }
            if (fbdConfigFolder.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string guid = Guid.NewGuid().ToString();
                path = fbdConfigFolder.SelectedPath;
                foreach (object appNames in selectApp.AppNamesList)
                {
                    if (this.ExportXmlConfigurationByApplication(appNames.ToString(), path, guid))
                    {
                        str = str + appNames.ToString() + ", ";
                    }
                }
            }
            int num = (int)System.Windows.Forms.MessageBox.Show("Applications " + str.TrimEnd(',', ' ') + " are successfully exported to path: " + path, "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
        }
예제 #2
0
        private void btBrowseApps_Click(object sender, RoutedEventArgs e)
        {
            this.initializeFields();
            SelectApp selectApp = new SelectApp();

            selectApp.SetListBoxSelectMode = System.Windows.Forms.SelectionMode.One;
            if (selectApp.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.tbApplicationName.Text = selectApp.ApplicationName;
                string text = this.tbApplicationName.Text;
                if (text != string.Empty)
                {
                    try
                    {
                        string           description;
                        string           contactInfo;
                        string           appUserAcct;
                        string           appAdminAcct;
                        HybridDictionary configProperties = SSOConfigManager.GetConfigProperties(text, out description, out contactInfo, out appUserAcct, out appAdminAcct);
                        this.tbApplicationDescription.Text = description;
                        this.tbSSOAdminGrp.Text            = appAdminAcct;
                        this.tbSSOAffliateAdminGrp.Text    = appUserAcct;
                        foreach (DictionaryEntry dictionaryEntry in configProperties)
                        {
                            DataGridViewRow row = this.dgvKeyValue.Rows[this.dgvKeyValue.Rows.Add()];
                            row.Cells["clKeyName"].Value = (object)dictionaryEntry.Key.ToString();
                            row.Cells["clValue"].Value   = (object)dictionaryEntry.Value.ToString();
                            row.Cells["clIsMask"].Value  = (object)"Yes";
                        }
                    }
                    catch (Exception ex)
                    {
                        int num = (int)System.Windows.Forms.MessageBox.Show("Error Occured. Details: " + ex.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    }
                }
                else
                {
                    int num1 = (int)System.Windows.Forms.MessageBox.Show("Please enter application name.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            selectApp.Close();
        }