当前位置: 首页>>代码示例>>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;未经允许,请勿转载。