Exemplo n.º 1
0
 public UseParaplyResult ShouldUseParaply(Result<IEnumerable<YrData>> yrResult)
 {
     var useParaplyResult = new UseParaplyResult();
     if(!yrResult.HasError())
     {
         var yrData = yrResult.Value.First();
         useParaplyResult.YrData = yrData;
         useParaplyResult.Result = yrData.SymbolName.Contains("regn") ? UseParaply.Yes : UseParaply.No;
         return useParaplyResult;
     }
     return useParaplyResult;
 }
Exemplo n.º 2
0
        private void SetImage(UseParaplyResult useParaply)
        {
            if(!useParaply.HasError())
            {
                StedInfoTextBlock.Text = string.Format("{0}, {1}, {2} ", _sted.Navn, useParaply.YrData.SymbolName, useParaply.YrData.GetPeriode());
            }

            switch (useParaply.Result)
            {
                case UseParaply.Unknown:
                    ParaplyImage.Source = ResourceHelper.QuestionMark();
                    break;
                case UseParaply.Yes:
                    ParaplyImage.Source = ResourceHelper.UseUmbrella();
                    break;
                case UseParaply.No:
                    ParaplyImage.Source = ResourceHelper.DontUseUmbrella();
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }