public Resource this[String id] { get { Resource r = _resources.Where(x => x.Id == id).First(); if (r != null) { if (!r.Exists) { GetResource(r); } } else { r = new Resource() { Id = id }; } return r; } set { Resource r = _resources.Where(x => x.Id == id).First(); if (r == null) { _resources.Add(value); } else { _resources[_resources.IndexOf(r)] = value; } } }
private void GetResource(Resource r) { //Load object if (!r.Exists) { //Downloader d = new Downloader(r.Path, _rootFolder); } }