當前位置: 首頁>>代碼示例>>C#>>正文


C# CloudQueueClient.ListQueues方法代碼示例

本文整理匯總了C#中Microsoft.WindowsAzure.Storage.Queue.CloudQueueClient.ListQueues方法的典型用法代碼示例。如果您正苦於以下問題:C# CloudQueueClient.ListQueues方法的具體用法?C# CloudQueueClient.ListQueues怎麽用?C# CloudQueueClient.ListQueues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Microsoft.WindowsAzure.Storage.Queue.CloudQueueClient的用法示例。


在下文中一共展示了CloudQueueClient.ListQueues方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateMissingQueues

    private void CreateMissingQueues(CloudQueueClient cloudQueueClient)
    {
        var shards = cloudQueueClient.ListQueues()
            .Where(q => q.Name.StartsWith(queueName, StringComparison.InvariantCulture))
            .Select(q => q.Name);

        var queueNames = Enumerable.Range(0, queueCount)
            .Select(i => queueName + i)
            .Where(n => !shards.Contains(n))
            .ToList();

        foreach (var name in queueNames)
        {
            var q = cloudQueueClient.GetQueueReference(name);
            q.CreateIfNotExists();
        }
    }
開發者ID:nexbit,項目名稱:Brisebois.WindowsAzure,代碼行數:17,代碼來源:ShardedQueue.cs

示例2: LoadLeftPane


//.........這裏部分代碼省略.........
                        }
                    }
                }
                blobSection.Header = "Blob Containers (" + containers.Count().ToString() + ")";

                switch(LastItemType)
                {
                    case ItemType.BLOB_SERVICE:
                    case ItemType.BLOB_CONTAINER:
                        blobSection.IsExpanded = true;
                        break;
                    case ItemType.QUEUE_SERVICE:
                    case ItemType.QUEUE_CONTAINER:
                        queueSection.IsExpanded = true;
                        break;
                    case ItemType.TABLE_SERVICE:
                    case ItemType.TABLE_CONTAINER:
                        tableSection.IsExpanded = true;
                        break;
                    default:
                        blobSection.IsExpanded = true;
                        break;
                }


            }
            catch (Exception ex)
            {
                ShowError("Error enumering blob containers in the storage account: " + ex.Message);
            }

            try
            { 
                IEnumerable<CloudQueue> queues = queueClient.ListQueues();

                if (queues != null)
                {
                    foreach (CloudQueue queue in queues)
                    {
                        StackPanel stack = new StackPanel();
                        stack.Orientation = Orientation.Horizontal;

                        Image cloudFolderImage = new Image();
                        cloudFolderImage.Source = new BitmapImage(new Uri("pack://application:,,/Images/cloud_queue.png"));
                        cloudFolderImage.Height = 24;

                        Label label = new Label();
                        label.Content = queue.Name;

                        stack.Children.Add(cloudFolderImage);
                        stack.Children.Add(label);

                        queueSection.Items.Add(new TreeViewItem()
                        {
                            Header = stack,
                            Tag = new OutlineItem()
                            {
                                ItemType = ItemType.QUEUE_CONTAINER,
                                Container = queue.Name
                            }
                        });
                    }
                }
                queueSection.Header = "Queues (" + queues.Count().ToString() + ")";
            }
            catch (Exception ex)
開發者ID:jhasselkus,項目名稱:AzureStorageExplorer,代碼行數:67,代碼來源:StorageView.xaml.cs


注:本文中的Microsoft.WindowsAzure.Storage.Queue.CloudQueueClient.ListQueues方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。