public static void FillResources(SchedulerStorage storage, int maxCount) { ResourceStorage resources = storage.ResourceStorage; storage.BeginUpdate(); try { resources.Clear(); int count = Math.Min(maxCount, ResourceList.Count); for (int i = 0; i < count; i++) { string caption = string.Empty; if (ResourceList.TryGetValue(i, out caption)) { if (string.IsNullOrEmpty(caption)) { continue; } Resource resource = storage.CreateResource(i); resource.Caption = caption; resources.Add(resource); } } } finally { storage.EndUpdate(); } }
public static void FillResources(SchedulerStorage storage, int count) { ResourceStorage resources = storage.ResourceStorage; storage.BeginUpdate(); try { int cnt = Math.Min(count, Users.Length); for (int i = 1; i <= cnt; i++) { Resource res = resources.CreateResource(Usernames[i - 1]); res.Caption = Users[i - 1]; resources.Add(res); } } finally { storage.EndUpdate(); } }