async Task ExecuteLoadItemsCommand() { if (IsBusy) { return; } IsBusy = true; try { Reflections.Clear(); var items = await ReflectionStore.GetItemsAsync("api/reflections", true); if (items != null && items.Count() > 0) { foreach (var item in items) { item.Image = AppConstant.BaseUrl + item.Image; item.Content = String.Join(" ", item.Content.Split(' ')) + "..."; Reflections.Add(item); } } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
public static ReflectedInfo For(Type T) { lock (Reflections) { if (Reflections.ContainsKey(T)) { return(Reflections[T]); } var newInfo = new ReflectedInfo(T); Reflections.Add(T, newInfo); return(newInfo); } }
public virtual void ReadChildData(BinaryReader reader) { int x = 0; _bitmap.ReadString(reader); for (x = 0; (x < _reflections.Count); x = (x + 1)) { Reflections.Add(new LensFlareReflectionBlock()); Reflections[x].Read(reader); } for (x = 0; (x < _reflections.Count); x = (x + 1)) { Reflections[x].ReadChildData(reader); } }
public virtual void ReadChildData(BinaryReader reader) { int x = 0; _bitmap.ReadString(reader); for (x = 0; (x < _reflections.Count); x = (x + 1)) { Reflections.Add(new LensFlareReflectionBlockBlock()); Reflections[x].Read(reader); } for (x = 0; (x < _reflections.Count); x = (x + 1)) { Reflections[x].ReadChildData(reader); } for (x = 0; (x < _brightness.Count); x = (x + 1)) { Brightness.Add(new LensFlareScalarAnimationBlockBlock()); Brightness[x].Read(reader); } for (x = 0; (x < _brightness.Count); x = (x + 1)) { Brightness[x].ReadChildData(reader); } for (x = 0; (x < _color.Count); x = (x + 1)) { Color.Add(new LensFlareColorAnimationBlockBlock()); Color[x].Read(reader); } for (x = 0; (x < _color.Count); x = (x + 1)) { Color[x].ReadChildData(reader); } for (x = 0; (x < _rotation.Count); x = (x + 1)) { Rotation.Add(new LensFlareScalarAnimationBlockBlock()); Rotation[x].Read(reader); } for (x = 0; (x < _rotation.Count); x = (x + 1)) { Rotation[x].ReadChildData(reader); } }
void ExecuteLoadItemsCommand(int id) { if (IsBusy) { return; } IsBusy = true; try { Reflections.Clear(); var items = ReflectionsFromParent; if (items != null && items.Count() > 0) { var firstItem = items.Where(n => n.Id == id).FirstOrDefault(); Title = firstItem.Title; MainTitle = firstItem.Title; Content = firstItem.Content; Image = firstItem.Image; RelatedNews = "Other Reflections"; foreach (var item in items.Where(n => n.Id != id)) { item.Image = item.Image; item.Content = String.Join(" ", firstItem.Content.Split(' ')) + "..."; Reflections.Add(item); } } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }