private CardViewModel ParseOneCard(PowerLocalInfo localInfo) { var card = new CardViewModel(); ParseIntoCard(localInfo, card); return(card); }
public void UpdateViewModel(PowerLocalInfo localInfo, XmlDocument powerInfo, CardViewModel card) { card.Title = localInfo.Name; card.Subtitle = string.Format("{0} {1} {2}", _formatter.Source(powerInfo), _formatter.Kind(powerInfo), _formatter.Level(powerInfo)); card.Details = _formatter.ToBlocks(_formatter.DetailParagraphs(powerInfo)); card.Color = _formatter.ToColor(_formatter.Refresh(powerInfo)); card.UnderlyingCalculations = localInfo.Math; }
private CardViewModel ParseOneCard(PowerLocalInfo localInfo) { var card = new CardViewModel(); var powerDetails = GetOnlineInfoForPower(localInfo); var powerInfo = powerDetails.ContinueWith(t => CleanTheResponse(t.Result)); powerInfo.ContinueWith(t => UpdateViewModel(localInfo, t.Result, card)); return(card); }
public CardViewModel CreateViewModel(PowerLocalInfo localInfo, XmlDocument powerInfo) { return(new CardViewModel { Title = localInfo.Name, Subtitle = string.Format("{0} {1} {2}", _formatter.Source(powerInfo), _formatter.Kind(powerInfo), _formatter.Level(powerInfo)), Details = _formatter.ToBlocks(_formatter.DetailParagraphs(powerInfo)), Color = _formatter.ToColor(_formatter.Refresh(powerInfo)), UnderlyingCalculations = localInfo.Math }); }
public string GetOnlineInfoForPower(PowerLocalInfo localInfo) { return(_wotcService.GetPowerDetails(localInfo.PowerId)); }
public Continuation ParseIntoCard(PowerLocalInfo localInfo, CardViewModel card) { return (Start.With(() => GetOnlineInfoForPower(localInfo)).Then(s => CleanTheResponse(s)).Then( t => UpdateViewModel(localInfo, t, card))); }