internal void PublishAttributeChangeSuggestion(ProposeAttributeChangeEventArgs e) { if (this.ProposedAttributeChange != null) { this.ProposedAttributeChange(this, e); } else { // if ProposedAttributeChange is null, then Service Bus is uninitialized and we fall back onto normal // change propagation, i.e. via ChangedAttribute event. e.Entity[e.ComponentName][e.AttributeName].Set(e.Value); } }
private void HandleTransformation(object sender, ProposeAttributeChangeEventArgs transform) { Dictionary <string, Dictionary <string, object> > initialAccumulation = new Dictionary <string, Dictionary <string, object> >(); Dictionary <string, object> initialAttributeUpdates = new Dictionary <string, object>(); initialAttributeUpdates.Add(transform.AttributeName, transform.Value); initialAccumulation.Add(transform.ComponentName, initialAttributeUpdates); AccumulatedAttributeTransform initialTransform = new AccumulatedAttributeTransform(transform.Entity, initialAccumulation); string topic = transform.ComponentName + "." + transform.AttributeName; if (topicSubscriptions.ContainsKey(topic) && topicSubscriptions[topic].Count > 0) { InvokeTopicHandlers(topic, initialTransform); } else { CloseComputation(initialTransform); } }