Пример #1
0
 /// <summary>
 /// Subscribe to message & start focus stealing monitoring
 /// </summary>
 internal void SubscribeToMessages()
 {
     if (_messageQueue != null)
     {
         return;
     }
     _messageQueue = new AsynchronousMessageQueue(this, new[] { WindowsMessaging.CHANNEL });
     _messageQueue.PreviewMessage += OnPreviewMessage;
     _messageQueue.Start();
     IsMonitoring = true;
 }
Пример #2
0
 private void SubscribeToMessages()
 {
     _messageQueue = new AsynchronousMessageQueue(this, new string[]
     {
         WorkflowManagerMessaging.CHANNEL,
         PlayerManagerMessaging.CHANNEL,
         PlayerContextManagerMessaging.CHANNEL,
     });
     _messageQueue.MessageReceived += OnMessageReceived;
     _messageQueue.Start();
 }
Пример #3
0
 public NotificationsModel()
 {
     _messageQueue = new AsynchronousMessageQueue(this, new string[]
     {
         NotificationServiceMessaging.CHANNEL,
         WorkflowManagerMessaging.CHANNEL,
     });
     _messageQueue.MessageReceived += OnMessageReceived;
     _messageQueue.Start();
     Update();
 }
 void SubscribeToMessages()
 {
     _messageQueue = new AsynchronousMessageQueue(this, new string[]
     {
         ServerConnectionMessaging.CHANNEL,
         ContentDirectoryMessaging.CHANNEL,
         SharesMessaging.CHANNEL,
     });
     _messageQueue.MessageReceived += OnMessageReceived;
     _messageQueue.Start();
 }
Пример #5
0
        public OnlineMatcherService()
        {
            _settingChangeWatcher = new SettingsChangeWatcher <OnlineLibrarySettings>();
            _settingChangeWatcher.SettingsChanged += SettingsChanged;

            _messageQueue = new AsynchronousMessageQueue(this, new[]
            {
                SystemMessaging.CHANNEL,
            });
            _messageQueue.MessageReceived += OnMessageReceived;
            _messageQueue.Start();
        }
 void SubscribeToMessages()
 {
     lock (_syncObj)
     {
         _messageQueue = new AsynchronousMessageQueue(this, new string[]
         {
             RemovableMediaMessaging.CHANNEL
         });
         _messageQueue.MessageReceived += OnMessageReceived;
         _messageQueue.Start();
     }
 }
Пример #7
0
        void SubscribeToMessages()
        {
            AsynchronousMessageQueue messageQueue = new AsynchronousMessageQueue(this, new string[]
            {
                ServerConnectionMessaging.CHANNEL,
            });

            messageQueue.MessageReceived += OnMessageReceived;
            messageQueue.Start();
            lock (_syncObj)
                _messageQueue = messageQueue;
        }
Пример #8
0
        public MainForm(ScreenManager screenManager)
        {
            _adaptToSizeEnabled = false;
            _screenManager      = screenManager;

            ServiceRegistration.Get <ILogger>().Debug("SkinEngine MainForm: Registering DirectX MainForm as IScreenControl service");
            ServiceRegistration.Set <IScreenControl>(this);

            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;

            AppSettings settings = ServiceRegistration.Get <ISettingsManager>().Load <AppSettings>();

            _previousMousePosition = new Point(-1, -1);

            Size desiredWindowedSize = new Size(SkinContext.SkinResources.SkinWidth, SkinContext.SkinResources.SkinHeight);

            _previousWindowLocation   = Location;
            _previousWindowClientSize = desiredWindowedSize;
            _previousWindowState      = FormWindowState.Normal;

            if (settings.FullScreen)
            {
                SwitchToFullscreen(settings.FSScreenNum);
            }
            else
            {
                SwitchToWindowedSize(Location, desiredWindowedSize, false);
            }

            SkinContext.WindowSize = ClientSize;

            // GraphicsDevice has to be initialized after the form was sized correctly
            ServiceRegistration.Get <ILogger>().Debug("SkinEngine MainForm: Initialize DirectX");
            GraphicsDevice.Initialize_MainThread(this);

            // Read and apply ScreenSaver settings
            _screenSaverTimeOut   = TimeSpan.FromMinutes(settings.ScreenSaverTimeoutMin);
            _isScreenSaverEnabled = settings.ScreenSaverEnabled;

            _applicationSuspendLevel = settings.SuspendLevel;
            UpdateSystemSuspendLevel_MainThread(); // Don't use UpdateSystemSuspendLevel() here because the window handle was not created yet

            Application.Idle   += OnApplicationIdle;
            _adaptToSizeEnabled = true;

            _messageQueue = new AsynchronousMessageQueue(this, new string[]
            {
                PlayerManagerMessaging.CHANNEL,
            });
            _messageQueue.MessageReceived += OnMessageReceived;
            _messageQueue.Start();
        }
