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); }
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); }
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)); } }
public static bool TrySet <T>(this IProcessorContext context, T value) { return(context.TrySet(value, ProcessorContextKeys.Default)); }