当前位置: 首页>>代码示例>>C#>>正文


C# ISubscription类代码示例

本文整理汇总了C#中ISubscription的典型用法代码示例。如果您正苦于以下问题:C# ISubscription类的具体用法?C# ISubscription怎么用?C# ISubscription使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ISubscription类属于命名空间,在下文中一共展示了ISubscription类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Match

        public bool Match(IPublication publication, ISubscription subscription, EventArgs e)
        {
            var publisher = publication.Publisher as IVhptIdentificationProvider;
            var subscriber = subscription.Subscriber as IVhptIdentificationProvider;

            return publisher != null && subscriber != null && publisher.Identification.Equals(subscriber.Identification);
        }
开发者ID:bbvcommon,项目名称:Multi-Threading-Sample,代码行数:7,代码来源:VhptMatcher.cs

示例2: AddSubscription

        public void AddSubscription(ISubscription subscription)
        {
            if (subscription == null)
            {
                throw new ArgumentNullException("subscription");
            }

            try
            {
                SubscriptionLock.EnterWriteLock();

                MarkUsed();

                Subscriptions.Add(subscription);
                
                // Created -> HasSubscriptions
                Interlocked.CompareExchange(ref State,
                                            TopicState.HasSubscriptions,
                                            TopicState.NoSubscriptions);
            }
            finally
            {
                SubscriptionLock.ExitWriteLock();
            }
        }
开发者ID:BO45,项目名称:NzbDrone,代码行数:25,代码来源:Topic.cs

示例3: Accept

		public virtual IRequestResult Accept(ISubscription subscription, IMessage message) {
			var bundle = new ProcessableUnit { Subscription = subscription, Message = message };
            Accepting(bundle);
            //RealizeIdentifier(subscription);
            BundlePrototype.IsNull(() => BundlePrototype = subscription);
			return Result();
		}
开发者ID:afgbeveridge,项目名称:nhooked,代码行数:7,代码来源:BaseMessageHandler.cs

示例4: LatestProfile

 public LatestProfile( IListenedShow latestShow, IShow show, UserProfile profile, ISubscription subscription )
 {
     LatestListenedShow = latestShow;
     LatestShow = show;
     Profile = profile;
     Subscription = subscription;
 }
开发者ID:coredweller,项目名称:Listened-List,代码行数:7,代码来源:LatestProfile.cs

示例5: SaveCommit

 public void SaveCommit( ISubscription subscription, out bool success )
 {
     using ( IUnitOfWork u = UnitOfWork.Begin() ) {
         Save( subscription, out success );
         if ( success )
             u.Commit();
     }
 }
开发者ID:coredweller,项目名称:Listened-List,代码行数:8,代码来源:SubscriptionService.cs

示例6: CreateSubscription

        public void CreateSubscription()
        {
            var phoneNumber = "44556677";
            var subscriptionRegistration = ObjectFactory.GetInstance<ISubscriptionRegistration>();
            var customerRegistration = ObjectFactory.GetInstance<ICustomerRegistration>();

            subscription = SubscriptionHelper.CreateSubscriptionWithDefaultCustomer(subscriptionRegistration,customerRegistration, phoneNumber, "DK", CustomerStatus.Normal);
        }
开发者ID:ChristianTrolleMikkelsen,项目名称:AccountingEmulatorExercise,代码行数:8,代码来源:SubscriptionRepositoryTests.cs

示例7: MakeProxy

        public void MakeProxy(string EndpoindAddress, object callbackinstance)
        {
            NetTcpBinding netTcpbinding = new NetTcpBinding(SecurityMode.None);
            EndpointAddress endpointAddress = new EndpointAddress(EndpoindAddress);
            InstanceContext context = new InstanceContext(callbackinstance);        

            DuplexChannelFactory<ISubscription> channelFactory = new DuplexChannelFactory<ISubscription>(new InstanceContext(this), netTcpbinding, endpointAddress);
            _proxy  = channelFactory.CreateChannel();
        }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:9,代码来源:SubscriberForm.cs

示例8: MapSubscriptionToPlanSubscription

 public static PlanSubscription MapSubscriptionToPlanSubscription(ISubscription subscription, Func<string, Plan> lookupPlanById)
 {
     return new PlanSubscription
                {
                    Id = subscription.SubscriptionID,
                    Plan = lookupPlanById(subscription.Product.Handle),
                    Subscriber = MapCustomerToSubscriber(subscription.Customer) // in actual system probably look up db
                };
 }
开发者ID:christensena,项目名称:TDDIntro,代码行数:9,代码来源:Mapper.cs

