示例#1
0
        private InjectionError CreateError(InjectionErrorType errorType, Type bindingType = null, Type providerType = null, int callerLevel = 0)
        {
            string callerInfo           = GetCallerInfo(1 + callerLevel);
            string bindingTypeAsString  = (bindingType != null)?(bindingType.ToString()):("");
            string providerTypeAsString = (providerType != null)?(providerType.ToString()):("");

            object[] args         = new object[] { callerInfo, bindingTypeAsString, providerTypeAsString };
            string   errorMessage = String.Format(_ErrorMessages[(int)errorType], args);

            InjectionError error = new InjectionError(errorType, errorMessage);

            _Errors.Add(error);

            return(error);
        }
 //  CONSTRUCTOR
 public InjectionException(InjectionErrorType error, string message) : base(message)
 {
     Error = error;
 }
示例#3
0
 //  CONSTRUCTOR
 public InjectionError(InjectionErrorType error,
                       string message)
 {
     this.error   = error;
     this.message = message;
 }
示例#4
0
 //  CONSTRUCTOR
 public InjectionError(InjectionErrorType error, string message)
 {
     Error   = error;
     Message = message;
 }