public Stream SetPropertyStream(PropertyTag property, long dataSizeEstimate)
 {
     if (property.PropertyType != PropertyType.Binary && property.PropertyType != PropertyType.Unicode)
     {
         throw new NotSupportedException("Writing properties as streams is only supported for binary and unicode properties for activities.");
     }
     return(new PropertyBagStream(this.propertyBag, ActivityPropertyBagAdapter.PropDefFromPropTag(property), property.PropertyType, (int)dataSizeEstimate));
 }
        public AnnotatedPropertyValue GetAnnotatedProperty(PropertyTag propertyTag)
        {
            if (propertyTag == PropertyTag.Mid)
            {
                return(new AnnotatedPropertyValue(propertyTag, new PropertyValue(propertyTag, 0L), null));
            }
            object        obj           = this.propertyBag.TryGetProperty(ActivityPropertyBagAdapter.PropDefFromPropTag(propertyTag));
            PropertyValue propertyValue = PropertyError.IsPropertyError(obj) ? PropertyValue.Error(propertyTag.PropertyId, (ErrorCode)2147746063U) : new PropertyValue(propertyTag, obj);

            return(new AnnotatedPropertyValue(propertyTag, propertyValue, null));
        }
 public void Delete(PropertyTag property)
 {
     this.propertyBag.Delete(ActivityPropertyBagAdapter.PropDefFromPropTag(property));
 }
 public void SetProperty(PropertyValue propertyValue)
 {
     this.propertyBag.SetOrDeleteProperty(ActivityPropertyBagAdapter.PropDefFromPropTag(propertyValue.PropertyTag), propertyValue.Value);
 }