Пример #9
0
 public void SubscribeToMessages()
 {
     Console.WriteLine("subscribe to player messages");
     if (_messageQueue != null)
     {
         return;
     }
     _messageQueue = new AsynchronousMessageQueue(this, SUBSCRIBED_CHANNELS);
     _messageQueue.MessageReceived += OnMessageReceived;
     _messageQueue.Start();
     Console.WriteLine("subscribe to player messages end of function");
 }
        public WifiConnectionModel()
        {
            _isWifiAvailableProperty = new WProperty(typeof(bool), WlanClient.Instance.Interfaces.Length > 0);
            _networkList             = new ItemsList();

            _queue = new AsynchronousMessageQueue(this, new string[]
            {
                WifiConnectionMessaging.CHANNEL,
            });
            _queue.MessageReceived += OnMessageReceived;
            _queue.Start();
        }
Пример #11
0
 public HomeServerModel()
 {
     _homeServerProperty            = new WProperty(typeof(string), string.Empty);
     _isHomeServerAttachedProperty  = new WProperty(typeof(bool), false);
     _isHomeServerConnectedProperty = new WProperty(typeof(bool), false);
     _messageQueue = new AsynchronousMessageQueue(this, new string[]
     {
         ServerConnectionMessaging.CHANNEL
     });
     _messageQueue.MessageReceived += OnMessageReceived;
     _messageQueue.Start();
     SynchronizeHomeServer();
 }
Пример #12
0
        // The methods in this region mirror the methods from the IImporterWorker interface.
        // They are only called from the _actionBlock which ensures that only one of these
        // methods runs at the same time.

        private void DoStartup()
        {
            if (_status != Status.Shutdown)
            {
                ServiceRegistration.Get <ILogger>().Error("ImporterWorker: Startup was requested although status was not 'Shutdown' but '{0}'", _status);
                return;
            }
            _messageQueue.Start();
            LoadPendingImportJobs();
            ScheduleRegularRefreshImports();
            _status = Status.Suspended;
            ServiceRegistration.Get <ILogger>().Info("ImporterWorker: Started");
        }
Пример #13
0
 public UserMessageHandler(bool asyncMode = false)
 {
     _messageQueue = new AsynchronousMessageQueue(this, new string[] { UserMessaging.CHANNEL });
     if (asyncMode)
     {
         _messageQueue.MessageReceived += PreviewMessage; // Asynchronous
     }
     else
     {
         _messageQueue.PreviewMessage += PreviewMessage; // Synchronous
     }
     _messageQueue.Start();
 }
Пример #14
0
 void SubscribeToMessages()
 {
     if (_messageQueue != null)
     {
         return;
     }
     _messageQueue = new AsynchronousMessageQueue(this, new string[]
     {
         PlayerManagerMessaging.CHANNEL,
     });
     _messageQueue.MessageReceived += OnMessageReceived;
     _messageQueue.Start();
 }
        public SettingsChangeWatcher(bool updateOnUserChange)
        {
            List <string> channels = new List <string> {
                SettingsManagerMessaging.CHANNEL
            };

            if (updateOnUserChange)
            {
                channels.Add(UserMessaging.CHANNEL);
            }
            _messageQueue = new AsynchronousMessageQueue(this, channels);
            _messageQueue.MessageReceived += OnMessageReceived;
            _messageQueue.Start();
        }
Пример #16
0
 void SubscribeToMessages()
 {
     //TraceLogger.WriteLine("subscribe to player messages");
     if (_messageQueue != null)
     {
         return;
     }
     _messageQueue = new AsynchronousMessageQueue(this, new string[]
     {
         PlayerManagerMessaging.CHANNEL,
     });
     _messageQueue.MessageReceived += _player.OnMessageReceived;
     _messageQueue.Start();
     //TraceLogger.WriteLine("subscribe to player messages end of function");
 }
