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


C# NamespaceManager.DeleteQueue方法代码示例

本文整理汇总了C#中NamespaceManager.DeleteQueue方法的典型用法代码示例。如果您正苦于以下问题:C# NamespaceManager.DeleteQueue方法的具体用法?C# NamespaceManager.DeleteQueue怎么用?C# NamespaceManager.DeleteQueue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NamespaceManager的用法示例。


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

示例1: DeleteQueue

        private static void DeleteQueue(NamespaceManager namespaceManager)
        {
            Console.WriteLine("\nRemoving Queue '{0}'...", queueName);

            // Delete if exists
            if (namespaceManager.QueueExists(queueName))
            {
                namespaceManager.DeleteQueue(queueName);
            }
        }
开发者ID:Srinivasanks23,项目名称:ServiceBusSandbox,代码行数:10,代码来源:program.cs

示例2: Main

 static void Main(string[] args)
 {
     GetUserCredentials();
     TokenProvider credentials = null;
     Uri serviceUri = null;
     CreateTokenProviderAndServiceUri(out credentials, out serviceUri);
     MessagingFactory factory = null;
     try
     {
         NamespaceManager namespaceClient = new NamespaceManager(serviceUri, credentials);
         if (namespaceClient == null)
         {
             Console.WriteLine("\nUnexpected Error: NamespaceManager is NULL");
             return;
         }
         Console.WriteLine("\nCreating Queue '{0}'...", QueueName);
         //Eliminar se a queue já existir
         if (namespaceClient.QueueExists(QueueName))
             namespaceClient.DeleteQueue(QueueName);
         namespaceClient.CreateQueue(QueueName);
         QueueClient myQueueClient = CreateQueueClient(serviceUri, credentials, out factory);
         List<BrokeredMessage> messageList = new List<BrokeredMessage>();
         messageList.Add(CreateIssueMessage("1", "First message "));
         messageList.Add(CreateIssueMessage("2", "Second message "));
         messageList.Add(CreateIssueMessage("3", "Third message "));
         SendListOfMessages(messageList, myQueueClient);
     }
     catch (Exception e)
     {
         Console.WriteLine("Unexpected exception {0}", e.ToString());
         throw;
     }
     finally
     {
         if (factory != null)
             factory.Close();
     }
 }
开发者ID:sandrapatfer,项目名称:PROMPT11-10-CloudComputing.sandrapatfer,代码行数:38,代码来源:Program.cs

示例3: RemoveAllExistingNamespaceElements

        /// <summary>
        ///     Danger! Danger, Will Robinson!
        /// </summary>
        private static void RemoveAllExistingNamespaceElements(NamespaceManager namespaceManager)
        {
            var tasks = new List<Task>();

            var queuePaths = namespaceManager.GetQueues().Select(q => q.Path).ToArray();
            queuePaths
                .Do(queuePath => tasks.Add(Task.Run(() => namespaceManager.DeleteQueue(queuePath))))
                .Done();

            var topicPaths = namespaceManager.GetTopics().Select(t => t.Path).ToArray();
            topicPaths
                .Do(topicPath => tasks.Add(Task.Run(() => namespaceManager.DeleteTopic(topicPath))))
                .Done();

            tasks.WaitAll();
        }
开发者ID:nblumhardt,项目名称:Nimbus,代码行数:19,代码来源:BusBuilder.cs

