本文整理汇总了C#中ISubscription类的典型用法代码示例。如果您正苦于以下问题:C# ISubscription类的具体用法?C# ISubscription怎么用?C# ISubscription使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISubscription类属于命名空间,在下文中一共展示了ISubscription类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: 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)
{
Ensure.ArgumentNotNull(publication, "publication");
Ensure.ArgumentNotNull(subscription, "subscription");
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, StringComparison.Ordinal);
}
开发者ID:hmuralt,项目名称:appccelerate,代码行数:24,代码来源:SubscribeToChildren.cs
示例15: EventActivityHub
public EventActivityHub(
ISubscription<EventActivitySubscriptionInfo> subscription,
Func<Task<IEnumerable<string>>> getEventNames,
Func<string, Task<IEnumerable<ActivityTimeframe>>> getTimeframes)
: base(getEventNames, getTimeframes)
{
if (subscription == null)
{
throw new ArgumentNullException("subscription");
}
this.subscription = subscription;
}
开发者ID:kazimanzurrashid,项目名称:MinutemanDotNet,代码行数:13,代码来源:EventActivityHub.cs
示例16: WhiteListForecastWorker
public WhiteListForecastWorker(
ISubscription[] subscriptions,
IDeployment deployment,
IOperation operation,
WhiteListService[] allowedServices,
int pollingIntervalInMinutes)
: base(GetWorkerId(typeof(WhiteListForecastWorker).FullName))
{
this.subscriptions = subscriptions;
this.deployment = deployment;
this.operation = operation;
this.allowedServices = allowedServices;
this.pollingIntervalInMinutes = pollingIntervalInMinutes;
}
开发者ID:StealFocus,项目名称:Forecast,代码行数:14,代码来源:WhiteListForecastWorker.cs
示例17: Save
public void Save( ISubscription subscription, out bool success )
{
Checks.Argument.IsNotNull( subscription, "subscription" );
success = false;
if ( null == _repo.FindById( subscription.Id ) ) {
try {
_repo.Add( subscription );
success = true;
}
catch ( Exception ex ) {
success = false;
}
}
}
开发者ID:coredweller,项目名称:Listened-List,代码行数:16,代码来源:SubscriptionService.cs
示例18: RemoveSubscription
public void RemoveSubscription(ISubscription subscription)
{
try
{
SubscriptionLock.EnterWriteLock();
if (_subcriptionIdentities.Remove(subscription.Identity))
{
Subscriptions.Remove(subscription);
}
}
finally
{
SubscriptionLock.ExitWriteLock();
}
}
开发者ID:ntcnet83,项目名称:SignalR,代码行数:16,代码来源:Topic.cs
示例19: ScheduleWork
private void ScheduleWork(ISubscription subscription)
{
var workContext = new WorkContext(subscription, this);
ThreadPool.QueueUserWorkItem(state =>
{
var context = (WorkContext)state;
context.Broker._counters.MessageBusAllocatedWorkers.Increment();
DoWork(context);
context.Broker._counters.MessageBusAllocatedWorkers.Decrement();
},
workContext);
}
开发者ID:leloulight,项目名称:SignalR-Server,代码行数:16,代码来源:MessageBroker.cs
示例20: MapSubscription
public static PlanSubscription MapSubscription(ISubscription chargifySubscription)
{
return new PlanSubscription
{
ChargifySubscriptionID = chargifySubscription.SubscriptionID,
Plan = MapProductToPlan(chargifySubscription.Product),
Account = MapCustomerToAccount(chargifySubscription.Customer),
ActivatedAt = chargifySubscription.ActivatedAt.ToUniversalTime(),
NextAssessmentAt = chargifySubscription.NextAssessmentAt.ToUniversalTime(),
CurrentPeriodStartedAt = chargifySubscription.CurrentPeriodStartedAt.ToUniversalTime(),
CurrentPeriodEndsAt = chargifySubscription.CurrentPeriodEndsAt.ToUniversalTime(),
ExpiresAt = chargifySubscription.ExpiresAt.ToUniversalTime(),
TrialStartedAt = chargifySubscription.TrialStartedAt.ToUniversalTime(),
TrialEndedAt = chargifySubscription.TrialEndedAt.ToUniversalTime(),
State = MapChargifySubscriptionState(chargifySubscription.State.ToString())
};
}
开发者ID:christensena,项目名称:TDDIntro,代码行数:17,代码来源:Mapper.cs
注:本文中的ISubscription类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论