// Topic subscriptions // The topic.RootItem.Expand field controls whether thr server publishes the item or not // Set it to true only if at least one subscriber is subscribed. public void Publish(ITopic topic) { TopicSubsInfo si; if (!topicSubs.TryGetValue(topic, out si)) { si = new TopicSubsInfo(); topicSubs[topic] = si; // make the server start publishing the topic topic.RootDI.Expand = true; } si.RefCount++; }
// Topic subscriptions public void Publish(ITopic topic) { TopicSubsInfo si; if (!topicSubs.TryGetValue(topic, out si)) { si = new TopicSubsInfo(); topicSubs[topic] = si; // let the node know we need this DI to be published node.Publish(topic); } si.RefCount++; }