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


C# Client.GetChannels方法代码示例

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


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

示例1: GetChannel

 public Channel GetChannel(string id, Client client)
 {
     if (!cachedChannels.ContainsKey(id))
     {
         var channelList = client.GetChannels(id);
         if (channelList.Channels == null || channelList.Channels.Count == 0)
         {
             return null;
         }
         SetChannels(channelList.Channels);
     }
     return cachedChannels[id];
 }
开发者ID:jdaigle,项目名称:MirthDotNet,代码行数:13,代码来源:ChannelCache.cs

示例2: TestMessageSearch

 public static void TestMessageSearch()
 {
     var client = new Client(ClientUrl, timeout: int.MaxValue);
     try
     {
         var sw = Stopwatch.StartNew();
         var loginStatus = client.Login(ClientUsername, ClientPassword, "0.0.0");
         var channel = client.GetChannels("d24f9ca7-d696-4ffd-b86e-484669213fa8").Channels[0];
         Console.WriteLine("Loaded Channel [{0}] in {1}ms ", channel.Name, sw.Elapsed.TotalMilliseconds.ToString("N2"));
         Console.WriteLine("Found {0} metadata columns: {1}", channel.Properties.MetaDataColumns.Items.Count, string.Join(",", channel.Properties.MetaDataColumns.Items.Select(x => x.Name).ToArray()));
         sw.Restart();
         var maxMessageId = client.GetMaxMessageId(channel.Id);
         var filter = new MessageFilter()
         {
             MaxMessageId = maxMessageId,
             //Statuses = new List<string>() { "ERROR" },
             //EndDate = DateTime.Now.Date.AddDays(-7),
             MetaDataSearch = new List<MetaDataSearchCriteria>
             {
                 new MetaDataSearchCriteria
                 {
                     ColumnName = "PATIENT_ID",
                     Value = new MetaDataSearchCriteriaValue("00556249"),
                     Operator = MetaDataSearchOperator.STARTS_WITH,
                     IgnoreCase = "true",
                 },
             },
             MinMessageId = 896930,
         };
         var messageCount = client.GetMessageCount(channel.Id, filter);
         Console.WriteLine("Counted {0} messages in {1}ms", messageCount, sw.Elapsed.TotalMilliseconds.ToString("N2"));
         sw.Restart();
         var messages_nocontent = client.GetMessages(channel.Id, filter, false, 0, 51);
         Console.WriteLine("Loaded {0} messages in {1}ms", messages_nocontent.Messages.Count, sw.Elapsed.TotalMilliseconds.ToString("N2"));
         var messages_rows = messages_nocontent.Messages.SelectMany(x => x.AsFlatMessageRows()).ToArray();
     }
     finally
     {
         client.Logout();
     }
 }
开发者ID:jdaigle,项目名称:MirthDotNet,代码行数:41,代码来源:Program.cs

示例3: RefreshAll

 public void RefreshAll(Client client)
 {
     SetChannels(client.GetChannels().Channels);
 }
开发者ID:jdaigle,项目名称:MirthDotNet,代码行数:4,代码来源:ChannelCache.cs

示例4: PurgeERRORMessages

        public static void PurgeERRORMessages()
        {
            var client = new Client(ClientUrl, timeout: int.MaxValue);
            var loginStatus = client.Login(ClientUsername, ClientPassword, "0.0.0");
            var channelSummaryList = client.GetChannelSummary();

            Console.WriteLine("Found " + channelSummaryList.Channels.Count + " channels...");
            for (int i = 0; i < channelSummaryList.Channels.Count; i++)
            {
                try
                {
                    var channelId = channelSummaryList.Channels[i].GetChannelId();
                    Console.Write((i) + " ");
                    var maxMessageId = client.GetMaxMessageId(channelId);
                    if (maxMessageId == 0)
                    {
                        Console.WriteLine();
                        continue;
                    }
                    var filter = new MessageFilter()
                    {
                        MaxMessageId = maxMessageId,
                        Statuses = new List<string>() { "ERROR" },
                        EndDate = DateTime.Now.Date.AddDays(-7),
                    };
                    var messageCount = client.GetMessageCount(channelId, filter);
                    var channel = client.GetChannels(channelId).Channels.Single();
                    Console.Write("Found " + messageCount + " messages for " + channel.Name + "...");
                    if (messageCount == 0)
                    {
                        Console.WriteLine();
                        continue;
                    }
                    var sw = Stopwatch.StartNew();
                    client.RemoveMessages(channelId, filter);
                    sw.Stop();
                    Console.WriteLine(" Deleted in " + sw.Elapsed.TotalSeconds.ToString("N2") + " sec.");
                }
                catch (Exception e)
                {
                    Console.Write(" ERROR: " + e.Message);
                }
            }

            client.Logout();
        }
开发者ID:jdaigle,项目名称:MirthDotNet,代码行数:46,代码来源:Program.cs

示例5: FindFailedToDeployConnectors

 public static void FindFailedToDeployConnectors()
 {
     var client = new Client(ClientUrl, timeout: int.MaxValue);
     var loginStatus = client.Login(ClientUsername, ClientPassword, "0.0.0");
     var channelStatusList = client.GetChannelStatusList().DashboardStatuses;
     foreach (var item in channelStatusList.OrderBy(x => x.Name))
     {
         Console.Write("{0} deployed with {1} connectors. ", item.Name.MaxOrPad(30), item.ChildStatuses.DashboardStatuses.Count);
         var channelId = item.ChannelId;
         var channel = client.GetChannels(channelId).Channels.Single();
         var connectors = channel.GetAllEnabledConnectors();
         if (connectors.Count != item.ChildStatuses.DashboardStatuses.Count)
         {
             Console.Write("WARNING: Found {0} configured connectors!", connectors.Count);
             Console.Error.Write("WARNING: Found {0} configured connectors!", connectors.Count);
         }
         Console.WriteLine();
     }
     client.Logout();
 }
开发者ID:jdaigle,项目名称:MirthDotNet,代码行数:20,代码来源:Program.cs

示例6: ListChannels

        public static void ListChannels()
        {
            var client = new Client(ClientUrl, timeout: int.MaxValue);
            var loginStatus = client.Login(ClientUsername, ClientPassword, "0.0.0");
            var channelSummaryList = client.GetChannelSummary();

            Console.WriteLine("Found " + channelSummaryList.Channels.Count + " channels...");
            Console.WriteLine("Index^Channel Name^Description^Max Message Id^Revision^Enabled^Channel Id");
            for (int i = 0; i < channelSummaryList.Channels.Count; i++)
            {
                try
                {
                    var channelId = channelSummaryList.Channels[i].GetChannelId();
                    var maxMessageId = client.GetMaxMessageId(channelId);
                    var channel = client.GetChannels(channelId).Channels.Single();
                    Console.WriteLine(string.Format(@"{0}^{1}^{2}^{3}^{4}^{5}^{6}", i, channel.Name, channel.Description.Replace("\n", " "), maxMessageId, channel.Revision, channel.Enabled, channelId));
                }
                catch (Exception e)
                {
                    Console.WriteLine(" ERROR: " + e.Message);
                }
            }

            client.Logout();
        }
开发者ID:jdaigle,项目名称:MirthDotNet,代码行数:25,代码来源:Program.cs


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