/// <summary>
 /// Invokes the <see cref="OnConfigurationFailed"/> event.
 /// </summary>
 /// <param name="sensor"></param>
 /// <param name="gesture"></param>
 internal void OnConfigurationFailed(ConfigStatus sensor, ConfigStatus gesture)
 {
     if (ConfigurationFailed != null)
     {
         ConfigurationFailed.Invoke(sensor, gesture);
     }
 }
Esempio n. 2
0
        internal void RaiseConfigurationFailed(string property, PcapError error, string message)
        {
            message = message ?? $"Failed to set {property}.";

            if (ConfigurationFailed is null)
            {
                var exception = error == PcapError.PlatformNotSupported ?
                                (Exception) new PlatformNotSupportedException() :
                                new PcapException(message, error);
                throw exception;
            }
            else
            {
                var args = new ConfigurationFailedEventArgs
                {
                    Property = property,
                    Error    = error,
                    Message  = message,
                };
                ConfigurationFailed.Invoke(this, args);
            }
        }