public void Dispose()
        {
            if (this.disposed)
            {
                return;
            }
            this.disposed = true;

            if (this.timer != null)
            {
                this.timer.Dispose();
                this.timer = null;
            }

            if (this.interactionService != null)
            {
                this.interactionService.InteractionOccured -= InteractionService_InteractionOccured;
                this.interactionService = null;
            }

            if (this.speakService != null)
            {
                this.speakService = null;
            }
        }
示例#2
0
        public SettingsViewModel(ISpeakService speakService, ILanguageService languageService)
        {
            this.speakService = speakService;
            this.languageService = languageService;

            SetupLanguages();
        }
示例#3
0
        public SettingsViewModel(ISpeakService speakService, ILanguageService languageService)
        {
            this.speakService    = speakService;
            this.languageService = languageService;

            SetupLanguages();
        }
示例#4
0
		public MainViewModel(IInteractionService interactionService, ISoundService soundService, ISpeakService speakService, ILanguageService languageService)
		{

			if(interactionService == null)
				throw new ArgumentNullException(nameof(interactionService));

			if(speakService == null)
				throw new ArgumentNullException(nameof(speakService));

			if(languageService == null)
				throw new ArgumentNullException(nameof(languageService));

			if(soundService == null)
				throw new ArgumentNullException(nameof(soundService));

			this.interactionService = interactionService;
			this.soundService = soundService;
			this.speakService = speakService;
			this.languageService = languageService;

			this.timer = new Timer((obj) => {
				CheckFiguresToRemove();
			}, null, timerDelay, timerDelay);

			this.interactionService.InteractionOccured += InteractionService_InteractionOccured;

			//play the intro sound
			this.soundService.PlayEmbebedResourceAsync(introSound);
		}
示例#5
0
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }
            disposed = true;

            timer?.Dispose();
            timer = null;

            if (_interactionService != null)
            {
                _interactionService.InteractionOccured -= InteractionService_InteractionOccured;
                _interactionService = null;
            }

            _speakService = null;
        }
		public void Dispose()
		{
			if(this.disposed)
				return;
			this.disposed = true;

			if(this.timer != null) {
				this.timer.Dispose();
				this.timer = null;
			}

			if(this.interactionService != null) {
				this.interactionService.InteractionOccured -= InteractionService_InteractionOccured;
				this.interactionService = null;
			}

			if(this.speakService != null) {
				this.speakService = null;
			}
		}
        public MainViewModel(
            IInteractionService interactionService,
            ISoundService soundService,
            ISpeakService speakService,
            ILanguageService languageService,
            IDeviceService deviceService)
        {
            this.interactionService = interactionService;
            this.soundService       = soundService;
            this.speakService       = speakService;
            this.languageService    = languageService;
            this.deviceService      = deviceService;

            this.timer = new Timer((obj) => {
                CheckFiguresToRemove();
            }, null, timerDelay, timerDelay);

            this.interactionService.InteractionOccured += InteractionService_InteractionOccured;

            //play the intro sound
            this.soundService.PlayEmbebedResourceAsync(introSound);
        }
示例#8
0
        public MainViewModel()
        {
            _speakService    = DependencyService.Get <ISpeakService>();
            _soundService    = DependencyService.Get <ISoundService>();
            _languageService = DependencyService.Get <ILanguageService>();

            if (_speakService == null)
            {
                throw new ArgumentNullException(nameof(_speakService));
            }

            if (_languageService == null)
            {
                throw new ArgumentNullException(nameof(_languageService));
            }

            if (_soundService == null)
            {
                throw new ArgumentNullException(nameof(_soundService));
            }


            timer = new Timer((obj) =>
            {
                CheckFiguresToRemove();
            }, null, timerDelay, timerDelay);

            //check native interactionService
            var interactionService = DependencyService.Get <IInteractionService>();

            if (interactionService != null)
            {
                HookInterationService(interactionService);
            }

            //play the intro sound
            _soundService.PlayEmbebedResourceAsync(introSound);
        }
		public MainViewModel(
			IInteractionService interactionService,
			ISoundService soundService,
			ISpeakService speakService,
			ILanguageService languageService,
			IDeviceService deviceService)
		{

			this.interactionService = interactionService;
			this.soundService = soundService;
			this.speakService = speakService;
			this.languageService = languageService;
			this.deviceService = deviceService;

			this.timer = new Timer((obj) => {
				CheckFiguresToRemove();
			}, null, timerDelay, timerDelay);

			this.interactionService.InteractionOccured += InteractionService_InteractionOccured;

			//play the intro sound
			this.soundService.PlayEmbebedResourceAsync(introSound);
		}
示例#10
0
        public MainViewModel(IInteractionService interactionService, ISoundService soundService, ISpeakService speakService, ILanguageService languageService)
        {
            if (interactionService == null)
            {
                throw new ArgumentNullException(nameof(interactionService));
            }

            if (speakService == null)
            {
                throw new ArgumentNullException(nameof(speakService));
            }

            if (languageService == null)
            {
                throw new ArgumentNullException(nameof(languageService));
            }

            if (soundService == null)
            {
                throw new ArgumentNullException(nameof(soundService));
            }

            this.interactionService = interactionService;
            this.soundService       = soundService;
            this.speakService       = speakService;
            this.languageService    = languageService;

            this.timer = new Timer((obj) => {
                CheckFiguresToRemove();
            }, null, timerDelay, timerDelay);

            this.interactionService.InteractionOccured += InteractionService_InteractionOccured;

            //play the intro sound
            this.soundService.PlayEmbebedResourceAsync(introSound);
        }