예제 #1
0
        internal static ProjectItemDefinitionInstance FactoryForDeserialization(ITranslator translator)
        {
            var instance = new ProjectItemDefinitionInstance();

            ((ITranslatable)instance).Translate(translator);

            return(instance);
        }
예제 #2
0
 void EvaluateItems(ProjectRootElement xml, IEnumerable <ProjectElement> elements)
 {
     foreach (var child in elements)
     {
         var ige = child as ProjectItemGroupElement;
         if (ige != null)
         {
             foreach (var p in ige.Items)
             {
                 if (!EvaluateCondition(ige.Condition) || !EvaluateCondition(p.Condition))
                 {
                     continue;
                 }
                 Func <string, ProjectItemInstance> creator = s => new ProjectItemInstance(this, p.ItemType, p.Metadata.Select(m => new KeyValuePair <string, string> (m.Name, m.Value)).ToList(), s);
                 foreach (var item in GetAllItems(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 (EvaluateCondition(p.Condition))
                 {
                     ProjectItemDefinitionInstance existing;
                     if (!item_definitions.TryGetValue(p.ItemType, out existing))
                     {
                         item_definitions.Add(p.ItemType, (existing = new ProjectItemDefinitionInstance(p)));
                     }
                     existing.AddItems(p);
                 }
             }
         }
     }
     all_evaluated_items.Sort((p1, p2) => string.Compare(p1.ItemType, p2.ItemType, StringComparison.OrdinalIgnoreCase));
 }
예제 #3
0
        public static string GetMetadataValueEscaped(ProjectItemDefinitionInstance item, string name)
        {
            var md = item.Metadata.FirstOrDefault(m => m.Name.Equals(name, StringComparison.OrdinalIgnoreCase));

            return(md != null?ProjectCollection.Escape(md.EvaluatedValue) : null);
        }
예제 #4
0
        // static members

        public static string GetEvaluatedItemIncludeEscaped(ProjectItemDefinitionInstance item)
        {
            // ?? ItemDefinition does not have Include attribute. What's the point here?
            throw new NotImplementedException();
        }
예제 #5
0
		public static string GetMetadataValueEscaped (ProjectItemDefinitionInstance item, string name)
		{
			throw new NotImplementedException ();
		}
예제 #6
0
		// static members		

		public static string GetEvaluatedItemIncludeEscaped (ProjectItemDefinitionInstance item)
		{
			throw new NotImplementedException ();
		}
예제 #7
0
 public static string GetMetadataValueEscaped(ProjectItemDefinitionInstance item, string name)
 {
     throw new NotImplementedException();
 }
예제 #8
0
        // static members

        public static string GetEvaluatedItemIncludeEscaped(ProjectItemDefinitionInstance item)
        {
            throw new NotImplementedException();
        }