Exemplo n.º 1
0
        public static bool TrySet <T>(this IProcessorContext context, T value, string key)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (ReferenceEquals(value, null))
            {
                throw new ArgumentNullException("value");
            }
            var result = context.TrySet(typeof(T), value, key);

            return(result);
        }
Exemplo n.º 2
0
        public static bool TrySet(this IProcessorContext context, Type type, object value)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            var result = context.TrySet(type, value, ProcessorContextKeys.Default);

            return(result);
        }
Exemplo n.º 3
0
 public static void Set(this IProcessorContext context, Type type, object value, string key)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     if (value == null)
     {
         throw new ArgumentNullException("value");
     }
     if (!context.TrySet(type, value, key))
     {
         throw new ArgumentOutOfRangeException("key", key, string.Format(Resources.KeyAlreadySetForGivenType, key, type.FullName));
     }
 }
Exemplo n.º 4
0
 public static bool TrySet <T>(this IProcessorContext context, T value)
 {
     return(context.TrySet(value, ProcessorContextKeys.Default));
 }