public async Task Save()
        {
            IsBusy = true;
            await WODStore.AddItemAsync(new WOD()
            {
                Date = DT, Exercises = Exs.ToList(), Calories = 3200
            });

            IsBusy = false;
        }
Esempio n. 2
0
        public override string ToString()
        {
            switch (Type)
            {
            case PropertyType.Null:                 return("null");

            case PropertyType.Calculated:           return("calculated");

            case PropertyType.Bool:                 return(Bool.ToString());

            case PropertyType.String:               return("string: " + StringHandle.ToString());

            case PropertyType.MultiValue:           return("multi: " + MultiValueHandle.ToString());

            case PropertyType.Enum:                 return("enum: " + Enum.ToString());

            case PropertyType.Color:                return("color: " + Color.ToString());

            case PropertyType.Integer:              return(Integer.ToString() + " (integer)");

            case PropertyType.Fractional:           return(Fractional.ToString() + " (fractional)");

            case PropertyType.Percentage:           return(Percentage.ToString() + "%");

            case PropertyType.AbsLength:            return(Points.ToString() + "pt (" + Inches.ToString() + "in, " + Millimeters.ToString() + "mm) (abs)");

            case PropertyType.RelLength:            return(Points.ToString() + "pt (" + Inches.ToString() + "in, " + Millimeters.ToString() + "mm) (rel)");

            case PropertyType.HtmlFontUnits:        return(HtmlFontUnits.ToString() + " (html font units)");

            case PropertyType.RelHtmlFontUnits:     return(RelativeHtmlFontUnits.ToString() + " (relative html font units)");

            case PropertyType.Multiple:             return(Integer.ToString() + "*");

            case PropertyType.Pixels:               return(Pixels.ToString() + "px");

            case PropertyType.Ems:                  return(Ems.ToString() + "em");

            case PropertyType.Exs:                  return(Exs.ToString() + "ex");

            case PropertyType.Milliseconds:         return(Milliseconds.ToString() + "ms");

            case PropertyType.kHz:                  return(kHz.ToString() + "kHz");

            case PropertyType.Degrees:              return(Degrees.ToString() + "deg");
            }

            return("unknown value type");
        }
        public async Task DwnOWD()
        {
            IsBusy = true;
            WODS.Clear();
            Exs.Clear();
            SSP = false;

            try
            {
                var t = (await WODStore.GetItemsAsync(true)).GetEnumerator();
                if (t != null)
                {
                    while (t.MoveNext())
                    {
                        if (t.Current.Date < DateTime.Now)
                        {
                            WODS.Add(t.Current);
                        }
                        else
                        {
                            upWOD = t.Current;
                            SSP   = true;
                        }
                    }
                }

                if (upWOD != null)
                {
                    if (upWOD.Exercises != null)
                    {
                        foreach (var ite in upWOD.Exercises)
                        {
                            Exs.Add(ite);
                        }
                    }

                    Ca = upWOD.Calories;
                    Dt = upWOD.Date;
                }
            }
            catch (Exception e)
            {
            }
            finally
            {
                IsBusy = false;
            }
        }