// this is the context from the Media Center menu
        public void Startup(string context)
        {            
            OMLApplication.DebugLine("[OMLApplication] Startup({0}) {1}", context, IsExtender ? "Extender" : "Native");
            // DISABLE THIS UNTIL ITS READY -- DJShultz 01/13/2009

            //if (!IsExtender) {
            OperatingSystem os = Environment.OSVersion;
            if (os.Version.Major >= 6 && os.Version.Minor >= 1)
                Properties.Settings.Default.IsWindows7 = true;
            else
                Properties.Settings.Default.IsWindows7 = false;

            Properties.Settings.Default.Save();
            //}
            //should we update?
            if (OMLSettings.EnableAutomaticUpdates)
            {
                bool enableBetaUpdates = OMLSettings.EnableAutomaticUpdatesDailyBuilds;
                OMLUpdater updater = new OMLUpdater();
                ThreadPool.QueueUserWorkItem(new WaitCallback(updater.checkUpdate), enableBetaUpdates);
            }

#if LAYOUT_V3

            #region v3POC

            SetPrimaryBackgroundImage();
            //this.MediaCenterEnvironment.Dialog(
            //            string.Format("Loading MC UI"),
            //            "TEST", DialogButtons.Ok, 5, false);
            //this.GoToWizard(new List<OMLEngine.TitleFilter>(), "Movies");
            //return;
            switch (context)
            {
                case "Settings":
                    {
                        Dictionary<string, object> properties = new Dictionary<string, object>();

                        Library.Code.V3.SettingsManager page = new Library.Code.V3.SettingsManager();
                        properties["Page"] = page;
                        properties["Application"] = OMLApplication.Current;

                        OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_Settings_SettingsManager", properties);
                        return;
                    }
                case "Search":
                    {
                        Dictionary<string, object> properties = new Dictionary<string, object>();

                        Library.Code.V3.MoviesSearchPage page = new Library.Code.V3.MoviesSearchPage();
                        properties["Page"] = page;
                        properties["Application"] = OMLApplication.Current;

                        OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_MoviesSearchPage", properties);
                        return;
                    }
                case "Trailers":
                    {
                        OMLProperties properties = new OMLProperties();
                        properties.Add("Application", this);
                        properties.Add("I18n", I18n.Instance);
                        Library.Code.V3.TrailerPage gallery = new Library.Code.V3.TrailerPage("trailers");
                        Command CommandContextPopOverlay = new Command();
                        properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);
                        properties.Add("Page", gallery);
                        _session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
                        return;
                    }
                case "Custom1":
                    {
                        UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                        this.GoHome(filt.Filters, filt.Name);
                        return;
                    }
                case "Custom2":
                    {
                        UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                        this.GoHome(filt.Filters, filt.Name);
                        return;
                    }
                case "Custom3":
                    {
                        UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                        this.GoHome(filt.Filters, filt.Name);
                        return;
                    }
                case "Custom4":
                    {
                        UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                        this.GoHome(filt.Filters, filt.Name);
                        return;
                    }
                case "Custom5":
                    {
                        UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                        this.GoHome(filt.Filters, filt.Name);
                        return;
                    }
                case "FirstRun":
                    {
                        Dictionary<string, object> properties = new Dictionary<string, object>();

                        Library.Code.V3.FirstRun page = new Library.Code.V3.FirstRun();
                        properties["Page"] = page;

                        OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_FirstRunBackground", properties);
                        return;
                    }
                case "TV":
                    {
                        List<OMLEngine.TitleFilter> filters = new List<OMLEngine.TitleFilter>();
                        filters.Add(new OMLEngine.TitleTypeFilter(OMLEngine.TitleTypes.TVShow));
                        this.GoHome(filters, "TV");
                        return;
                    }
                case "Movies":
                    {
                        this.GoHome(new List<OMLEngine.TitleFilter>(), "Movies");
                        return;
                    }
                default:
                    {
                        ////everything else for now
                        //OMLProperties properties = new OMLProperties();
                        //properties.Add("Application", this);
                        ////properties.Add("UISettings", new UISettings());
                        ////properties.Add("Settings", new Settings());
                        //properties.Add("I18n", I18n.Instance);
                        ////v3 main gallery
                        //Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(new List<OMLEngine.TitleFilter>(), "OML");
                        ////description
                        //gallery.Description = "OML";
                        //Command CommandContextPopOverlay = new Command();
                        //properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);
                        //properties.Add("Page", gallery);
                        //_session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
                        ////this.mediaChangers = new Library.Code.V3.MediaChangeManager();
                        if (Properties.Settings.Default.CompletedFirstRun == false)
                        {
                            Dictionary<string, object> properties = new Dictionary<string, object>();

                            Library.Code.V3.FirstRun page = new Library.Code.V3.FirstRun();
                            properties["Page"] = page;

                            OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_FirstRunBackground", properties);
                        }
                        else
                            this.GoHome(new List<OMLEngine.TitleFilter>(), "OML");
                        return;
                    }
            }
            #endregion v3POC
            //return;
