本文整理汇总了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();
}
}
示例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);
}
}