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


C# IService.GetFeature方法代码示例

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


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

示例1: TimerEvent

        private void TimerEvent(IService theService)
        {
            if (FixtureController.IsAddingItems)
                return;

            try
            {
                FixtureController.BeginAddingItems();
                Parallel.ForEach(_sportsList, new ParallelOptions { MaxDegreeOfParallelism = 10 },
                                 sport =>
                                 {
                                     var theFeature = theService.GetFeature(sport);
                                     if (theFeature != null)
                                     {
                                         _logger.InfoFormat("Get the list of available fixtures for {0} from GTP", sport);
                                         var fixtures = theFeature.GetResources();

                                         if (fixtures != null && fixtures.Count > 0)
                                         {
                                             var tmpSport = sport;
                                             Parallel.ForEach(fixtures, new ParallelOptions { MaxDegreeOfParallelism = 10 },
                                                                 fixture => ProcessFixture(fixture, tmpSport));
                                         }
                                         else
                                         {
                                             _logger.InfoFormat("There are currently no {0} fixtures in UDAPI", sport);
                                         }
                                     }
                                     else
                                     {
                                         _logger.InfoFormat("Cannot find {0} in UDAPI....", sport);
                                     }
                                 });
            }
            catch (AggregateException aggex)
            {
                foreach (var innerException in aggex.InnerExceptions)
                {
                    _logger.Error(innerException);
                }
            }
            catch (Exception ex)
            {
                _logger.Error(ex);
            }
            finally
            {
                FixtureController.FinishAddingItems();
            }
        }
开发者ID:sportingsolutions,项目名称:SS.Integration.UnifiedDataAPIClient.DotNet,代码行数:50,代码来源:GTPService.cs

示例2: TimerEvent

        private void TimerEvent(IService theService)
        {
            try
            {
                foreach (var sport in _sportsList)
                {
                    var theFeature = theService.GetFeature(sport);
                    if (theFeature != null)
                    {
                        _logger.InfoFormat("Get the list of available fixtures for {0} from GTP", sport);
                        var fixtures = theFeature.GetResources();

                        var fixturesDic = fixtures.ToDictionary(x => x.Id);

                        if (fixtures != null && fixtures.Count > 0)
                        {
                            var tmpSport = sport;
                            Parallel.ForEach(fixtures, new ParallelOptions { MaxDegreeOfParallelism = 10 },
                                                fixture => ProcessFixture(fixture, tmpSport));
                        }
                        else
                        {
                            _logger.InfoFormat("There are currently no {0} fixtures in UDAPI", sport);
                        }
                    }
                    else
                    {
                        _logger.InfoFormat("Cannot find {0} in UDAPI....", sport);
                    }
                }
            }
            catch (AggregateException aggex)
            {
                foreach (var innerException in aggex.InnerExceptions)
                {
                    _logger.Error(innerException);
                }
            }
            catch (Exception ex)
            {
                _logger.Error(ex);
            }
        }
开发者ID:jsztompka,项目名称:Unified_Data_API_Client_DotNet,代码行数:43,代码来源:GTPService.cs


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