Esempio n. 1
0
        /// <summary>
        /// Extension method for adding the Disk watcher to the the WardenConfiguration with the default name of Disk Watcher.
        /// </summary>
        /// <param name="builder">Instance of the Warden configuration builder.</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 AddDiskWatcher(
            this WardenConfiguration.Builder builder,
            Action <WatcherHooksConfiguration.Builder> hooks = null)
        {
            builder.AddWatcher(DiskWatcher.Create(), hooks);

            return(builder);
        }
        /// <summary>
        /// Extension method for adding the Disk watcher to the the WardenConfiguration with the default name of Disk Watcher.
        /// </summary>
        /// <param name="builder">Instance of the Warden configuration builder.</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 DiskWatcher belongs to.</param>
        /// <returns>Instance of fluent builder for the WardenConfiguration.</returns>
        public static WardenConfiguration.Builder AddDiskWatcher(
            this WardenConfiguration.Builder builder,
            Action <WatcherHooksConfiguration.Builder> hooks = null,
            TimeSpan?interval = null,
            string group      = null)
        {
            builder.AddWatcher(DiskWatcher.Create(group: group), hooks, interval);

            return(builder);
        }
Esempio n. 3
0
        /// <summary>
        /// Extension method for adding the Disk watcher to the the WardenConfiguration.
        /// </summary>
        /// <param name="builder">Instance of the Warden configuration builder.</param>
        /// <param name="configurator">Lambda expression for configuring the DiskWatcher.</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>
        /// <returns>Instance of fluent builder for the WardenConfiguration.</returns>
        public static WardenConfiguration.Builder AddDiskWatcher(
            this WardenConfiguration.Builder builder,
            Action <DiskWatcherConfiguration.Default> configurator,
            Action <WatcherHooksConfiguration.Builder> hooks = null,
            TimeSpan?interval = null)
        {
            builder.AddWatcher(DiskWatcher.Create(configurator), hooks, interval);

            return(builder);
        }
Esempio n. 4
0
        /// <summary>
        /// Extension method for adding the Disk watcher to the the WardenConfiguration.
        /// </summary>
        /// <param name="builder">Instance of the Warden configuration builder.</param>
        /// <param name="name">Name of the DiskWatcher.</param>
        /// <param name="configuration">Configuration of DiskWatcher.</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>
        /// <returns>Instance of fluent builder for the WardenConfiguration.</returns>
        public static WardenConfiguration.Builder AddDiskWatcher(
            this WardenConfiguration.Builder builder, string name,
            DiskWatcherConfiguration configuration,
            Action <WatcherHooksConfiguration.Builder> hooks = null,
            TimeSpan?interval = null)
        {
            builder.AddWatcher(DiskWatcher.Create(name, configuration), hooks, interval);

            return(builder);
        }
Esempio n. 5
0
        /// <summary>
        /// Extension method for adding the Disk watcher to the the WardenConfiguration.
        /// </summary>
        /// <param name="builder">Instance of the Warden configuration builder.</param>
        /// <param name="name">Name of the DiskWatcher.</param>
        /// <param name="configurator">Lambda expression for configuring the DiskWatcher.</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 AddDiskWatcher(
            this WardenConfiguration.Builder builder,
            string name,
            Action <DiskWatcherConfiguration.Default> configurator,
            Action <WatcherHooksConfiguration.Builder> hooks = null)
        {
            builder.AddWatcher(DiskWatcher.Create(name, configurator), hooks);

            return(builder);
        }