protected void LoadBots() { if (!SubPackages.Any(p => p.Name == "Bots")) { SayInfoLine("Loading Bots..."); Controller.StartBeeper(); var bots = new Bots(this.Controller); Controller.StopBeeper(); if (bots.Initialized) { SubPackages.Add(new Bots(this.Controller)); } else { SayErrorLine("The Bots package failed to initialize."); return; } } Controller.ActivePackage = SubPackages.Single(p => p.Name == "Bots"); if (CurrentContext.StartsWith("MENU_")) { DispatchIntent(null, Controller.ActivePackage.Menu); } else { DispatchIntent(null, Controller.ActivePackage.Menu); } }
public void LoadOpenShiftPackage() { if (!SubPackages.Any(p => p.Name == "OpenShift")) { SayInfoLine("Loading OpenShift package..."); Controller.StartBeeper(); var _oc = new OpenShift(this.Controller); Controller.StopBeeper(); if (_oc.Initialized) { SubPackages.Add(_oc); } else { SayErrorLine("The OpenShift package failed to initialize."); return; } } var oc = SubPackages.Single(p => p.Name == "OpenShift"); Controller.ActivePackage = oc; if (CurrentContext.StartsWith("MENU_")) { DispatchIntent(null, Controller.ActivePackage.Menu); } else { DispatchIntent(null, Controller.ActivePackage.Welcome); } }
protected void GetPackagesMenuItem(int i) { switch (i - 1) { case 0: if (!SubPackages.Any(p => p.Name == "Vish")) { SayInfoLine("Loading Vish package..."); Controller.StartBeeper(); SubPackages.Add(new Vish(this.Controller)); Controller.StopBeeper(); } Controller.SetActivePackage(SubPackages.Single(p => p.Name == "Vish")); DispatchIntent(null, Controller.ActivePackage.Menu); break; case 2: LoadBots(); break; default: throw new IndexOutOfRangeException(); } }