Exemple #1
0
        protected bool Initialize()
        {
            if (!EnsureCosmosPathsInitialization())
            {
                return(false);
            }

            mDebugMode = (DebugMode)Enum.Parse(typeof(DebugMode), DebugMode);
            if (string.IsNullOrEmpty(TraceAssemblies))
            {
                mTraceAssemblies = Cosmos.Build.Common.TraceAssemblies.User;
            }
            else
            {
                if (!Enum.GetNames(typeof(TraceAssemblies)).Contains(TraceAssemblies, StringComparer.OrdinalIgnoreCase))
                {
                    LogError("Invalid TraceAssemblies specified");
                    return(false);
                }
                mTraceAssemblies = (TraceAssemblies)Enum.Parse(typeof(TraceAssemblies), TraceAssemblies);
            }

            if (string.IsNullOrEmpty(StackCorruptionDetectionLevel))
            {
                mStackCorruptionDetectionLevel = Cosmos.Build.Common.StackCorruptionDetectionLevel.MethodFooters;
            }
            else
            {
                mStackCorruptionDetectionLevel = (StackCorruptionDetectionLevel)Enum.Parse(typeof(StackCorruptionDetectionLevel), StackCorruptionDetectionLevel);
            }

            return(true);
        }
Exemple #2
0
        protected bool Initialize()
        {
            if (!EnsureCosmosPathsInitialization())
            {
                return(false);
            }

            if (AdditionalSearchDirs != null)
            {
                mSearchDirs.AddRange(AdditionalSearchDirs);
            }

            // Add UserKit dirs for asms to load from.
            mSearchDirs.Add(Path.GetDirectoryName(typeof(CompilerEngine).GetTypeInfo().Assembly.Location));
            mSearchDirs.Add(CosmosPaths.UserKit);
            mSearchDirs.Add(CosmosPaths.Kernel);

            mDebugMode = (DebugMode)Enum.Parse(typeof(DebugMode), DebugMode);
            if (string.IsNullOrEmpty(TraceAssemblies))
            {
                mTraceAssemblies = Cosmos.Build.Common.TraceAssemblies.User;
            }
            else
            {
                if (!Enum.GetNames(typeof(TraceAssemblies)).Contains(TraceAssemblies, StringComparer.OrdinalIgnoreCase))
                {
                    LogError("Invalid TraceAssemblies specified");
                    return(false);
                }
                mTraceAssemblies = (TraceAssemblies)Enum.Parse(typeof(TraceAssemblies), TraceAssemblies);
            }

            if (string.IsNullOrEmpty(StackCorruptionDetectionLevel))
            {
                mStackCorruptionDetectionLevel = Cosmos.Build.Common.StackCorruptionDetectionLevel.MethodFooters;
            }
            else
            {
                mStackCorruptionDetectionLevel = (StackCorruptionDetectionLevel)Enum.Parse(typeof(StackCorruptionDetectionLevel), StackCorruptionDetectionLevel);
            }

            return(true);
        }