Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Add a subproject to the package.
        /// </summary>
        /// <param name="subPackage">The subpackage to be added</param>
        public void AddSubPackage(TestPackage subPackage)
        {
            SubPackages.Add(subPackage);

            foreach (var key in Settings.Keys)
            {
                subPackage.Settings[key] = Settings[key];
            }
        }
Ejemplo n.º 4
0
        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();
            }
        }