public DicomPlanObject(params DicomFile[] files) : base(files) { Beams = new List <Beam>(); var loader = new PlanLoader(); loader.Load(files, this); }
private async void SaveSelectedPlans(object param) { string msg = "Сохраненныё графики будут очищены", title = "Вы уверены?", butOk = "Да", butCancel = "Нет"; var res = await Application.Current.MainPage.DisplayAlert(title, msg, butOk, butCancel); if (!res) { return; } var Plans = new List <Plan>(); if (StartDate > EndDate) { await Application.Current.MainPage.DisplayAlert("Ошибка ввода", "Начальная дата не может быть больше конечной", "Ок"); return; } List <PlanTypes> filter = new List <PlanTypes>(); if (WorkDaysSelected) { filter.Add(PlanTypes.Working); } if (DaysOffSelected) { filter.Add(PlanTypes.DayOff); } if (HolidayDaysSelected) { filter.Add(PlanTypes.Holiday); } if (HospitalDaysSelected) { filter.Add(PlanTypes.Hospital); } try { Plans = await Client.GetPlans(StartDate, EndDate, filter.ToArray()); foreach (var plan in Plans) { plan.StartDay = ToShorter(plan.StartDay); plan.EndDay = ToShorter(plan.EndDay); plan.TypePlan = Globals.PlanTypes[plan.TypePlan]; } await PlanLoader.SetPlans(Plans); await Application.Current.MainPage.DisplayAlert("Все готово!", "Планы сохранены в памяти", "Ок"); } catch (Exception exc) { await FatalError(exc.Message); return; } }
public static DicomPlanObject LoadDicomPlanAsync(DicomFile dicomFile) { var loader = new PlanLoader(); var plan = new DicomPlanObject(); loader.Load(dicomFile, plan); return(plan); }
public static async Task <DicomPlanObject> LoadDicomPlanAsync(string[] fileNames) { var files = await getFilesAsync(fileNames); var loader = new PlanLoader(); var plan = new DicomPlanObject(); loader.Load(files, plan); return(plan); }
private async void OpenSaved(object param) { try { var Plans = await PlanLoader.GetPlans(); ViewPlans(this, new ViewPlansEventArgs(Plans)); } catch (Exception exc) { await FatalError(exc.Message); return; } }