示例#1
0
        public BuildFramework(BuildFrameworkType type, string assemblyDir,
                              IList <string> commentDirs, Version version)
            : this(type, commentDirs, version)
        {
            BuildExceptions.NotNullNotEmpty(assemblyDir, "assemblyDir");

            _assemblyDir = assemblyDir;
        }
示例#2
0
 public BuildFramework(BuildFramework source)
     : base(source)
 {
     _version       = source._version;
     _assemblyDir   = source._assemblyDir;
     _commentDirs   = source._commentDirs;
     _commentFiles  = source._commentFiles;
     _frameworkType = source._frameworkType;
 }
示例#3
0
 public BuildFramework(BuildFrameworkType type, string assemblyDir,
                       IList <string> commentDirs, IList <string> commentFiles, Version version)
     : this(type, assemblyDir, commentDirs, version)
 {
     if (commentFiles != null && commentFiles.Count != 0)
     {
         _commentFiles = new BuildList <string>(commentFiles);
     }
 }
示例#4
0
        public BuildFramework(BuildFrameworkType type, IList <string> commentDirs,
                              Version version) : this()
        {
            if (type == BuildFrameworkType.Null ||
                type == BuildFrameworkType.None)
            {
                throw new ArgumentException("The framework type must be valid.");
            }

            BuildExceptions.NotNull(version, "version");
            BuildExceptions.NotNull(commentDirs, "commentDirs");

            _version = version;
            if (commentDirs != null && commentDirs.Count != 0)
            {
                _commentDirs = new BuildList <string>(commentDirs);
            }
            _frameworkType = type;
        }
示例#5
0
        public BuildFramework()
        {
            _frameworkType = BuildFrameworkType.Framework20;
            _version       = new Version(2, 0, 50727, 1433);
            _assemblyDir   = Environment.ExpandEnvironmentVariables(
                @"%SystemRoot%\Microsoft.NET\Framework\v" + _version.ToString(3));

            _commentDirs = new BuildList <string>();
            _commentDirs.Add(_assemblyDir);

            // Check if F# 2.0 is installed...
            string fSharpDir = Path.Combine(PathUtils.ProgramFiles32,
                                            @"Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v2.0");

            if (Directory.Exists(fSharpDir))
            {
                _commentDirs.Add(fSharpDir);
            }
        }
示例#6
0
        /// <summary>
        /// This reads and sets its state or attributes stored in a <c>XML</c> format
        /// with the given reader.
        /// </summary>
        /// <param name="reader">
        /// The reader with which the <c>XML</c> attributes of this object are accessed.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the <paramref name="reader"/> is <see langword="null"/>.
        /// </exception>
        public override void ReadXml(XmlReader reader)
        {
            BuildExceptions.NotNull(reader, "reader");

            Debug.Assert(reader.NodeType == XmlNodeType.Element);
            if (reader.NodeType != XmlNodeType.Element)
            {
                return;
            }

            if (!String.Equals(reader.Name, TagName,
                               StringComparison.OrdinalIgnoreCase))
            {
                Debug.Assert(false, String.Format(
                                 "The element name '{0}' does not match the expected '{1}'.",
                                 reader.Name, TagName));
                return;
            }

            string tempText = reader.GetAttribute("type");

            if (!String.IsNullOrEmpty(tempText))
            {
                _frameworkType = BuildFrameworkType.Parse(tempText);
            }
            if (reader.IsEmptyElement)
            {
                return;
            }
            if (_commentDirs == null || _commentDirs.Count == 0)
            {
                _commentDirs = new BuildList <string>();
            }

            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    switch (reader.Name.ToLower())
                    {
                    case "version":
                        _version = new Version(reader.ReadString());
                        break;

                    case "assemblyDir":
                        _assemblyDir = reader.ReadString();
                        break;

                    case "commentDir":
                        _commentDirs.Add(reader.ReadString());
                        break;
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    if (String.Equals(reader.Name, TagName,
                                      StringComparison.OrdinalIgnoreCase))
                    {
                        break;
                    }
                }
            }
        }