예제 #1
0
 private void ThrowInitializationExceptionWhenMinAndMaxIsNull()
 {
     if (_minimum == null && _maximum == null)
     {
         throw XInitializeException.Create($"Não é possível definir um {nameof(XRangeAttribute)} sem informar ao menos um limite.");
     }
 }
예제 #2
0
 public static void Initialization(object context, object referenceObj)
 {
     if (referenceObj != null)
     {
         throw XInitializeException.Reinitialize(context);
     }
 }
예제 #3
0
        public static void Reinitialize([Localizable(false)] string message)
        {
            var exception = XInitializeException.Reinitialize(message);

            Debug.Assert(true, exception.Message);

            throw exception;
        }
예제 #4
0
        public static void Reinitialize(object obj)
        {
            if (obj == null)
            {
                return;
            }

            var exception = XInitializeException.Reinitialize(obj);

            Debug.Assert(true, exception.Message);

            throw exception;
        }
예제 #5
0
        internal void Initialize(string name, ILoggerFactory loggerFactory, IConfigurationSection settingSection)
        {
            if (IsInitialized)
            {
                XInitializeException.Reinitialize(this);
            }

            IsInitialized = true;

            Name   = name;
            Logger = loggerFactory.CreateLogger($"#{Name}");

            if (settingSection != null)
            {
                InternalInitializeFromSettingsSection(settingSection);
            }
        }