Exemple #1
0
 void EvaluateItems(IEnumerable <ProjectElement> elements)
 {
     foreach (var child in elements)
     {
         var ige = child as ProjectItemGroupElement;
         if (ige != null)
         {
             foreach (var p in ige.Items)
             {
                 if (!Evaluate(ige.Condition) || !Evaluate(p.Condition))
                 {
                     continue;
                 }
                 Func <string, ProjectItem> creator = s => new ProjectItem(this, p, s);
                 foreach (var item in GetAllItems <ProjectItem> (p.Include, p.Exclude, creator, s => new ProjectTaskItem(p, s), it => string.Equals(it, p.ItemType, StringComparison.OrdinalIgnoreCase), (t, s) => t.RecursiveDir = s))
                 {
                     raw_items.Add(item);
                     all_evaluated_items.Add(item);
                 }
             }
         }
         var def = child as ProjectItemDefinitionGroupElement;
         if (def != null)
         {
             foreach (var p in def.ItemDefinitions)
             {
                 if (Evaluate(p.Condition))
                 {
                     ProjectItemDefinition existing;
                     if (!item_definitions.TryGetValue(p.ItemType, out existing))
                     {
                         item_definitions.Add(p.ItemType, (existing = new ProjectItemDefinition(this, p.ItemType)));
                     }
                     existing.AddItems(p);
                 }
             }
         }
     }
     all_evaluated_items.Sort((p1, p2) => string.Compare(p1.ItemType, p2.ItemType, StringComparison.OrdinalIgnoreCase));
 }
Exemple #2
0
        public static string GetMetadataValueEscaped(ProjectItemDefinition item, string name)
        {
            var md = item.Metadata.FirstOrDefault(m => m.Name.Equals(name, StringComparison.OrdinalIgnoreCase));

            return(md != null?ProjectCollection.Escape(md.EvaluatedValue) : null);
        }
Exemple #3
0
 public static string GetEvaluatedItemIncludeEscaped(ProjectItemDefinition item)
 {
     // ?? ItemDefinition does not have Include attribute. What's the point here?
     throw new NotImplementedException();
 }
Exemple #4
0
 public static string GetMetadataValueEscaped (ProjectItemDefinition item, string name)
 {
         throw new NotImplementedException ();
 }
Exemple #5
0
 public static string GetEvaluatedItemIncludeEscaped (ProjectItemDefinition item)
 {
         throw new NotImplementedException ();
 }
Exemple #6
0
 public static string GetMetadataValueEscaped(ProjectItemDefinition item, string name)
 {
     throw new NotImplementedException();
 }
Exemple #7
0
 public static string GetEvaluatedItemIncludeEscaped(ProjectItemDefinition item)
 {
     throw new NotImplementedException();
 }