コード例 #1
0
        override public void ActivateOptions()
        {
            if (m_environmentHandler == null)
            {
                throw new ArgumentNullException("environmentHandler");
            }
            string[] split = m_environmentHandler.Split(new char[] { ',' });
            if (split.Length < 2)
            {
                throw new Exception("Value has to be in format");
            }

            Assembly ass = GetAssembly(split[1].Trim());

            if (ass == null)
            {
                throw new Exception("Assembly not found");
            }
            Type type = ass.GetType(split[0]);

            if (type == null)
            {
                throw new Exception("Type not found");
            }
            _handlerInstance = (ILogEnvironmentHandler)Activator.CreateInstance(type);
        }
コード例 #2
0
ファイル: LogHandler.cs プロジェクト: Rinsen/InnovationBoost
 public LogHandler(ILogWriter logWriter,
                   ILogEnvironmentHandler logEnvironmentHandler,
                   ISourceHandler sourceHandler)
 {
     _logWriter             = logWriter;
     _logEnvironmentHandler = logEnvironmentHandler;
     _sourceHandler         = sourceHandler;
 }