/// <summary> /// Load component properties from a property bag. /// </summary> /// <param name="propertyBag">Property bag</param> /// <param name="errorLog">Error log level</param> protected override void LoadProperties(IPropertyBag propertyBag, int errorLog) { this.ActivityName = this.ReadPropertyValue <string>(propertyBag, ACTIVITY_NAME_PROP, this.ActivityName); this.EnableContinuation = this.ReadPropertyValue <bool>(propertyBag, ENABLE_CONTINUATION_PROP, this.EnableContinuation); this.UseContinuation = this.ReadPropertyValue <bool>(propertyBag, USE_CONTINUATION_PROP, this.UseContinuation); string xml = this.ReadPropertyValue <string>(propertyBag, EVENT_SOURCES_PROP, null); if (string.IsNullOrEmpty(xml) == false) { BAMEventSourceSerializer serializer = new BAMEventSourceSerializer(); serializer.Deserialize(xml); this.EventSources = serializer.Properties; } }
/// <summary> /// Save component properties to a property bag. /// </summary> /// <param name="propertyBag">Property bag</param> /// <param name="clearDirty">Clear dirty flag</param> /// <param name="saveAllProperties">Save all properties flag</param> protected override void SaveProperties(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties) { this.WritePropertyValue(propertyBag, ACTIVITY_NAME_PROP, this.ActivityName); this.WritePropertyValue(propertyBag, ENABLE_CONTINUATION_PROP, this.EnableContinuation); this.WritePropertyValue(propertyBag, USE_CONTINUATION_PROP, this.UseContinuation); string xml = null; if (this.EventSources != null) { BAMEventSourceSerializer serializer = new BAMEventSourceSerializer(this.EventSources); xml = serializer.Serialize(); } this.WritePropertyValue(propertyBag, EVENT_SOURCES_PROP, xml); }