Exemple #1
0
        private void Initialize(Type targetType, Type configurationType)
        {
            var expectedType = typeof(Solution.Configuration);

            if (configurationType == null || (configurationType != expectedType && !configurationType.IsSubclassOf(expectedType)))
            {
                throw new InternalError("configuration type {0} must be a subclass of {1}", targetType.FullName, expectedType.FullName);
            }

            ConfigurationType = configurationType;

            ClassName = GetType().Name;
            Targets.Initialize(targetType);

            string file;

            if (Util.GetStackSourceFileTopMostTypeOf(GetType(), out file))
            {
                FileInfo fileInfo = new FileInfo(file);
                SharpmakeCsFileName = Util.PathMakeStandard(fileInfo.FullName);
                SharpmakeCsPath     = Util.PathMakeStandard(fileInfo.DirectoryName);
            }
            else
            {
                throw new InternalError("Cannot locate cs source for type: {0}", GetType().FullName);
            }
        }
Exemple #2
0
        private void Initialize(Type targetType)
        {
            ClassName = GetType().Name;
            Targets.Initialize(targetType);

            string file;

            if (Util.GetStackSourceFileTopMostTypeOf(GetType(), out file))
            {
                FileInfo fileInfo = new FileInfo(file);
                SharpmakeCsFileName = Util.PathMakeStandard(fileInfo.FullName);
                SharpmakeCsPath     = Util.PathMakeStandard(fileInfo.DirectoryName);
            }
            else
            {
                throw new InternalError("Cannot locate cs source for type: {}", GetType().FullName);
            }
        }