/// <summary> /// Factory method for creating a new instance of DiskWatcher with default name of Disk Watcher. /// </summary> /// <param name="configurator">Optional lambda expression for configuring the DiskWatcher.</param> /// <returns>Instance of DiskWatcher.</returns> public static DiskWatcher Create(Action <DiskWatcherConfiguration.Default> configurator = null) { var config = new DiskWatcherConfiguration.Builder(); configurator?.Invoke((DiskWatcherConfiguration.Default)config); return(Create(DefaultName, config.Build())); }
/// <summary> /// Factory method for creating a new instance of DiskWatcher. /// </summary> /// <param name="name">Name of the DiskWatcher.</param> /// <param name="configurator">Optional lambda expression for configuring the DiskWatcher.</param> /// <param name="group">Optional name of the group that DiskWatcher belongs to.</param> /// <returns>Instance of DiskWatcher.</returns> public static DiskWatcher Create(string name, Action <DiskWatcherConfiguration.Default> configurator = null, string group = null) { var config = new DiskWatcherConfiguration.Builder(); configurator?.Invoke((DiskWatcherConfiguration.Default)config); return(Create(name, config.Build(), group)); }