Beispiel #1
0
        private static BuildList <BuildSpecialSdk> GetBlendSilverlightSdks()
        {
            BuildList <BuildSpecialSdk> installedSdks =
                new BuildList <BuildSpecialSdk>();

            string programFiles = PathUtils.ProgramFiles32;
            // For the versions 2.0--3.5
            string blendDir = Path.Combine(programFiles,
                                           @"Microsoft SDKs\Expression\Blend 3\Interactivity\Libraries\Silverlight");

            if (Directory.Exists(blendDir) &&
                !DirectoryUtils.IsDirectoryEmpty(blendDir))
            {
                BuildSpecialSdk specialSdk = new BuildSpecialSdk(
                    BuildSpecialSdkType.Blend03, new Version(3, 0, 0, 0),
                    blendDir, blendDir);

                installedSdks.Add(specialSdk);
            }

            // For the versions 4.0
            blendDir = Path.Combine(programFiles,
                                    @"Microsoft SDKs\Expression\Blend\Silverlight\v4.0\Libraries");
            if (Directory.Exists(blendDir) &&
                !DirectoryUtils.IsDirectoryEmpty(blendDir))
            {
                BuildSpecialSdk specialSdk = new BuildSpecialSdk(
                    BuildSpecialSdkType.Blend04, new Version(4, 0, 0, 0),
                    blendDir, blendDir);

                installedSdks.Add(specialSdk);
            }

            // For the versions 5.0 - Currently, only Silverlight 5
            blendDir = Path.Combine(programFiles,
                                    @"Microsoft SDKs\Expression\Blend\Silverlight\v5.0\Libraries");
            if (Directory.Exists(blendDir) &&
                !DirectoryUtils.IsDirectoryEmpty(blendDir))
            {
                BuildSpecialSdk specialSdk = new BuildSpecialSdk(
                    BuildSpecialSdkType.Blend05, new Version(5, 0, 0, 0),
                    blendDir, blendDir);

                installedSdks.Add(specialSdk);
            }

            if (installedSdks == null || installedSdks.Count == 0)
            {
                return(null);
            }

            return(installedSdks);
        }
Beispiel #2
0
        public virtual BuildList <T> Clone()
        {
            BuildList <T> clonedList = new BuildList <T>(this);

            int itemCount = this.Count;

            for (int i = 0; i < itemCount; i++)
            {
                clonedList.Add((T)this[i].Clone());
            }

            return(clonedList);
        }
Beispiel #3
0
        private static void AddWebMvcSdk(string assembliesDir,
                                         BuildSpecialSdkType sdkType, BuildList <BuildSpecialSdk> installedSdks)
        {
            if (!Directory.Exists(assembliesDir) ||
                DirectoryUtils.IsDirectoryEmpty(assembliesDir))
            {
                return;
            }

            string assemblyFile = Path.Combine(assembliesDir,
                                               "System.Web.Mvc.dll");
            string commentFile = Path.Combine(assembliesDir,
                                              "System.Web.Mvc.xml");

            // The ASP.NET MVC 4 has several assemblies, but these include
            // the main assembly System.Web.Mvc.dll.
            if (File.Exists(assemblyFile) && File.Exists(commentFile))
            {
                Version version = null;

                switch (sdkType.Value)
                {
                case 10:
                    version = new Version(1, 0, 0, 0);
                    break;

                case 20:
                    version = new Version(2, 0, 0, 0);
                    break;

                case 30:
                    version = new Version(3, 0, 0, 0);
                    break;

                case 40:
                    version = new Version(4, 0, 0, 0);
                    break;
                }

                if (version == null)
                {
                    return;
                }

                BuildSpecialSdk specialSdk = new BuildSpecialSdk(
                    sdkType, version, assembliesDir, assembliesDir);

                installedSdks.Add(specialSdk);
            }
        }
Beispiel #4
0
        protected virtual U Clone(U clonedContent)
        {
            if (_listItems != null)
            {
                int           itemCount = _listItems.Count;
                BuildList <T> listItems = new BuildList <T>(new List <T>(itemCount));

                for (int i = 0; i < itemCount; i++)
                {
                    listItems.Add(_listItems[i].Clone());
                }

                clonedContent._listItems = listItems;
            }

            return(clonedContent);
        }
        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;
        }
        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);
            }
        }
        /// <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;
                    }
                }
            }
        }
Beispiel #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BuildList{T}"/> class
        /// with parameters copied from the specified instance of the
        /// <see cref="BuildList{T}"/> class, a copy constructor.
        /// </summary>
        /// <param name="source">
        /// An instance of the <see cref="BuildList{T}"/> class from which the
        /// initialization parameters or values will be copied.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the parameter <paramref name="source"/> is <see langword="null"/>.
        /// </exception>
        public BuildList(BuildList <T> source)
        {
            BuildExceptions.NotNull(source, "source");

            _version = source._version;
        }