public virtual void RemoveDefaultPropertyReference(DefaultPropertyValue DefaultPropertyVal) { var item = FindItem(DefaultPropertyVal); if (item != null) { DefaultPropertyValueContainer.Remove(item); } }
public virtual DefaultPropertyValueReference FindItem(DefaultPropertyValue propValue) { if (!HasDefaultPropertyReference(propValue)) { throw new PropertyDoesNotExistException(propValue.Name); } return(DefaultPropertyValueContainer[propValue.Name].As <DefaultPropertyValueReference>( )); // return _defaultPropertyValueReferences.Where( x => x.Name.ToLowerInvariant( ) == propValue.Name.ToLowerInvariant( ) ).FirstOrDefault( ); }
public virtual void RemoveByWorkTypeProperty(DefaultPropertyValue workTypePropertyValue) { if (UsesWorkTypeProperty(workTypePropertyValue)) { var item = _selectionCriterion.Where(x => x.PropertyValueProvider.StaticInstanceID == workTypePropertyValue.StaticInstanceID).FirstOrDefault( ); if (item == null) { return; } RemoveDynamicPropertyCriterion(item); } }
public PropertyValue(DefaultPropertyValue DefaultPropertyValue) : base(DefaultPropertyValue.DataType, DefaultPropertyValue.Name) { this.ExternalMessageKey = DefaultPropertyValue.ExternalMessageKey; DefaultPropertyID = DefaultPropertyValue.Id; DefaultPropertyStaticID = DefaultPropertyValue.StaticInstanceID; this.StaticInstanceID = DefaultPropertyStaticID; Value = DefaultPropertyValue.Value; _defaultValue = DefaultPropertyValue.StringValue; }
/// <summary> /// Initializes a new instance of the DynamicPropertyCriterion class. /// </summary> /// <param name="propertyNameProvider"></param> /// <param name="propertyValueProvider"></param> public DynamicPropertyCriterion(DefaultPropertyValue propertyNameProvider, DefaultPropertyValue propertyValueProvider) { if (propertyNameProvider == null) { throw new ArgumentException("The propertyNameProvider can not be null"); } if (propertyValueProvider == null) { throw new ArgumentException("The propertyValueProvider can not be null"); } this.propertyNameProvider = propertyNameProvider; this.propertyValueProvider = propertyValueProvider; this.Name = string.Format("PropertyCriterion {2} Keyprovider = '{0}'; ValueProvider = '{1}'", propertyNameProvider.ExternalMessageKey, propertyValueProvider.ExternalMessageKey, propertyNameProvider.Name); }
public virtual DefaultPropertyValue CreateDefaultPropertyValue() { var dynamicPropValueObject = new DefaultPropertyValue(this); return(dynamicPropValueObject); }
public virtual bool HasDefaultPropertyReference(DefaultPropertyValue DefaultPropertyVal) { return(DefaultPropertyValueContainer.HasProperty(DefaultPropertyVal.Name)); }
public virtual void AddDefaultPropertyReference(DefaultPropertyValue DefaultPropertyVal) { var propRef = new DefaultPropertyValueReference(DefaultPropertyVal.Name, DefaultPropertyVal.Id); DefaultPropertyValueContainer.AddProperty(propRef); }
public virtual bool UsesItemProperty(DefaultPropertyValue Criteria) { var item = _selectionCriterion.Where(x => x.PropertyNameProvider.StaticInstanceID == Criteria.StaticInstanceID).FirstOrDefault( ); return(item != null); }