示例9: Delete

        public void Delete( ISubscription subscription )
        {
            Checks.Argument.IsNotNull( subscription, "subscription" );

            using ( IUnitOfWork u = UnitOfWork.Begin() ) {
                _repo.Remove( subscription );
                u.Commit();
            }
        }
开发者ID:coredweller,项目名称:Listened-List,代码行数:9,代码来源:SubscriptionService.cs

示例10: Add

 public bool Add(ISubscription subscription)
 {
     var wasAdded = false;
     foreach (var resolver in resolvers)
     {
         wasAdded = resolver.Add(subscription);
         if (wasAdded) break;
     }
     return wasAdded;
 }
开发者ID:pixelmeister,项目名称:MemBus,代码行数:10,代码来源:CompositeResolver.cs

示例11: Match

        /// <summary>
        /// Returns whether the publication and subscription match and the event published by the
        /// publisher will be relayed to the subscriber.
        /// <para>
        /// This is the case if the name of the subscriber is a prefix to the name of the publisher.
        /// </para>
        /// </summary>
        /// <param name="publication">The publication.</param>
        /// <param name="subscription">The subscription.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <returns><code>true</code> if event has to be sent to the subscriber.</returns>
        public bool Match(IPublication publication, ISubscription subscription, EventArgs e)
        {
            object publisher = publication.Publisher;
            object subscriber = subscription.Subscriber;

            string publisherName = publisher is INamedItem ? ((INamedItem)publisher).EventBrokerItemName : string.Empty;
            string subscriberName = subscriber is INamedItem ? ((INamedItem)subscriber).EventBrokerItemName : string.Empty;

            return publisherName.StartsWith(subscriberName);
        }
开发者ID:tiger2soft,项目名称:bbv.Common,代码行数:21,代码来源:SubscribeToChildren.cs

示例12: SaveSubscription

        public async Task SaveSubscription(ISubscription subscription)
        {
            Debug.Assert(_count != DEFAULT_COUNT_VALUE, "Count field is not inited, LoadSubscriptions() wasn't called before SaveSubscription()");

            var serializable = new SubscriptionDto {Uri = subscription.Uri};
            var key = string.Format(CACHE_KEY_FMT, _count);
            this.Log().Info("Inserting subscription to {0} into cache", serializable.Uri);
            await Cache.Local.InsertObject(key, serializable.Uri.OriginalString);
            _count++;
        }
开发者ID:journeyman,项目名称:PodcastReader,代码行数:10,代码来源:SubscriptionsCache.cs

示例13: SubscriptionDetails

 public SubscriptionDetails(ISubscription s )
 {
     Id = s.Id;
     Label = s.Label;
     Created = s.Created;
     IsActive = s.IsActive;
     CurrentStoreCount = s.StoreCount;
     StoreLimit = s.StoreCountLimit;
     StoreSizeLimit = s.StoreSizeLimit;
     TotalSizeLimit = s.TotalSizeLimit;
     IsTrial = s.IsTrial;
     Stores = s.Stores.Select(store => new StoreDetail(store)).ToList();
 }
开发者ID:Garwin4j,项目名称:BrightstarDB,代码行数:13,代码来源:SubscriptionDetails.cs

示例14: Initialize

 public void Initialize(IModelContext model)
 {
     _clientUnit = model.Clients.HandleRemoveChanges(removed: client =>
     {
         if (_clients.ContainsKey(client))
         {
             _clients[client].StopListen();
             _clients.Remove(client);
         }
     });
     _interlocutorUnit = model.Interlocutors.HandleRemoveChanges(removed: interlocutor =>
     {
         if (_interlocutors.ContainsKey(interlocutor))
         {
             _interlocutors[interlocutor].StopListen();
             _interlocutors.Remove(interlocutor);
         }
     });
     _roomUnit = model.Rooms.HandleRemoveChanges(removed: room =>
     {
         if (_rooms.ContainsKey(room))
         {
             _rooms[room].StopListen();
             _rooms.Remove(room);
         }
     });
 }
开发者ID:Irdis,项目名称:VSTalk,代码行数:27,代码来源:SessionModel.cs

示例15: LiveFeedsHub

        public LiveFeedsHub()
        {
            var eventActivity = new EventActivity(
                new ActivitySettings(ActivityDrilldown.Second));

            subscription = eventActivity.CreateSubscription(
                "order:placed",
                OnDataReceive);
        }
开发者ID:jesusgarza,项目名称:MinutemanDotNet,代码行数:9,代码来源:LiveFeedsHub.cs


注:本文中的ISubscription类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。