private void fillNameAndType(BAGlobalObject planBase, OutputItem checkItem) { TrainingPlan plan = planBase as TrainingPlan; TrainingPlanEntry entry = planBase as TrainingPlanEntry; TrainingPlanDay day = planBase as TrainingPlanDay; TrainingPlanSerie set = planBase as TrainingPlanSerie; checkItem.Item = planBase; if (plan != null) { checkItem.Object = plan.Name; checkItem.Type = StrengthTrainingEntryStrings.TrainingPlan_Object; } else if (entry != null) { checkItem.Object = entry.Exercise != null?entry.Exercise.GetLocalizedName() : ""; checkItem.Type = StrengthTrainingEntryStrings.TrainingPlanDayEntry_Object; } if (day != null) { checkItem.Object = day.Name; checkItem.Type = StrengthTrainingEntryStrings.TrainingPlanDay_Object; } if (set != null) { checkItem.Object = set.ToString(); checkItem.Type = StrengthTrainingEntryStrings.TrainingPlanSerie_Object; } }
private void addOutputItem(BAGlobalObject obj, string message, TrainingPlanCheckItemStatus status) { OutputItem outputItem = new OutputItem(); outputItem.Icon = getIcon(status); outputItem.Message = message; fillNameAndType(obj, outputItem); lvOutput.Items.Add(outputItem); }