本文整理汇总了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);
}
示例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();
}
}
示例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();
}
示例4: LatestProfile
public LatestProfile( IListenedShow latestShow, IShow show, UserProfile profile, ISubscription subscription )
{
LatestListenedShow = latestShow;
LatestShow = show;
Profile = profile;
Subscription = subscription;
}
示例5: SaveCommit
public void SaveCommit( ISubscription subscription, out bool success )
{
using ( IUnitOfWork u = UnitOfWork.Begin() ) {
Save( subscription, out success );
if ( success )
u.Commit();
}
}
示例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();
}
示例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
};
}
示例9: Delete
public void Delete( ISubscription subscription )
{
Checks.Argument.IsNotNull( subscription, "subscription" );
using ( IUnitOfWork u = UnitOfWork.Begin() ) {
_repo.Remove( subscription );
u.Commit();
}
}
示例10: Add
public bool Add(ISubscription subscription)
{
var wasAdded = false;
foreach (var resolver in resolvers)
{
wasAdded = resolver.Add(subscription);
if (wasAdded) break;
}
return wasAdded;
}
示例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);
}
示例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++;
}
示例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();
}
示例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);
}
});
}
示例15: LiveFeedsHub
public LiveFeedsHub()
{
var eventActivity = new EventActivity(
new ActivitySettings(ActivityDrilldown.Second));
subscription = eventActivity.CreateSubscription(
"order:placed",
OnDataReceive);
}