Пример #1
0
 public TemplatePropertyGroup(TemplatePropertyGroup source)
     : base(source)
 {
     _condition     = source._condition;
     _properties    = source._properties;
     _frameworkType = source._frameworkType;
 }
Пример #2
0
 public TemplateItemGroup(TemplateItemGroup source)
     : base(source)
 {
     _items         = source._items;
     _condition     = source._condition;
     _frameworkType = source._frameworkType;
 }
Пример #3
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))
            {
                return;
            }

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

            if (!String.IsNullOrEmpty(tempText))
            {
                _frameworkType = (TemplateFrameworkType)Enum.Parse(
                    typeof(TemplateFrameworkType), tempText, true);
            }
            _condition = reader.GetAttribute("Condition");

            if (reader.IsEmptyElement)
            {
                return;
            }

            if (_items == null || _items.Count != 0)
            {
                _items = new BuildList <TemplateItem>();
            }

            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (String.Equals(reader.Name, TemplateItem.TagName,
                                      StringComparison.OrdinalIgnoreCase))
                    {
                        TemplateItem item = new TemplateItem();
                        item.ReadXml(reader);

                        if (!item.IsEmpty)
                        {
                            _items.Add(item);
                        }
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    if (String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase))
                    {
                        break;
                    }
                }
            }
        }
Пример #4
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))
            {
                string tempText = reader.GetAttribute("FrameworkType");
                if (!String.IsNullOrEmpty(tempText))
                {
                    _frameworkType = (TemplateFrameworkType)Enum.Parse(
                        typeof(TemplateFrameworkType), tempText, true);
                }
            }
        }
Пример #5
0
 public TemplatePropertyGroup()
 {
     _condition     = String.Empty;
     _properties    = new BuildProperties();
     _frameworkType = TemplateFrameworkType.None;
 }
Пример #6
0
 public TemplateTargetFramework(TemplateTargetFramework source)
     : base(source)
 {
     _frameworkType = source._frameworkType;
 }
Пример #7
0
 public TemplateTargetFramework()
 {
     _frameworkType = TemplateFrameworkType.None;
 }
Пример #8
0
 public TemplateItemGroup()
 {
     _items         = new BuildList <TemplateItem>();
     _condition     = String.Empty;
     _frameworkType = TemplateFrameworkType.None;
 }