예제 #1
0
파일: Client.cs 프로젝트: ziyan/reactivity
 public Subscription Subscribe(Guid device, SubscriptionCallback callback)
 {
     return Subscribe(device, -1, callback);
 }
예제 #2
0
파일: Client.cs 프로젝트: ziyan/reactivity
 public Subscription Subscribe(Guid device, short service, SubscriptionCallback callback)
 {
     if (callback == null || service == 0)
         throw new ArgumentException();
     Subscription subscription = base.Subscribe(device, service);
     if (subscription != null)
     {
         subscriptions[subscription.Guid] = subscription;
         subscriptions_callbacks[subscription.Guid] = callback;
     }
     return subscription;
 }
예제 #3
0
 public static EventRaisedConstraint <TEventArg> RaiseWith <TEventArg>(
     SubscriptionCallback <TEventArg> subscription)
 {
     return(new EventRaisedConstraint <TEventArg>(subscription));
 }
예제 #4
0
파일: Form1.cs 프로젝트: A2Access/examples
        private void sendButton_Click(object sender, EventArgs e)
        {

            
            subscriptionCallback = () =>
            {
                JObject msg = new JObject();
                JObject msg2 = new JObject();
                DesktopUtils.updateJSONValue(msg, "data", dataTextBox.Text);
                DesktopUtils.updateJSONValue(msg2, "topic", "incoming-data");
                DesktopUtils.updateJSONValue(msg2, "message", dataTextBox.Text);
                interAppBus_.send("exceladapter", "update", msg2);
                interAppBus_.send(htmlDemoUuid_, topicTextBox.Text, msg);
            };

            if (subscriptionMap.ContainsKey(topicTextBox.Text))
            {
                subscriptionCallback();
            }
            else { 
                JObject msg = new JObject();
                DesktopUtils.updateJSONValue(msg, "topic", topicTextBox.Text); 
                interAppBus_.send("htmlinterappcommdemo", "new-topic", msg);
            }
        }
예제 #5
0
 public static EventRaisedConstraint Raise(SubscriptionCallback subscription)
 {
     return(new EventRaisedConstraint(subscription));
 }
예제 #6
0
 public CacheSubscription(ISubscription subscription, CoreItemCacheParams cacheParams, SubscriptionCallback userCallback, object userContext)
 {
     Subscription = subscription;
     CacheParams  = cacheParams;
     UserCallback = userCallback;
     UserContext  = userContext;
 }
예제 #7
0
 public ISubscription SubscribeNewOnly <T>(IExpression filter, SubscriptionCallback userCallback, object userContext)
 {
     return(SubscribePrivate(typeof(T), filter, true, false, false, userCallback, userContext));
 }
예제 #8
0
 public ISubscription Subscribe <T>(IExpression whereExpr, SubscriptionCallback userCallback, object userContext)
 {
     return(SubscribePrivate(typeof(T), whereExpr, false, true, false, userCallback, userContext));
 }
예제 #9
0
 public ISubscription Subscribe(Type dataType, IExpression whereExpr, SubscriptionCallback userCallback, object userContext)
 {
     return(SubscribePrivate(dataType, whereExpr, false, true, false, userCallback, userContext));
 }