Esempio n. 1
0
        internal override void Read(MSBuildItem item)
        {
            base.Read(item);

            var copyString = item.HasMetadata(CopyToOutputDirectoryAtt)
                ? item.GetMetadata(CopyToOutputDirectoryAtt)
                : null;

            switch (copyString)
            {
                case null:
                    CopyToOutputDirectory = ContentCopy.Never;
                    break;

                case "Always":
                    CopyToOutputDirectory = ContentCopy.Always;
                    break;

                case "PreserveNewest":
                    CopyToOutputDirectory = ContentCopy.IfNewer;
                    break;
            }

            Link = item.HasMetadata(LinkAtt) ? item.GetMetadata(LinkAtt) : null;
        }
Esempio n. 2
0
        internal override void Read(MSBuildItem item)
        {
            base.Read(item);

            ProjectName = item.GetMetadata("Name");
            var raw = item.GetMetadata("Project").TrimStart('{').TrimEnd('}');
            ProjectGuid = Guid.Parse(raw);
        }
Esempio n. 3
0
 public void MergeFrom(MSBuildItem other)
 {
     foreach (XmlNode node in Element.ChildNodes)
     {
         if (node is XmlElement)
             SetMetadata(node.LocalName, node.InnerXml);
     }
 }
Esempio n. 4
0
        internal virtual MSBuildItem Configure(MSBuildItemGroup @group)
        {
            var item = @group.Items.FirstOrDefault(Matches)
                       ?? @group.AddNewItem(Name, Include);

            this.BuildItem = item;
            return item;
        }
Esempio n. 5
0
        internal override void Read(MSBuildItem item)
        {
            base.Read(item);

            Link = item.HasMetadata(LinkAtt) ? item.GetMetadata(LinkAtt) : null;
        }
        internal override void Read(MSBuildItem item)
        {
            base.Read(item);

            HintPath = item.HasMetadata(HintPathAtt) ? item.GetMetadata(HintPathAtt) : null;
            FusionName = item.HasMetadata("FusionName") ? item.GetMetadata("FusionName") : null;
            Aliases = item.HasMetadata("Aliases") ? item.GetMetadata("Aliases") : null;
            DisplayName = item.HasMetadata("Name") ? item.GetMetadata("Name") : null;

            if (item.HasMetadata("SpecificVersion"))
            {
                SpecificVersion = bool.Parse(item.GetMetadata("SpecificVersion"));
            }

            if (item.HasMetadata("Private"))
            {
                Private = bool.Parse(item.GetMetadata("Private"));
            }
        }
Esempio n. 7
0
 internal virtual void Read(MSBuildItem item)
 {
     Include = item.Include;
 }
Esempio n. 8
0
 internal bool Matches(MSBuildItem item)
 {
     return item.Name == Name && item.Include == Include;
 }
Esempio n. 9
0
 internal MSBuildItem GetItem(XmlElement elem)
 {
     MSBuildObject ob;
     if (elemCache.TryGetValue(elem, out ob))
         return (MSBuildItem)ob;
     var it = new MSBuildItem(elem);
     elemCache[elem] = it;
     return it;
 }
Esempio n. 10
0
 public void RemoveItem(MSBuildItem item)
 {
     elemCache.Remove(item.Element);
     var parent = (XmlElement)item.Element.ParentNode;
     item.Element.ParentNode.RemoveChild(item.Element);
     if (parent.ChildNodes.Count == 0)
     {
         elemCache.Remove(parent);
         parent.ParentNode.RemoveChild(parent);
         bestGroups = null;
     }
 }
Esempio n. 11
0
 internal virtual void Read(MSBuildItem item)
 {
     this.BuildItem = item;
     Include = item.Include;
 }