Example #1
0
        private void Finish()
        {
            // Check to see if our config data file exists
            string dataFilePath = WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.PrebuiltConfigDataPath) + prebuiltConfigControl.SelectedConfiguration.Filename;

            if (File.Exists(dataFilePath))
            {
                // Load our configuration data
                TextReader configReader = (TextReader) new StreamReader(dataFilePath);

                string configData = configReader.ReadToEnd();

                configReader.Close();

                // Fill in our input data
                Data.PrebuiltConfigData.InputRow[] inputRows = prebuiltConfigControl.SelectedConfiguration.GetInputRows();

                foreach (Data.PrebuiltConfigData.InputRow inputRow in inputRows)
                {
                    if (inputRow.Type == "Text")
                    {
                        configData = configData.Replace("#" + inputRow.Name + "#", inputRow.Value);
                    }
                }

                StringReader sr = new StringReader(configData);

                try
                {
                    cbDataset.EnforceConstraints = false;
                    cbDataset.ReadXml(sr);

                    System.Collections.IEnumerator dictEnum = greetingValues.GetEnumerator();

                    while (dictEnum.MoveNext())
                    {
                        cbDataset.LocalizedGreetings.AddLocalizedGreetingsRow(((KeyValuePair <string, WOSI.CallButler.Data.CallButlerDataset.LocalizedGreetingsRow>)dictEnum.Current).Value);
                    }
                }
                catch
                {
                }

                sr.Close();
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        private void LoadProviderConfiguration(string filename)
        {
            WOSI.CallButler.Data.CallButlerDataset cbds = new WOSI.CallButler.Data.CallButlerDataset();

            try
            {
                cbds.ReadXml(filename);
            }
            catch
            {
                MessageBox.Show(this, CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Configruation_UnableToLoad), "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            ManagementInterfaceClient.ManagementInterface.PersistProviders(ManagementInterfaceClient.AuthInfo, cbds.Providers);

            LoadViewControl(new ProvidersView());

            MessageBox.Show(this, CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Configruation_ProviderSettingsLoaded), "", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        private void LoadProviderConfiguration(string filename)
        {
            WOSI.CallButler.Data.CallButlerDataset cbds = new WOSI.CallButler.Data.CallButlerDataset();

            try
            {
                cbds.ReadXml(filename);
            }
            catch
            {
                MessageBox.Show(this, CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Configruation_UnableToLoad), "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            ManagementInterfaceClient.ManagementInterface.PersistProviders(ManagementInterfaceClient.AuthInfo, cbds.Providers);

            LoadViewControl(new ProvidersView());

            MessageBox.Show(this, CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.Configruation_ProviderSettingsLoaded), "", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }