本文整理汇总了C#中NamespaceManager.DeleteSubscription方法的典型用法代码示例。如果您正苦于以下问题:C# NamespaceManager.DeleteSubscription方法的具体用法?C# NamespaceManager.DeleteSubscription怎么用?C# NamespaceManager.DeleteSubscription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NamespaceManager
的用法示例。
在下文中一共展示了NamespaceManager.DeleteSubscription方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTopicsAndSubscriptions
static void CreateTopicsAndSubscriptions(NamespaceManager namespaceManager)
{
// Create a topic and 3 subscriptions.
topicDescription = namespaceManager.CreateTopic(Conts.TopicName);
try
{
namespaceManager.DeleteSubscription(topicDescription.Path, Conts.SubAllMessages);
}
catch { }
try
{
namespaceManager.DeleteSubscription(topicDescription.Path, Conts.SubHolding);
}
catch { }
try
{
namespaceManager.DeleteSubscription(topicDescription.Path, Conts.YoungHorses);
}
catch { }
try
{
namespaceManager.DeleteSubscription(topicDescription.Path, Conts.OldHorses);
}
catch { }
namespaceManager.CreateSubscription(topicDescription.Path, Conts.SubAllMessages, new TrueFilter());
namespaceManager.CreateSubscription(topicDescription.Path, Conts.SubHolding, new FalseFilter());
//namespaceManager.CreateSubscription(topicDescription.Path, Conts.YoungHorses, new TrueFilter());
//namespaceManager.CreateSubscription(topicDescription.Path, Conts.OldHorses, new TrueFilter());
namespaceManager.CreateSubscription(topicDescription.Path, Conts.YoungHorses, new SqlFilter("HorseId > 5"));
namespaceManager.CreateSubscription(topicDescription.Path, Conts.OldHorses, new SqlFilter("HorseId <= 5"));
}