public OMLApplication(HistoryOrientedPageSession session, AddInHost host)
        {
            #if LAYOUT_V3
            //sets up the hooks for context menu
            this.hooker = new Library.Code.V3.MoreInfoHooker2();
            this.mouseActiveHooker = new Library.Code.V3.IsMouseActiveHooker();
            this.mouseActiveHooker.MouseActive += new Library.Code.V3.IsMouseActiveHooker.MouseActiveHandler(mouseActiveHooker_MouseActive);
            #endif

            this.parentalControlManager = new ParentalControlManager();
            this._session = session;
            AddInHost.Current.MediaCenterEnvironment.PropertyChanged +=new PropertyChangedEventHandler(MediaCenterEnvironment_PropertyChanged);
            
            //I know its a factory
            //this._factory = new MoviePlayerFactory();

            try { // borrowed from vmcNetFlix project on google-code
                bool isConsole = false;
                if (host.MediaCenterEnvironment.Capabilities.ContainsKey("Console"))
                {
                    isConsole = (bool)host.MediaCenterEnvironment.Capabilities["Console"];
                }
                bool isVideo = false;
                if (host.MediaCenterEnvironment.Capabilities.ContainsKey("Video"))
                {
                    isVideo = (bool)host.MediaCenterEnvironment.Capabilities["Video"];
                }
                if (isConsole == false)
                {
                    if (isVideo == true)
                        _isExtender = true;
                }
            } catch (Exception)
            {
                _isExtender = false;
            }
#if DEBUG_EXT
            System.Diagnostics.Debugger.Launch();
            _isExtender = true;
#endif
#if DEBUG
            OMLApplication.DebugLine("[OMLApplication] MediaCenterEnvironment.Capabilities:");
            foreach (KeyValuePair<string, object> cap in host.MediaCenterEnvironment.Capabilities)
                try { DebugLine("  ['{0}'] = '{1}'", cap.Key, cap.Value); }
                catch { }
#else
            OMLApplication.DebugLine("[OMLApplication] constructor called");
#endif
            this._host = host;
            _singleApplicationInstance = this;
            I18n.InitializeResourceManager();
            string uiCulture = OMLSettings.UILanguage;
            if (!string.IsNullOrEmpty(uiCulture)) I18n.SetCulture(new CultureInfo(uiCulture));
            _nowPlayingMovieName = "Playing an unknown movie";
        }
Beispiel #2
0
        public OMLApplication(HistoryOrientedPageSession session, AddInHost host)
        {
            #if LAYOUT_V3
            //sets up the hooks for context menu
            this.hooker                         = new Library.Code.V3.MoreInfoHooker2();
            this.mouseActiveHooker              = new Library.Code.V3.IsMouseActiveHooker();
            this.mouseActiveHooker.MouseActive += new Library.Code.V3.IsMouseActiveHooker.MouseActiveHandler(mouseActiveHooker_MouseActive);
            #endif

            this.parentalControlManager = new ParentalControlManager();
            this._session = session;
            AddInHost.Current.MediaCenterEnvironment.PropertyChanged += new PropertyChangedEventHandler(MediaCenterEnvironment_PropertyChanged);

            //I know its a factory
            //this._factory = new MoviePlayerFactory();

            try { // borrowed from vmcNetFlix project on google-code
                bool isConsole = false;
                if (host.MediaCenterEnvironment.Capabilities.ContainsKey("Console"))
                {
                    isConsole = (bool)host.MediaCenterEnvironment.Capabilities["Console"];
                }
                bool isVideo = false;
                if (host.MediaCenterEnvironment.Capabilities.ContainsKey("Video"))
                {
                    isVideo = (bool)host.MediaCenterEnvironment.Capabilities["Video"];
                }
                if (isConsole == false)
                {
                    if (isVideo == true)
                    {
                        _isExtender = true;
                    }
                }
            } catch (Exception)
            {
                _isExtender = false;
            }
#if DEBUG_EXT
            System.Diagnostics.Debugger.Launch();
            _isExtender = true;
#endif
#if DEBUG
            OMLApplication.DebugLine("[OMLApplication] MediaCenterEnvironment.Capabilities:");
            foreach (KeyValuePair <string, object> cap in host.MediaCenterEnvironment.Capabilities)
            {
                try { DebugLine("  ['{0}'] = '{1}'", cap.Key, cap.Value); }
                catch { }
            }
#else
            OMLApplication.DebugLine("[OMLApplication] constructor called");
#endif
            this._host = host;
            _singleApplicationInstance = this;
            I18n.InitializeResourceManager();
            string uiCulture = OMLSettings.UILanguage;
            if (!string.IsNullOrEmpty(uiCulture))
            {
                I18n.SetCulture(new CultureInfo(uiCulture));
            }
            _nowPlayingMovieName = "Playing an unknown movie";
        }