Esempio n. 1
0
        public ITaskItem [] ConvertToITaskItemArray(Project project, ExpressionOptions options)
        {
            List <ITaskItem> items = new List <ITaskItem> ();

            if (IsQualified)
            {
                // Bucket would have item lists with same metadata values,
                // so just get the value from the first item
                BuildItemGroup group;
                if (project.TryGetEvaluatedItemByNameBatched(itemName, out group))
                {
                    BuildItemGroupToITaskItems(group, items, true);
                }
            }
            else
            {
                // Get unique metadata values from _all_ item lists
                foreach (BuildItemGroup group in project.GetAllItemGroups())
                {
                    BuildItemGroupToITaskItems(group, items, false);
                }
            }

            return(items.Count == 0 ? null : items.ToArray());
        }
		public ITaskItem [] ConvertToITaskItemArray (Project project, ExpressionOptions options)
		{
			List<ITaskItem> items = new List<ITaskItem> ();
			if (IsQualified) {
				// Bucket would have item lists with same metadata values,
				// so just get the value from the first item
				BuildItemGroup group;
				if (project.TryGetEvaluatedItemByNameBatched (itemName, out group))
					BuildItemGroupToITaskItems (group, items, true);
			} else {
				// Get unique metadata values from _all_ item lists
				foreach (BuildItemGroup group in project.GetAllItemGroups ())
					BuildItemGroupToITaskItems (group, items, false);
			}

			return items.Count == 0 ? null : items.ToArray ();
		}