/// <summary> /// Registers the configuration option value handler, it is used for reading configuration value and reload it after the configuration is changed; /// </summary> /// <typeparam name="TConfigOption">The type of the configuration option.</typeparam> /// <param name="config">The server configuration.</param> /// <param name="name">The changed config option's name.</param> /// <param name="handler">The handler.</param> #if !NETSTANDARD2_0 protected bool RegisterConfigHandler <TConfigOption>(IServerConfig config, string name, Func <TConfigOption, bool> handler) where TConfigOption : ConfigurationElement, new() { var notifier = new ConfigValueChangeNotifier <TConfigOption>(handler); m_ConfigUpdatedNotifiers.Add(name, notifier); return(notifier.Notify(config.Options.GetValue(name))); }
protected bool RegisterConfigHandler <TConfigOption>(IServerConfig config, string name, Func <TConfigOption, bool> handler) where TConfigOption : class, new() { var notifier = new ConfigValueChangeNotifier <TConfigOption>(handler); m_ConfigUpdatedNotifiers.Add(name, notifier); return(notifier.Notify(name)); //TODO }
/// <summary> /// Registers the configuration option value handler, it is used for reading configuration value and reload it after the configuration is changed; /// </summary> /// <param name="config">The server configuration.</param> /// <param name="name">The changed config option name.</param> /// <param name="handler">The handler.</param> protected bool RegisterConfigHandler(IServerConfig config, string name, Func <string, bool> handler) { var notifier = new ConfigValueChangeNotifier(handler); m_ConfigUpdatedNotifiers.Add(name, notifier); #if !NETSTANDARD2_0 return(notifier.Notify(config.OptionElements.GetValue(name))); #else return(notifier.Notify(name)); #endif }