예제 #1
0
        public void Initialize()
        {
            if (IncludeAppPaths && ChoGuard.IsArgumentNotNullOrEmpty(AppPaths))
            {
                _paths.AddRange(AppPaths);
            }

            if (CodeBasePaths != null && CodeBasePaths.Length > 0)
            {
                foreach (CodeBasePath codeBasePath in CodeBasePaths)
                {
                    _paths.AddRange(codeBasePath.Directories);
                }
            }
        }
예제 #2
0
        internal object CreateInstance()
        {
            if (ConverterType == null)
            {
                return(null);
            }

            if (ChoGuard.IsArgumentNotNullOrEmpty(Parameters) && ChoType.HasConstructor(ConverterType, new object[] { Parameters }))
            {
                return(ChoType.CreateInstance(ConverterType, new object[] { Parameters }));
            }
            else if (ChoType.HasConstructor(ConverterType, new object[] { String.Empty }))
            {
                return(ChoType.CreateInstance(ConverterType, new object[] { Parameters != null && Parameters.Length > 0 ? Parameters[0] : String.Empty }));
            }
            else
            {
                return(ChoType.CreateInstance(ConverterType));
            }
        }