Пример #17
0
        /// <summary>
        /// constructor
        /// </summary>
        public LoginModel() : base(false, 2000)
        {
            _loginUserList     = new ItemsList();
            _autoLoginUserList = new ItemsList();

            _currentUserProperty         = new WProperty(typeof(UserProfile), null);
            _userPasswordProperty        = new WProperty(typeof(string), string.Empty);
            _isPasswordIncorrectProperty = new WProperty(typeof(bool), false);
            _isUserLoggedInProperty      = new WProperty(typeof(bool), false);
            _enableUserLoginProperty     = new WProperty(typeof(bool), UserSettingStorage.UserLoginEnabled);

            _messageQueue = new AsynchronousMessageQueue(this, new[] { SystemMessaging.CHANNEL, ServerConnectionMessaging.CHANNEL });
            _messageQueue.MessageReceived += OnMessageReceived;
            _messageQueue.Start();
        }
        internal void DoInstall()
        {
            RegisterKeyBindings();

            // Set initial background
            UpdateBackground();

            // Install message queue
            _messageQueue = new AsynchronousMessageQueue(this, new string[]
            {
                PlayerManagerMessaging.CHANNEL,
            });
            _messageQueue.MessageReceived += OnMessageReceived;
            _messageQueue.Start();
        }
Пример #19
0
        public void Activated(PluginRuntime pluginRuntime)
        {
            var settingsManager = ServiceRegistration.Get <ISettingsManager>();
            var settings        = settingsManager.Load <WhatsNewSettings>();

            if (settings.NewsConfirmed)
            {
                return;
            }

            _messageQueue = new AsynchronousMessageQueue(this.GetType(), new string[]
            {
                WorkflowManagerMessaging.CHANNEL
            });
            _messageQueue.MessageReceived += OnMessageReceived;
            _messageQueue.Start();
        }
Пример #20
0
        void SubscribeToMessages()
        {
            if (_messageQueue != null)
            {
                return;
            }
            _messageQueue = new AsynchronousMessageQueue(this, new string[]
            {
                PlayerManagerMessaging.CHANNEL,
                SystemMessaging.CHANNEL
            });
            _messageQueue.MessageReceived += OnMessageReceived;
            _messageQueue.Start();

            _timer          = new Timer(DEFAULT_CHECK_INTERVAL);
            _timer.Elapsed += CheckVideoResolution;
            _timer.Start();
        }
Пример #21
0
 public ServerConnectionManager()
 {
   _messageQueue = new AsynchronousMessageQueue(this, new string[]
       {
         SharesMessaging.CHANNEL,
         ImporterWorkerMessaging.CHANNEL,
         ServerStateMessaging.CHANNEL
       });
   _messageQueue.MessageReceived += OnMessageReceived;
   _messageQueue.Start();
   string homeServerSystemId = HomeServerSystemId;
   if (string.IsNullOrEmpty(homeServerSystemId))
     // Watch for all MP2 media servers, if we don't have a homeserver yet
     _serverWatcher = BuildServerWatcher();
   else
     // If we have a homeserver set, we'll try to connect to it
     _controlPoint = BuildClientControlPoint(homeServerSystemId);
 }
Пример #22
0
        public void Activated(PluginRuntime pluginRuntime)
        {
            ISystemStateService sss = ServiceRegistration.Get <ISystemStateService>();

            if (sss.CurrentState == SystemState.Running)
            {
                RegisterKeyBindings();
            }
            else
            {
                _messageQueue = new AsynchronousMessageQueue(typeof(StatisticsRenderer), new string[]
                {
                    SystemMessaging.CHANNEL
                });
                _messageQueue.MessageReceived += OnMessageReceived;
                _messageQueue.Start();
            }
        }
 public void EnterModelContext(NavigationContext oldContext, NavigationContext newContext)
 {
     _messageQueue.Start();
     if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_ATTACH_TO_SERVER)
     {
         lock (_syncObj)
             _mode = Mode.AttachToServer;
         object o = newContext.GetContextVariable(Consts.KEY_AUTO_CLOSE_ON_NO_SERVER, false);
         if (o != null)
         {
             _autoCloseOnNoServer = (bool)o;
         }
     }
     else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_DETACH_FROM_SERVER)
     {
         lock (_syncObj)
             _mode = Mode.DetachFromServer;
     }
 }
Пример #24
0
        public void Activated(PluginRuntime pluginRuntime)
        {
            ISystemStateService sss = ServiceRegistration.Get <ISystemStateService>();

            if (sss.CurrentState == SystemState.Running)
            {
                _reloadSkinActions.RegisterKeyActions();
                _loadSkinThemeActions.RegisterKeyActions();
            }
            else
            {
                _messageQueue = new AsynchronousMessageQueue(typeof(ReloadSkinActions), new string[]
                {
                    SystemMessaging.CHANNEL
                });
                _messageQueue.MessageReceived += OnMessageReceived;
                _messageQueue.Start();
            }
        }
