예제 #1
0
        public SpeakersManager(Speaker originalSpeaker, WPFTranscription transcription, SpeakerCollection documentSpeakers, SpeakerCollection localSpeakers = null)
        {
            DataContext       = this;//not good :)
            _originalSpeaker  = originalSpeaker;
            _localSpeakers    = localSpeakers;
            _documentSpeakers = documentSpeakers;
            _transcription    = transcription;

            InitializeComponent();
            SpeakerProvider = new SpeakerManagerViewModel(new SpeakerCollection(documentSpeakers.Concat(transcription.EnumerateParagraphs().Select(p => p.Speaker)).Where(s => s != Speaker.DefaultSpeaker).Distinct()), localSpeakers, transcription.Api, this);

            var ss = SpeakerProvider.GetContainerForSpeaker(originalSpeaker);

            if (ss != null)
            {
                ss.Marked = true;
            }
            SpeakersBox.SelectedValue = ss;
            SpeakersBox.ScrollIntoView(SpeakersBox.SelectedItem);

            if (_transcription.Api != null)
            {
                SpeakerProvider.ShowLocal  = false;
                SpeakerProvider.ShowOnline = true;
            }
            //SpeakersBox.Items.SortDescriptions.Add( new SortDescription("",ListSortDirection.Ascending));
        }
예제 #2
0
 public Deferer(SpeakerManagerViewModel speakerManagerViewModel)
 {
     this.speakerManagerViewModel = speakerManagerViewModel;
     lock (locker)
     {
         Interlocked.Increment(ref speakerManagerViewModel.DeferCounter);
         viewDefer = speakerManagerViewModel._view.DeferRefresh();
     }
 }