本文整理汇总了C#中ResourceType.ToEnumerable方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceType.ToEnumerable方法的具体用法?C# ResourceType.ToEnumerable怎么用?C# ResourceType.ToEnumerable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResourceType
的用法示例。
在下文中一共展示了ResourceType.ToEnumerable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewModel
public ViewModel()
{
this.resources = GenerateResources();
this.Appointments = new ObservableCollection<Appointment>();
IResourceType resourceType = new ResourceType("Room");
resourceType.Resources.AddRange(this.resources);
this.resourceTypes = resourceType.ToEnumerable().ToList();
this.PreviousResources = new DelegateCommand(GetPreviousResources);
this.NextResources = new DelegateCommand(GetNextResources);
this.resourcesIndex = 0;
this.ResourcesPerPage = 10;
}
示例2: GetResources
private IEnumerable<IResourceType> GetResources()
{
if (this.resourcesIndex < 0) this.resourcesIndex = 0;
int startIndex = this.resourcesIndex;
int endIndex = startIndex + this.ResourcesPerPage;
if (endIndex > this.resourceTypes.First().Resources.Count)
{
endIndex = this.resourceTypes.First().Resources.Count;
}
List<Resource> resources = new List<Resource>();
for (int i = startIndex; i < endIndex; i++)
{
var resource = (Resource)this.resourceTypes.First().Resources[i];
resources.Add(resource);
}
IResourceType resourceType = new ResourceType("Room");
resourceType.Resources.AddRange(resources);
IEnumerable<IResourceType> result = resourceType.ToEnumerable();
return result;
}