/// <summary>
        /// Initializes a new instance of the <see cref="MonitorConfigControl"/>.
        /// </summary>
        public MonitorConfigControl(MonitorConfig monitorConfig)
        {
            InitializeComponent();
            _monitorConfig = StfMonitorConfigFactory.Create(monitorConfig.MonitorType, monitorConfig.Configuration);

            // Populate the controls
            textBox_MonitorLocation.Text = _monitorConfig.MonitorLocation;

            _errorProvider.BlinkStyle = ErrorBlinkStyle.NeverBlink;
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DirectoryMonitorConfigControl"/>.
        /// </summary>
        public DirectoryMonitorConfigControl(MonitorConfig monitorConfig)
        {
            InitializeComponent();
            _monitorConfig = (DirectoryMonitorConfig)StfMonitorConfigFactory.Create(monitorConfig.MonitorType, monitorConfig.Configuration);

            // Populate the controls
            textBox_Destination.Text = _monitorConfig.MonitorLocation;
            textBox_DataLogHost.Text = _monitorConfig.LogServiceHostName;

            _errorProvider.BlinkStyle = ErrorBlinkStyle.NeverBlink;
        }
        /// <summary>
        /// Provides editing of serialized configuration data for <see cref="DatabaseMonitorConfig"/> type.
        /// </summary>
        /// <param name="monitorConfig"></param>
        public DatabaseMonitorConfigControl(MonitorConfig monitorConfig)
        {
            InitializeComponent();
            _monitorConfig = (DatabaseMonitorConfig)StfMonitorConfigFactory.Create(monitorConfig.MonitorType, monitorConfig.Configuration);

            // Populate the controls
            textBox_DbHostName.Text     = _monitorConfig.MonitorLocation;
            textBox_DbInstanceName.Text = _monitorConfig.DatabaseInstanceName;
            textBox_Port.Text           = _monitorConfig.ConnectionPort > 0 ? _monitorConfig.ConnectionPort.ToString() : string.Empty;

            _errorProvider.BlinkStyle = ErrorBlinkStyle.NeverBlink;
        }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OutputMonitorConfigControl"/> form.
        /// </summary>
        /// <param name="monitorConfig">The configuration data for an output monitor.</param>
        public OutputMonitorConfigControl(MonitorConfig monitorConfig)
        {
            InitializeComponent();

            // Populate combo boxes
            retention_ComboBox.DataSource    = EnumUtil.GetDescriptions <RetentionOption>().ToArray();
            retention_ComboBox.SelectedIndex = -1;

            //groupBox_Validation.Enabled = IsEnterpriseEnabled();
            _errorProvider.BlinkStyle = ErrorBlinkStyle.NeverBlink;

            _outputMonitorConfig = (OutputMonitorConfig)StfMonitorConfigFactory.Create(monitorConfig.MonitorType, monitorConfig.Configuration);

            // Populate the controls
            _serverHostName = monitorConfig.ServerHostName;
            _monitorType    = EnumUtil.Parse <STFMonitorType>(monitorConfig.MonitorType);
            InitializeMonitorType();
            destination_TextBox.Text         = _outputMonitorConfig.MonitorLocation;
            retention_ComboBox.SelectedItem  = EnumUtil.GetDescription(_outputMonitorConfig.Retention);
            retentionLocation_TextBox.Text   = _outputMonitorConfig.RetentionLocation;
            lookForMetadata_CheckBox.Checked = _outputMonitorConfig.LookForMetadataFile;
            metadataExtension_TextBox.Text   = _outputMonitorConfig.MetadataFileExtension;
        }
            public void AddRow(MonitorConfig monitorConfig)
            {
                STFMonitorType monitorType;

                try
                {
                    monitorType = EnumUtil.Parse <STFMonitorType>(monitorConfig.MonitorType);
                }
                catch (ArgumentException)
                {
                    // If we can't parse the STFMonitorType, don't add it to the collection.
                    // For development, this will resolve itself by adding the new value to STFMonitorType enum.
                    return;
                }

                DataRow row = Tables[0].NewRow();

                row[MonitorConfigColumn.MonitorConfigId] = monitorConfig.MonitorConfigId;
                row[MonitorConfigColumn.ServerHostName]  = monitorConfig.ServerHostName;
                row[MonitorConfigColumn.MonitorType]     = monitorConfig.MonitorType;
                row[MonitorConfigColumn.Configuration]   = StfMonitorConfigFactory.Create(monitorType, monitorConfig.Configuration);

                Tables[0].Rows.Add(row);
            }