void InitializePlans() { Plans = new ObservableCollection<PlanLinkViewModel>(); foreach (var plan in FiresecManager.PlansConfiguration.AllPlans) { ElementBase elementBase; elementBase = plan.ElementRectangleXZones.FirstOrDefault(x => x.ZoneUID == Zone.UID); if (elementBase != null) { var alarmPlanViewModel = new PlanLinkViewModel(plan, elementBase); alarmPlanViewModel.Zone = Zone; Plans.Add(alarmPlanViewModel); continue; } elementBase = plan.ElementPolygonXZones.FirstOrDefault(x => x.ZoneUID == Zone.UID); if (elementBase != null) { var alarmPlanViewModel = new PlanLinkViewModel(plan, elementBase); alarmPlanViewModel.Zone = Zone; Plans.Add(alarmPlanViewModel); } } }
void InitializePlans() { Plans = new ObservableCollection<PlanLinkViewModel>(); foreach (var plan in FiresecManager.PlansConfiguration.AllPlans) { ElementBase elementBase = plan.ElementXDevices.FirstOrDefault(x => x.XDeviceUID == Device.UID); if (elementBase != null) { var alarmPlanViewModel = new PlanLinkViewModel(plan, elementBase); alarmPlanViewModel.Device = Device; Plans.Add(alarmPlanViewModel); } } }