Example #1
0
        public MainViewModel(IAudioRecorder audioRecorder, Settings settings, ICallNumber callNumber, IReactOnCall reactOnCall, ICreateTimer createTimer, IUnMutePhone unmutePhone, IMutePhone mutePhone, ISpeaker speaker)
        {
            this.Settings            = settings;
            this.m_RecorderViewModel = audioRecorder;
            this.m_RecorderViewModel.Start();
            this.m_PhoneViewModel       = new PhoneViewModel(m_RecorderViewModel, settings, callNumber, reactOnCall, createTimer, mutePhone, unmutePhone, speaker);
            this.m_InfoTimer            = createTimer.Create(new TimeSpan(0, 0, 0, 0, 250));
            this.m_InfoTimer.AutoReset  = true;
            this.m_InfoTimer.MyElapsed += m_Timer_Elapsed;

            this.m_InfoTimer.Start();
        }
Example #2
0
        public PhoneViewModel(IAudioRecorder recorder, Settings settings, ICallNumber callNumber, IReactOnCall reactOnCall, ICreateTimer createTimer, IMutePhone mutePhone, IUnMutePhone unmutePhone, ISpeaker speaker)
        {
            this.IsStarted                = false;
            this.m_Speaker                = speaker;
            this.m_UnmutePhone            = unmutePhone;
            this.m_MutePhone              = mutePhone;
            this.m_Settings               = settings;
            this.m_CallNumber             = callNumber;
            this.m_AudioRecorderViewModel = recorder;

            this.m_PhoneTimer            = createTimer.Create(new TimeSpan(0, 0, 0, 1, 0));
            this.m_PhoneTimer.AutoReset  = false;
            this.m_PhoneTimer.MyElapsed += m_PhoneTimer_Elapsed;

            this.m_ReactOnCall = reactOnCall;
            this.m_ReactOnCall.Register(this.OnHangUp);
        }