public MathGate(XPathNavigator navigator) { List <MathGateProblem> problemList = new List <MathGateProblem>(); navigator.MoveToChild("Name", ""); this.name = navigator.Value; navigator.MoveToNext("ID", ""); this.id = navigator.ValueAsInt; navigator.MoveToNext(); do { MathGateProblem p = new MathGateProblem(navigator.Clone()); problemList.Add(p); } while (navigator.MoveToNext("Problem", "")); problems = problemList.ToArray(); navigator.MoveToNext(); switch (navigator.Value) { case "CP_VS_HEAT_LEAK_GRAPH": capability = CAPABILITY.CP_VS_HEAT_LEAK_GRAPH; break; default: string msg = string.Format("Unexpected capability \"{0}\"", navigator.Value); throw new Exception(msg); } }
public MathGate(string name, int id, MathGateProblem[] problems, CAPABILITY capability) { this.name = name; this.id = id; this.problems = problems; this.capability = capability; }
public bool HasCapability(CAPABILITY desiredCapability) { switch (desiredCapability) { case CAPABILITY.CP_VS_HEAT_LEAK_GRAPH: return(webService.HasCapability(DesktopClient.CoolIt_Service.CAPABILITY.CP_VS_HEAT_LEAK_GRAPH)); default: throw new Exception("Unexpected capability requested"); } }
public bool HasCapability(CAPABILITY desiredCapability) { if (capabilities.Contains(desiredCapability)) { return(true); } else { return(false); } }
public bool HasCapability(CAPABILITY requestedCapability) { CapabilityManager capMgr = getCapabilityManager(); return(capMgr.HasCapability(requestedCapability)); }