public static string GetDisplayText(this TrainingPlanSerie serie)
        {
            string dropSetString = "";
            string repType       = "";
            string superSlow     = "";
            string restPause     = "";

            if (serie.IsSuperSlow)
            {
                superSlow = " SS";
            }
            if (serie.IsRestPause)
            {
                restPause = " RP";
            }
            if (serie.DropSet != DropSetType.None)
            {
                dropSetString = "^" + (int)serie.DropSet;
            }
            if (serie.RepetitionsType != SetType.Normalna)
            {
                repType = EnumLocalizer.Default.Translate(serie.RepetitionsType);
            }
            string format = serie.ToStringRepetitionsRange();

            return(string.Format("{0} {1}{2}{3}{4}", format, repType, dropSetString, superSlow, restPause));
        }
Beispiel #2
0
        //public static void LoadContent(this TrainingPlanInfo plan, bool force = false)
        //{
        //    if(plan.Tag==null || force)
        //    {
        //        var newPlan = ServiceManager.GetTrainingPlan(plan.GlobalId);
        //        plan.Author = newPlan.Author;
        //        //plan.DaysCount = newPlan.DaysCount;
        //        plan.Difficult = newPlan.Difficult;
        //        plan.Language = newPlan.Language;
        //        plan.PublishDate = newPlan.PublishDate;
        //        plan.Status = newPlan.Status;
        //        plan.Rating = newPlan.Rating;
        //        plan.UserRating = newPlan.UserRating;
        //        plan.UserShortComment = newPlan.UserShortComment;
        //        plan.Purpose = newPlan.Purpose;
        //        plan.Tag = newPlan;
        //        plan.TrainingType = newPlan.TrainingType;
        //        plan.Version = newPlan.Version;
        //    }
        //}

        public static string GetDisplayText(this TrainingPlanSerie serie, bool isCardio)
        {
            string dropSetString = "";
            string repType       = "";
            string superSlow     = "";
            string restPause     = "";

            if (isCardio)
            {
                decimal seconds = serie.RepetitionNumberMin.HasValue ? serie.RepetitionNumberMin.Value : 0;
                var     time    = TimeSpan.FromSeconds((double)seconds);
                return(time.ToString());
            }
            if (serie.DropSet != DropSetType.None)
            {
                dropSetString = "^" + (int)serie.DropSet;
            }
            if (serie.RepetitionsType != SetType.Normalna)
            {
                var localier = new EnumLocalizer(StrengthTrainingEntryStrings.ResourceManager);
                repType = localier.Translate(serie.RepetitionsType);
            }
            if (serie.IsSuperSlow)
            {
                superSlow = " SS";
            }
            if (serie.IsRestPause)
            {
                restPause = " RP";
            }
            string format = serie.ToStringRepetitionsRange();

            return(string.Format("{0} {1}{2}{3}{4}", format, repType, dropSetString, superSlow, restPause).Trim());
        }
Beispiel #3
0
        public void Fill(TrainingPlanSerie set)
        {
            this.set = set;
            if (set != null)
            {
                cmbRepetitionsType.SelectedIndex = (int)set.RepetitionsType;
                cmbDropSet.SelectedIndex         = (int)set.DropSet;
                txtRepetitionsRange.EditValue    = set.ToStringRepetitionsRange();

                if (set.Comment != null)
                {
                    set.Comment = set.Comment.Replace("\n", "\r\n");
                }
                txtComment.Text = set.Comment;
            }
        }
        public static string GetDisplayText(this TrainingPlanSerie serie)
        {
            string dropSetString = "";
            string repType       = "";

            if (serie.DropSet != DropSetType.None)
            {
                dropSetString = "^" + (int)serie.DropSet;
            }
            if (serie.RepetitionsType != TrainingPlanSerieRepetitions.Normalna)
            {
                var localier = new EnumLocalizer(LocalizedPropertyGridStrings.ResourceManager);
                repType = localier.Translate(serie.RepetitionsType);
            }
            string format = serie.ToStringRepetitionsRange();

            return(string.Format("{0} {1}{2}", format, repType, dropSetString));
        }