示例4: Main

        static void Main(string[] args)
        {
            try
            {
                if (args.Count() != 0)
                {

                    if (args[0].ToLower().CompareTo("createqueue") == 0)
                    {
                        // No processing to occur other than creating the queue.
                        namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
                        namespaceManager.CreateQueue(queueName);
                        Console.WriteLine("Queue named {0} was created.", queueName);
                        Environment.Exit(0);
                    }

                    if (args[0].ToLower().CompareTo("deletequeue") == 0)
                    {
                        // No processing to occur other than deleting the queue.
                        namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
                        namespaceManager.DeleteQueue(queueName);
                        Console.WriteLine("Queue named {0} was deleted.", queueName);
                        Environment.Exit(0);
                    }
                }
                //queueClient = QueueClient.CreateFromConnectionString(connectionString, queueName);
                Run(305);
                Console.WriteLine("Final solution found!");
                //queueClient.Send(new BrokeredMessage("Complete"));

                //queueClient.Close();
                //Environment.Exit(0);
            }
            catch (ServerBusyException serverBusyException)
            {
                Console.WriteLine("ServerBusyException encountered");
                Console.WriteLine(serverBusyException.Message);
                Console.WriteLine(serverBusyException.StackTrace);
                if(streamWriter!=null)
                {
                    streamWriter.WriteLine(serverBusyException.Message);
                    streamWriter.WriteLine(serverBusyException.StackTrace);
                    streamWriter.Close();
                }
                int fileCount = GetFileCountFromDir(@"output/")+10;
                Run(fileCount);
                //Environment.Exit(-1);
            }
            catch (ServerErrorException serverErrorException)
            {
                Console.WriteLine("ServerErrorException encountered");
                Console.WriteLine(serverErrorException.Message);
                Console.WriteLine(serverErrorException.StackTrace);
                if (streamWriter != null)
                {
                    streamWriter.WriteLine(serverErrorException.Message);
                    streamWriter.WriteLine(serverErrorException.StackTrace);
                    streamWriter.Close();
                }
                int fileCount = GetFileCountFromDir(@"output/")+10;
                Run(fileCount);
                //Environment.Exit(-1);
            }
            catch (Exception exception)
            {
                Console.WriteLine("Exception encountered");
                Console.WriteLine(exception.Message);
                Console.WriteLine(exception.StackTrace);
                if (streamWriter != null)
                {
                    streamWriter.WriteLine(exception.Message);
                    streamWriter.WriteLine(exception.StackTrace);
                    streamWriter.Close();
                }
                int fileCount = GetFileCountFromDir(@"output/")+10;
                Run(fileCount);
                //Environment.Exit(-1);
            }
        }
开发者ID:siszoey,项目名称:getPoisFromWeibo,代码行数:79,代码来源:Program.cs

示例5: DeleteQueue

        //Helpers
        static void DeleteQueue(Uri baseAddress,string queueName,TokenProvider credentials)
        {
            if(baseAddress.AbsoluteUri.EndsWith("/") == false)
             {
            baseAddress = new Uri(baseAddress.AbsoluteUri + "/");
             }
             Debug.Assert(baseAddress.Scheme == "sb");

             if(QueueExists(baseAddress,queueName,credentials))
             {
            NamespaceManager namespaceClient = new NamespaceManager(baseAddress,credentials);
            namespaceClient.DeleteQueue(queueName);
             }
        }
开发者ID:JMnITup,项目名称:SMEX,代码行数:15,代码来源:ServiceBusHelper+-+Queues.cs

示例6: RemoveAllExistingNamespaceElements

        /// <summary>
        ///     Danger! Danger, Will Robinson!
        /// </summary>
        private static void RemoveAllExistingNamespaceElements(NamespaceManager namespaceManager, ILogger logger)
        {
            logger.Debug("Removing all existing namespace elements. IMPORTANT: This should only be done in your regression test suites.");

            var tasks = new List<Task>();
            var queuePaths = namespaceManager.GetQueues().Select(q => q.Path).ToArray();
            queuePaths
                .Do(queuePath => tasks.Add(Task.Run(() => namespaceManager.DeleteQueue(queuePath))))
                .Done();

            var topicPaths = namespaceManager.GetTopics().Select(t => t.Path).ToArray();
            topicPaths
                .Do(topicPath => tasks.Add(Task.Run(() => namespaceManager.DeleteTopic(topicPath))))
                .Done();

            tasks.WaitAll();
        }
开发者ID:nhuhuynh,项目名称:Nimbus,代码行数:20,代码来源:BusBuilder.cs


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