示例#1
0
        public override string EvaluateAsString(EvaluationContext context)
        {
            string itemType = Application.Name.Name;
            var    items    = context.GetItems(itemType);

            if (!items.Any())
            {
                return(context.Evaluator.ReplacementForMissingPropertyAndItem);
            }
            if (Application.Expressions == null)
            {
                return(string.Join(";", items.Select(item => context.EvaluateItem(itemType, item))));
            }
            else
            {
                return(string.Join(";", items.Select(item => {
                    context.ContextItem = item;
                    var ret = string.Concat(Application.Expressions.Select(e => e.EvaluateAsString(context)));
                    context.ContextItem = null;
                    return ret;
                })));
            }
        }
示例#2
0
        public override string EvaluateAsString(EvaluationContext context)
        {
            string itemType     = this.Access.ItemType != null ? this.Access.ItemType.Name : null;
            string metadataName = Access.Metadata.Name;
            IEnumerable <object> items;

            if (this.Access.ItemType != null)
            {
                items = context.GetItems(itemType);
            }
            else if (context.ContextItem != null)
            {
                items = new Object [] { context.ContextItem }
            }
            ;
            else
            {
                items = context.GetAllItems();
            }

            var values = items.Select(i => (i is ProjectItem) ? ((ProjectItem)i).GetMetadataValue(metadataName) : ((ProjectItemInstance)i).GetMetadataValue(metadataName)).Where(s => !string.IsNullOrEmpty(s));

            return(string.Join(";", values));
        }
示例#3
0
		public override string EvaluateAsString (EvaluationContext context)
		{
			string itemType = this.Access.ItemType != null ? this.Access.ItemType.Name : null;
			string metadataName = Access.Metadata.Name;
			IEnumerable<object> items;
			if (this.Access.ItemType != null)
				items = context.GetItems (itemType);
			else if (context.ContextItem != null)
				items = new Object [] { context.ContextItem };
			else
				items = context.GetAllItems ();
			
			var values = items.Select (i => (i is ProjectItem) ? ((ProjectItem) i).GetMetadataValue (metadataName) : ((ProjectItemInstance) i).GetMetadataValue (metadataName)).Where (s => !string.IsNullOrEmpty (s));
			return string.Join (";", values);
		}
示例#4
0
		public override string EvaluateAsString (EvaluationContext context)
		{
			string itemType = Application.Name.Name;
			var items = context.GetItems (itemType);
			if (!items.Any ())
				return context.Evaluator.ReplacementForMissingPropertyAndItem;
			if (Application.Expressions == null)
				return string.Join (";", items.Select (item => context.EvaluateItem (itemType, item)));
			else
				return string.Join (";", items.Select (item => {
					context.ContextItem = item;
					var ret = string.Concat (Application.Expressions.Select (e => e.EvaluateAsString (context)));
					context.ContextItem = null;
					return ret;
					}));
		}
		public override string EvaluateAsString (EvaluationContext context)
		{
			string itemType = Application.Name.Name;
			var items = context.GetItems (itemType);
			if (!items.Any ())
				return null;
			if (Application.Expressions == null)
				return string.Join (";", items.Select (item => Unwrap (context.EvaluateItem (itemType, item))));
			else
				return string.Join (";", items.Select (item => {
					context.ContextItem = item;
					var ret = Unwrap (string.Concat (Application.Expressions.Select (e => e.EvaluateAsString (context))));
					context.ContextItem = null;
					return ret;
				}));
		}