public void SetConfiguration(ListServiceConfiguration listServiceConfiguration)
        {
            var config = new ListServiceConfiguration {
                ADCConnectionOptions = listServiceConfiguration.ADCConnectionOptions
            };
            var configString = SerializationHelper.Serialize(config);

            _mgsc.SetConfiguration(_serviceId, configString);
        }
Beispiel #2
0
        private void Save(object sender, RoutedEventArgs e)
        {
            var configuration = new ListServiceConfiguration
            {
                ADCConnectionOptions = new ADCConnectionParameters()
                {
                    ApplicationName           = _appName.Text,
                    DeviceServersToConnect    = new[] { _ds.Text },
                    DeviceServersToInitialize = _connect.IsChecked.GetValueOrDefault() ? new[] { _ds.Text } : new string[0]
                }
            };

            try
            {
                _configurationHelper.SetConfiguration(configuration);
                MessageBox.Show("Configuration saved", "Configuration", MessageBoxButton.OK,
                                MessageBoxImage.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error!", MessageBoxButton.OK,
                                MessageBoxImage.Error);
            }
        }