コード例 #1
0
        private Options GetExactConfiguration <T>(ETLOptions options)
        {
            if (typeof(T) == typeof(ETLOptions))
            {
                return(options);
            }
            string name = typeof(T).Name;

            try
            {
                return(options.GetType().GetProperty(name).GetValue(options, null) as Options);
            }
            catch
            {
                throw new NotImplementedException();
            }
        }
コード例 #2
0
        Options.Options FindOption <T>(ETLOptions options, Logger logger)
        {
            if (typeof(T) == typeof(ETLOptions))
            {
                return(options);
            }

            try
            {
                return(options.GetType().GetProperty(typeof(T).Name).GetValue(options, null) as Options.Options);
            }
            catch
            {
                logger.Log("FindOption didn't find the needed option and throw a NotImplementedException.", true);
                throw new NotImplementedException();
            }
        }