예제 #1
0
		public PlanLinksViewModel(IPlanPresentable planElement)
		{
			Plans = new List<PlanLinkViewModel>();
			if (planElement.PlanElementUIDs.Any())
			{
				var allPlans = ShowOnPlanHelper.GetAllPlans(planElement);
				foreach (var paln in allPlans)
				{
					Plans.Add(new PlanLinkViewModel(paln.Key, paln.Value));
				}
			}
		}
예제 #2
0
		public static Dictionary<Plan, Guid> GetAllPlans(IPlanPresentable planElement)
		{
			Dictionary<Plan, Guid> planDictinary = new Dictionary<Plan, Guid>();
			GetPlans().ForEach(x =>
			{
				var element = x.AllElements.FirstOrDefault(y => planElement.PlanElementUIDs.Contains(y.UID) && !y.IsHidden );
				if (element != null)
					planDictinary.Add(x, element.UID);
			});

			return planDictinary;
		}
예제 #3
0
		public static bool ShowObjectOnPlan(IPlanPresentable planElement)
		{
			if (planElement.PlanElementUIDs.Any())
			{
				var plan = GetAllPlans(planElement).FirstOrDefault();
				if (plan.Key != null)
				{
					ServiceFactory.Events.GetEvent<NavigateToPlanElementEvent>().Publish(new NavigateToPlanElementEventArgs(plan.Key.UID, plan.Value));
					return false;
				}
				return true;
			}
			return true;
		}
예제 #4
0
		public static bool CanShowOnPlan(IPlanPresentable planElement)
		{
			return planElement.PlanElementUIDs.Any() && GetAllPlans(planElement).Any();
		}