Exemple #1
0
        private void AddPlatformVersionFilter(string platformId, string versionId, XPathNavigator platformNode, string file)
        {
            Dictionary <string, VersionFilter> platformFrameworks;

            if (!versionFilters.TryGetValue(platformId, out platformFrameworks))
            {
                platformFrameworks = new Dictionary <string, VersionFilter>();
                versionFilters.Add(platformId, platformFrameworks);
            }

            try
            {
                VersionFilter filter;
                XmlReader     platformReader = platformNode.ReadSubtree();
                platformReader.MoveToContent();
                if (!platformFrameworks.TryGetValue(versionId, out filter))
                {
                    filter = new VersionFilter(platformReader, versionId, file);
                }
                else
                {
                    // if the platform already has a filter for this version, add the data from the current platform node
                    filter.AddPlatformNode(platformReader, file);
                }
                platformReader.Close();

                platformFrameworks.Remove(versionId);
                platformFrameworks.Add(versionId, filter);
            }
            catch (Exception e)
            {
                WriteMessage(MessageLevel.Error, e.Message);
            }
        }
        private void AddPlatformVersionFilter(string platformId, string versionId, XPathNavigator platformNode, string file)
        {
            Dictionary<string, VersionFilter> platformFrameworks;
            if (!versionFilters.TryGetValue(platformId, out platformFrameworks))
            {
                platformFrameworks = new Dictionary<string, VersionFilter>();
                versionFilters.Add(platformId, platformFrameworks);
            }

            try
            {
                VersionFilter filter;
                XmlReader platformReader = platformNode.ReadSubtree();
                platformReader.MoveToContent();
                if (!platformFrameworks.TryGetValue(versionId, out filter))
                {
                    filter = new VersionFilter(platformReader, versionId, file);
                }
                else
                {
                    // if the platform already has a filter for this version, add the data from the current platform node
                    filter.AddPlatformNode(platformReader, file);
                }
                platformReader.Close();

                platformFrameworks.Remove(versionId);
                platformFrameworks.Add(versionId, filter);
            }
            catch (Exception e)
            {
                WriteMessage(MessageLevel.Error, e.Message);
            }
        }