public bool ConsumeAddInstanceSubscription(
            AddInstanceSubscription subscription)
        {
            pht.Batch(actions =>
            {
                var message = new MemoryStream();
                messageSerializer.Serialize(new[] {subscription}, message);
                var itemId = actions.AddItem(new AddItemRequest
                {
                    Key = subscriptionsKey,
                    Data = message.ToArray()
                });

                remoteInstanceSubscriptions.Add(
                    subscription.InstanceSubscriptionKey,
                    subscription.Type,
                    new Uri(subscription.Endpoint),
                    itemId);

                actions.Commit();
            });

            RaiseSubscriptionChanged();
            return true;
        }
 private bool ConsumeAddInstanceSubscription(CurrentMessageInformation msgInfo, AddInstanceSubscription subscription)
 {
     remoteInstanceSubscriptions.Add(
         subscription.InstanceSubscriptionKey,
         subscription.Type,
         new Uri(subscription.Endpoint),
         msgInfo.MessageId);
     var msmqMsgInfo = msgInfo as MsmqCurrentMessageInformation;
     if (msmqMsgInfo != null)
         queueStrategy.MoveToSubscriptionQueue(msmqMsgInfo.Queue, msmqMsgInfo.MsmqMessage);
     RaiseSubscriptionChanged();
     return true;
 }
 private bool ConsumeAddInstanceSubscription(CurrentMessageInformation msgInfo, AddInstanceSubscription subscription)
 {
     remoteInstanceSubscriptions.Add(
         subscription.InstanceSubscriptionKey,
         subscription.Type,
         new Uri(subscription.Endpoint),
         msgInfo.TransportMessageId);
     var msmqMsgInfo = msgInfo as MsmqCurrentMessageInformation;
     if (msmqMsgInfo != null)
     {
         msmqMsgInfo.Queue.Send(
             msmqMsgInfo.MsmqMessage.SetSubQueueToSendTo(SubQueue.Subscriptions));
     }
     RaiseSubscriptionChanged();
     return true;
 }
 public bool ConsumeAddInstanceSubscription(AddInstanceSubscription subscription)
 {
     return true;
 }