Ejemplo n.º 1
0
        public FocusSearchBoxCommand(IDispatcherMessenger messenger)
        {
            if (messenger == null)
            {
                throw new ArgumentNullException("messenger");
            }

            this.messenger = messenger;
        }
        public ClearRecommendationsCommand(IDispatcherMessenger messenger)
        {
            if (messenger == null)
            {
                throw new ArgumentNullException("messenger");
            }

            this.messenger = messenger;
        }
        public DisableRecommendationsScope(IDispatcherMessenger messenger)
        {
            if (messenger == null)
            {
                throw new ArgumentNullException("messenger");
            }

            this.messenger = messenger;
            messenger.SendToUI(new RecommendationsDisabledEvent());
        }
Ejemplo n.º 4
0
        public AudioPlayer(IDispatcherMessenger messenger, NAudioEngine naudio)
        {
            if (messenger == null) throw new ArgumentNullException("messenger");
            if (naudio == null) throw new ArgumentNullException("naudio");
            this.messenger = messenger;
            this.naudio = naudio;

            naudio.Stopped += OnStopped;
            naudio.Started += OnStarted;
        }
Ejemplo n.º 5
0
 public MixFactory(
     IDispatcherMessenger messenger, 
     IActualTransitionDetector transitions, 
     ILimitingPlaybackSpeedAdjuster playbackSpeedAdjuster)
 {
     if (messenger == null) throw new ArgumentNullException("messenger");
     if (transitions == null) throw new ArgumentNullException("transitions");
     if (playbackSpeedAdjuster == null) throw new ArgumentNullException("playbackSpeedAdjuster");
     this.messenger = messenger;
     this.transitions = transitions;
     this.playbackSpeedAdjuster = playbackSpeedAdjuster;
 }
        public SettingsWindowViewModel(
            IDispatcherMessenger messenger,
            SaveSettingsCommand saveCommand,
            CloseWindowCommand cancelCommand)
        {
            if (messenger == null) throw new ArgumentNullException("messenger");
            if (saveCommand == null) throw new ArgumentNullException("saveCommand");
            if (cancelCommand == null) throw new ArgumentNullException("cancelCommand");
            SaveCommand = saveCommand;
            CloseCommand = cancelCommand;

            messenger.Register<ConfigSavedEvent>(this, _ => Close = true);
        }
Ejemplo n.º 7
0
 public ConfigProvider(
     string filename,
     IDispatcherMessenger messenger,
     IConfigReader reader,
     IConfigWriter writer)
 {
     if (filename == null) throw new ArgumentNullException("filename");
     if (messenger == null) throw new ArgumentNullException("messenger");
     if (reader == null) throw new ArgumentNullException("reader");
     if (writer == null) throw new ArgumentNullException("writer");
     messenger.Register<ConfigSavedEvent>(this, e => Config = e.Config);
     this.filename = filename;
     this.messenger = messenger;
     this.reader = reader;
     this.writer = writer;
 }
Ejemplo n.º 8
0
 public TrackLibrary(
     ITrackLoader loader, 
     IDispatcherMessenger messenger, 
     ILibraryStorage storage,
     IRecommendedTransitionDetector transitionDetector)
 {
     if (loader == null) throw new ArgumentNullException("loader");
     if (messenger == null) throw new ArgumentNullException("messenger");
     if (storage == null) throw new ArgumentNullException("storage");
     if (transitionDetector == null) throw new ArgumentNullException("transitionDetector");
     this.loader = loader;
     this.messenger = messenger;
     this.storage = storage;
     this.transitionDetector = transitionDetector;
     tracks = new Dictionary<string, Track>(StringComparer.CurrentCultureIgnoreCase);
 }
        public GuardUnsavedChangesService(
            IDispatcherMessenger messenger,
            ICurrentMixProvider mixProvider,
            SaveMixAsCommand saveAsCommand)
        {
            if (mixProvider == null)
            {
                throw new ArgumentNullException("mixProvider");
            }

            if (saveAsCommand == null)
            {
                throw new ArgumentNullException("saveAsCommand");
            }

            this.messenger = messenger;
            this.mixProvider = mixProvider;
            this.saveAsCommand = saveAsCommand;

            messenger.Register<MixLoadedEvent>(this, OnMixLoaded);
            messenger.Register<MixDirtyEvent>(this, OnMixDirty);
            messenger.Register<MixSavedEvent>(this, OnMixSaved);
        }
Ejemplo n.º 10
0
 public ConfigProvider(IDispatcherMessenger messenger,
                       IConfigReader reader,
                       IConfigWriter writer)
     : this(MixPlannerPaths.ConfigFile, messenger, reader, writer) {}