예제 #1
0
        private static IConfBlock ValidateBlock(IConfContainer confContainer)
        {
            if (null == confContainer)
            {
                throw new ArgumentNullException(nameof(confContainer));
            }

            var block = confContainer.Block;

            if (block == null)
            {
                throw new ArgumentException(paramName: nameof(confContainer), message: $"{nameof(confContainer.Block)} is null.");
            }

            return(block);
        }
예제 #2
0
 public static void ConfigureLogging(this IConfContainer confContainer)
 {
     Logging.Configuration = new LogConf {
         Container = confContainer
     };
 }
예제 #3
0
 public void SetUp()
 {
     Subject = new ConfContainer();
 }
예제 #4
0
 public static IEnumerable <KeyValuePair <string, T> > Configure <T>(this IConfContainer confContainer, Func <string, T> factory, string collection = null, IEqualityComparer <string> comparer = null)
 {
     return(ValidateBlock(confContainer).Configure(factory, collection, comparer));
 }
예제 #5
0
 public static T Configure <T>(this IConfContainer confContainer, T obj, string key = null)
 {
     return(ValidateBlock(confContainer).Configure(obj, key));
 }