コード例 #1
0
ファイル: Extensions.cs プロジェクト: asiqq23/Warden
        /// <summary>
        /// Extension method for adding the MSSQL watcher to the the WardenConfiguration with the default name of MSSQL Watcher.
        /// </summary>
        /// <param name="builder">Instance of the Warden configuration builder.</param>
        /// <param name="configuration">Configuration of MsSqlWatcher.</param>
        /// <param name="hooks">Optional lambda expression for configuring the watcher hooks.</param>
        /// <returns>Instance of fluent builder for the WardenConfiguration.</returns>
        public static WardenConfiguration.Builder AddMsSqlWatcher(
            this WardenConfiguration.Builder builder,
            MsSqlWatcherConfiguration configuration,
            Action <WatcherHooksConfiguration.Builder> hooks = null)
        {
            builder.AddWatcher(MsSqlWatcher.Create(configuration), hooks);

            return(builder);
        }
コード例 #2
0
        /// <summary>
        /// Extension method for adding the MSSQL watcher to the the WardenConfiguration with the default name of MSSQL Watcher.
        /// </summary>
        /// <param name="builder">Instance of the Warden configuration builder.</param>
        /// <param name="configuration">Configuration of MsSqlWatcher.</param>
        /// <param name="hooks">Optional lambda expression for configuring the watcher hooks.</param>
        /// <param name="interval">Optional interval (5 seconds by default) after which the next check will be invoked.</param>
        /// <param name="group">Optional name of the group that MsSqlWatcher belongs to.</param>
        /// <returns>Instance of fluent builder for the WardenConfiguration.</returns>
        public static WardenConfiguration.Builder AddMsSqlWatcher(
            this WardenConfiguration.Builder builder,
            MsSqlWatcherConfiguration configuration,
            Action <WatcherHooksConfiguration.Builder> hooks = null,
            TimeSpan?interval = null,
            string group      = null)
        {
            builder.AddWatcher(MsSqlWatcher.Create(configuration, group), hooks, interval);

            return(builder);
        }
コード例 #3
0
ファイル: MsSqlWatcher.cs プロジェクト: asiqq23/Warden
        protected MsSqlWatcher(string name, MsSqlWatcherConfiguration configuration)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentException("Watcher name can not be empty.");
            }

            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration),
                                                "MSSQL Watcher configuration has not been provided.");
            }

            Name           = name;
            _configuration = configuration;
            _msSql         = _configuration.MsSqlProvider();
        }
コード例 #4
0
ファイル: MsSqlWatcher.cs プロジェクト: asiqq23/Warden
 /// <summary>
 /// Factory method for creating a new instance of MsSqlWatcher.
 /// </summary>
 /// <param name="name">Name of the MsSqlWatcher.</param>
 /// <param name="configuration">Configuration of MsSqlWatcher.</param>
 /// <returns>Instance of MsSqlWatcher.</returns>
 public static MsSqlWatcher Create(string name, MsSqlWatcherConfiguration configuration)
 => new MsSqlWatcher(name, configuration);
コード例 #5
0
ファイル: MsSqlWatcher.cs プロジェクト: asiqq23/Warden
 /// <summary>
 /// Factory method for creating a new instance of MsSqlWatcher with default name of MSSQL Watcher.
 /// </summary>
 /// <param name="configuration">Configuration of MsSqlWatcher.</param>
 /// <returns>Instance of MsSqlWatcher.</returns>
 public static MsSqlWatcher Create(MsSqlWatcherConfiguration configuration)
 => Create(DefaultName, configuration);
コード例 #6
0
 public Default(MsSqlWatcherConfiguration configuration) : base(configuration)
 {
     SetInstance(this);
 }
コード例 #7
0
 protected Configurator(MsSqlWatcherConfiguration configuration) : base(configuration)
 {
 }
コード例 #8
0
 protected Configurator(string connectionString)
 {
     Configuration = new MsSqlWatcherConfiguration(connectionString);
 }
コード例 #9
0
 /// <summary>
 /// Factory method for creating a new instance of MsSqlWatcher.
 /// </summary>
 /// <param name="name">Name of the MsSqlWatcher.</param>
 /// <param name="configuration">Configuration of MsSqlWatcher.</param>
 /// <param name="group">Optional name of the group that MsSqlWatcher belongs to.</param>
 /// <returns>Instance of MsSqlWatcher.</returns>
 public static MsSqlWatcher Create(string name, MsSqlWatcherConfiguration configuration,
                                   string group = null)
 => new MsSqlWatcher(name, configuration, group);
コード例 #10
0
 /// <summary>
 /// Factory method for creating a new instance of MsSqlWatcher with default name of MSSQL Watcher.
 /// </summary>
 /// <param name="configuration">Configuration of MsSqlWatcher.</param>
 /// <param name="group">Optional name of the group that MsSqlWatcher belongs to.</param>
 /// <returns>Instance of MsSqlWatcher.</returns>
 public static MsSqlWatcher Create(MsSqlWatcherConfiguration configuration, string group = null)
 => Create(DefaultName, configuration, group);