Пример #25
0
        public MovieMetadataExtractor()
        {
            _metadata = new MetadataExtractorMetadata(METADATAEXTRACTOR_ID, "Movies metadata extractor", MetadataExtractorPriority.External, true,
                                                      MEDIA_CATEGORIES, new MediaItemAspectMetadata[]
            {
                MediaAspect.Metadata,
                MovieAspect.Metadata
            });

            _messageQueue = new AsynchronousMessageQueue(this, new string[]
            {
                ImporterWorkerMessaging.CHANNEL,
            });
            _messageQueue.MessageReceived += OnMessageReceived;
            _messageQueue.Start();

            _settingWatcher = new SettingsChangeWatcher <MovieMetadataExtractorSettings>();
            _settingWatcher.SettingsChanged += SettingsChanged;

            LoadSettings();
        }
 protected void EnterContext(NavigationContext newContext)
 {
     _messageQueue.Start();
     if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_PLAYER_CONFIGURATION_DIALOG)
     {
         UpdatePlayerConfigurationMenu();
         _inPlayerConfigurationDialog = true;
     }
     else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_CHOOSE_AUDIO_STREAM_DIALOG)
     {
         UpdateAudioStreamsMenu();
         _inChooseAudioStreamDialog = true;
     }
     else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_PLAYER_AUDIO_MENU_DIALOG)
     {
         _playerAudioMenuPlayerContext = newContext.GetContextVariable(Consts.KEY_PLAYER_CONTEXT, false) as IPlayerContext;
         bool?showToggleMute = newContext.GetContextVariable(Consts.KEY_SHOW_MUTE, false) as bool?;
         _showToggleMute = showToggleMute ?? true;
         UpdatePlayerSlotAudioMenu();
         _inPlayerSlotAudioMenuDialog = true;
     }
     else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_PLAYER_CHOOSE_GEOMETRY_MENU_DIALOG)
     {
         _playerGeometryMenuPlayerContext = newContext.GetContextVariable(Consts.KEY_PLAYER_CONTEXT, false) as IPlayerContext;
         UpdatePlayerChooseGeometryMenu();
         _inPlayerChooseGeometryMenuDialog = true;
     }
     else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_PLAYER_CHOOSE_EFFECT_MENU_DIALOG)
     {
         _playerEffectMenuPlayerContext = newContext.GetContextVariable(Consts.KEY_PLAYER_CONTEXT, false) as IPlayerContext;
         UpdatePlayerChooseEffectMenu();
         _inPlayerChooseEffectMenuDialog = true;
     }
     else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_PLAYER_CHOOSE_SUBTITLE_MENU_DIALOG)
     {
         _playerSubtitleMenuPlayerContext = newContext.GetContextVariable(Consts.KEY_PLAYER_CONTEXT, false) as IPlayerContext;
         UpdatePlayerChooseSubtitleMenu();
         _inPlayerChooseSubtitleMenuDialog = true;
     }
 }
        public AudioMetadataExtractor()
        {
            _metadata = new MetadataExtractorMetadata(METADATAEXTRACTOR_ID, "Audio metadata extractor", MetadataExtractorPriority.Core, false,
                                                      MEDIA_CATEGORIES, new[]
            {
                MediaAspect.Metadata,
                AudioAspect.Metadata,
                ThumbnailLargeAspect.Metadata
            });

            _messageQueue = new AsynchronousMessageQueue(this, new string[]
            {
                ImporterWorkerMessaging.CHANNEL,
            });
            _messageQueue.MessageReceived += OnMessageReceived;
            _messageQueue.Start();

            _settingWatcher = new SettingsChangeWatcher <AudioMetadataExtractorSettings>();
            _settingWatcher.SettingsChanged += SettingsChanged;

            LoadSettings();
        }
Пример #28
0
        public PlaylistImportModel()
        {
            _importFileProperty   = new WProperty(typeof(string), null);
            _playlistNameProperty = new WProperty(typeof(string), null);
            _errorHintProperty    = new WProperty(typeof(string), null);
            _isDataValidProperty  = new WProperty(typeof(bool), false);

            _importFileProperty.Attach(OnDataPropertyChanged);
            _playlistNameProperty.Attach(OnDataPropertyChanged);

            CreateShareLocations();

            _queue = new AsynchronousMessageQueue(this, new string[]
            {
                ServerConnectionMessaging.CHANNEL,
            });
            _queue.MessageReceived += OnMessageReceived;
            _queue.Start();

            LoadSettings();

            CheckDataValid();
        }
Пример #29
0
 protected void SubscribeToMessages()
 {
     _messageQueue = new AsynchronousMessageQueue(this, new [] { WindowsMessaging.CHANNEL });
     _messageQueue.MessageReceived += OnMessageReceived;
     _messageQueue.Start();
 }
 /// <summary>
 /// Initializes message queue registrations.
 /// </summary>
 void SubscribeToMessages()
 {
     _messageQueue = new AsynchronousMessageQueue(this, new string[] {});
     _messageQueue.Start();
 }