#endif

        }
Exemple #2
0
        // this is the context from the Media Center menu
        public void Startup(string context)
        {
            OMLApplication.DebugLine("[OMLApplication] Startup({0}) {1}", context, IsExtender ? "Extender" : "Native");
            // DISABLE THIS UNTIL ITS READY -- DJShultz 01/13/2009

            //if (!IsExtender) {
            OperatingSystem os = Environment.OSVersion;

            if (os.Version.Major >= 6 && os.Version.Minor >= 1)
            {
                Properties.Settings.Default.IsWindows7 = true;
            }
            else
            {
                Properties.Settings.Default.IsWindows7 = false;
            }

            Properties.Settings.Default.Save();
            //}
            //should we update?
            if (OMLSettings.EnableAutomaticUpdates)
            {
                bool       enableBetaUpdates = OMLSettings.EnableAutomaticUpdatesDailyBuilds;
                OMLUpdater updater           = new OMLUpdater();
                ThreadPool.QueueUserWorkItem(new WaitCallback(updater.checkUpdate), enableBetaUpdates);
            }

#if LAYOUT_V3
            #region v3POC

            SetPrimaryBackgroundImage();
            //this.MediaCenterEnvironment.Dialog(
            //            string.Format("Loading MC UI"),
            //            "TEST", DialogButtons.Ok, 5, false);
            //this.GoToWizard(new List<OMLEngine.TitleFilter>(), "Movies");
            //return;
            switch (context)
            {
            case "Settings":
            {
                Dictionary <string, object> properties = new Dictionary <string, object>();

                Library.Code.V3.SettingsManager page = new Library.Code.V3.SettingsManager();
                properties["Page"]        = page;
                properties["Application"] = OMLApplication.Current;

                OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_Settings_SettingsManager", properties);
                return;
            }

            case "Search":
            {
                Dictionary <string, object> properties = new Dictionary <string, object>();

                Library.Code.V3.MoviesSearchPage page = new Library.Code.V3.MoviesSearchPage();
                properties["Page"]        = page;
                properties["Application"] = OMLApplication.Current;

                OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_MoviesSearchPage", properties);
                return;
            }

            case "Trailers":
            {
                OMLProperties properties = new OMLProperties();
                properties.Add("Application", this);
                properties.Add("I18n", I18n.Instance);
                Library.Code.V3.TrailerPage gallery = new Library.Code.V3.TrailerPage("trailers");
                Command CommandContextPopOverlay    = new Command();
                properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);
                properties.Add("Page", gallery);
                _session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
                return;
            }

            case "Custom1":
            {
                UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                this.GoHome(filt.Filters, filt.Name);
                return;
            }

            case "Custom2":
            {
                UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                this.GoHome(filt.Filters, filt.Name);
                return;
            }

            case "Custom3":
            {
                UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                this.GoHome(filt.Filters, filt.Name);
                return;
            }

            case "Custom4":
            {
                UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                this.GoHome(filt.Filters, filt.Name);
                return;
            }

            case "Custom5":
            {
                UserFilter filt = new UserFilter(OMLEngine.Properties.Settings.Default.StartMenuCustom1);
                this.GoHome(filt.Filters, filt.Name);
                return;
            }

            case "FirstRun":
            {
                Dictionary <string, object> properties = new Dictionary <string, object>();

                Library.Code.V3.FirstRun page = new Library.Code.V3.FirstRun();
                properties["Page"] = page;

                OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_FirstRunBackground", properties);
                return;
            }

            case "TV":
            {
                List <OMLEngine.TitleFilter> filters = new List <OMLEngine.TitleFilter>();
                filters.Add(new OMLEngine.TitleTypeFilter(OMLEngine.TitleTypes.TVShow));
                this.GoHome(filters, "TV");
                return;
            }

            case "Movies":
            {
                this.GoHome(new List <OMLEngine.TitleFilter>(), "Movies");
                return;
            }

            default:
            {
                ////everything else for now
                //OMLProperties properties = new OMLProperties();
                //properties.Add("Application", this);
                ////properties.Add("UISettings", new UISettings());
                ////properties.Add("Settings", new Settings());
                //properties.Add("I18n", I18n.Instance);
                ////v3 main gallery
                //Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(new List<OMLEngine.TitleFilter>(), "OML");
                ////description
                //gallery.Description = "OML";
                //Command CommandContextPopOverlay = new Command();
                //properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);
                //properties.Add("Page", gallery);
                //_session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
                ////this.mediaChangers = new Library.Code.V3.MediaChangeManager();
                if (Properties.Settings.Default.CompletedFirstRun == false)
                {
                    Dictionary <string, object> properties = new Dictionary <string, object>();

                    Library.Code.V3.FirstRun page = new Library.Code.V3.FirstRun();
                    properties["Page"] = page;

                    OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_FirstRunBackground", properties);
                }
                else
                {
                    this.GoHome(new List <OMLEngine.TitleFilter>(), "OML");
                }
                return;
            }
            }
            #endregion v3POC
            //return;
#endif
        }