コード例 #1
0
 public SimilarSegmentMappingsViewModel(IProjectService projectService, SegmentMappingsViewModel mappings, SoundType soundType)
 {
     _projectService            = projectService;
     _mappings                  = mappings;
     _mappings.PropertyChanged += ChildPropertyChanged;
     _soundType                 = soundType;
 }
コード例 #2
0
        public SimilarSegmentMappingsViewModel(IProjectService projectService, IDialogService dialogService, SegmentMappingsTableViewModel.Factory segmentMappingsTableFactory,
			SegmentMappingsViewModel mappings, SegmentMappingViewModel.Factory mappingFactory, SoundType soundType)
        {
            _projectService = projectService;
            _mappings = mappings;
            _mappings.PropertyChanged += ChildPropertyChanged;
            _soundType = soundType;
            _dialogService = dialogService;
            _segmentMappingsTableFactory = segmentMappingsTableFactory;
            _mappingFactory = mappingFactory;
            _editSegmentMappingsTableCommand = new RelayCommand(EditSegmentMappingsTable);
        }
コード例 #3
0
 public SimilarSegmentMappingsViewModel(IProjectService projectService, IDialogService dialogService, SegmentMappingsTableViewModel.Factory segmentMappingsTableFactory,
                                        SegmentMappingsViewModel mappings, SegmentMappingViewModel.Factory mappingFactory, SoundType soundType)
 {
     _projectService                  = projectService;
     _mappings                        = mappings;
     _mappings.PropertyChanged       += ChildPropertyChanged;
     _soundType                       = soundType;
     _dialogService                   = dialogService;
     _segmentMappingsTableFactory     = segmentMappingsTableFactory;
     _mappingFactory                  = mappingFactory;
     _editSegmentMappingsTableCommand = new RelayCommand(EditSegmentMappingsTable);
 }
コード例 #4
0
 public BlairCognateIdentifierViewModel(SegmentPool segmentPool, IProjectService projectService, SegmentMappingsViewModel ignoredMappings,
                                        SimilarSegmentMappingsViewModel.Factory similarSegmentMappingsFactory)
     : base("Blair")
 {
     _segmentPool     = segmentPool;
     _projectService  = projectService;
     _ignoredMappings = ignoredMappings;
     _ignoredMappings.PropertyChanged += ChildPropertyChanged;
     _similarVowels = similarSegmentMappingsFactory(SoundType.Vowel);
     _similarVowels.PropertyChanged     += ChildPropertyChanged;
     _similarConsonants                  = similarSegmentMappingsFactory(SoundType.Consonant);
     _similarConsonants.PropertyChanged += ChildPropertyChanged;
 }
コード例 #5
0
        public BlairCognateIdentifierViewModel(SegmentPool segmentPool, IProjectService projectService, SegmentMappingsViewModel ignoredMappings,
			SimilarSegmentMappingsViewModel.Factory similarSegmentMappingsFactory, SegmentMappingViewModel.Factory mappingFactory)
            : base("Blair")
        {
            _segmentPool = segmentPool;
            _projectService = projectService;
            _mappingFactory = mappingFactory;
            _ignoredMappings = ignoredMappings;
            _ignoredMappings.PropertyChanged += ChildPropertyChanged;
            _similarVowels = similarSegmentMappingsFactory(SoundType.Vowel);
            _similarVowels.PropertyChanged += ChildPropertyChanged;
            _similarConsonants = similarSegmentMappingsFactory(SoundType.Consonant);
            _similarConsonants.PropertyChanged += ChildPropertyChanged;
        }
コード例 #6
0
 public SegmentMappingsTableSegmentPairViewModel(SegmentMappingsViewModel mappings, SegmentMappingViewModel.Factory mappingFactory,
                                                 SegmentMappingsTableSegmentViewModel segment1, SegmentMappingsTableSegmentViewModel segment2, int delta, bool enabled)
 {
     _mappingFactory = mappingFactory;
     _segment1       = segment1;
     _segment2       = segment2;
     _enabled        = enabled;
     _delta          = delta;
     _mappings       = mappings;
     _mappings.ConstrainToSegmentPair(_segment1.StrRep, _segment2.StrRep);
     _mappings.ImportEnabled = false;
     _mappings.Mappings.CollectionChanged += MappingsChanged;
     _toggleMappingCommand = new RelayCommand(ToggleMapping);
 }
コード例 #7
0
        public SegmentMappingsTableSegmentPairViewModel(SegmentMappingsViewModel mappings, SegmentMappingViewModel.Factory mappingFactory,
			SegmentMappingsTableSegmentViewModel segment1, SegmentMappingsTableSegmentViewModel segment2, int delta, bool enabled)
        {
            _mappingFactory = mappingFactory;
            _segment1 = segment1;
            _segment2 = segment2;
            _enabled = enabled;
            _delta = delta;
            _mappings = mappings;
            _mappings.ConstrainToSegmentPair(_segment1.StrRep, _segment2.StrRep);
            _mappings.ImportEnabled = false;
            _mappings.Mappings.CollectionChanged += MappingsChanged;
            _toggleMappingCommand = new RelayCommand(ToggleMapping);
        }
コード例 #8
0
            public TestEnvironment()
            {
                DispatcherHelper.Initialize();
                _projectService = Substitute.For<IProjectService>();
                var dialogService = Substitute.For<IDialogService>();
                var importService = Substitute.For<IImportService>();

                SegmentMappingViewModel.Factory mappingFactory = (segment1, segment2) => new SegmentMappingViewModel(_projectService, segment1, segment2);
                NewSegmentMappingViewModel.Factory newMappingFactory = () => new NewSegmentMappingViewModel(_projectService);

                var segmentMappings = new SegmentMappingsViewModel(dialogService, importService, mappingFactory, newMappingFactory);
                _segmentPair = new SegmentMappingsTableSegmentPairViewModel(segmentMappings, mappingFactory,
                    new SegmentMappingsTableSegmentViewModel(new Segment(FeatureStruct.New().Symbol(CogFeatureSystem.ConsonantType).Feature(CogFeatureSystem.StrRep).EqualTo("b").Value), SoundType.Consonant),
                    new SegmentMappingsTableSegmentViewModel(new Segment(FeatureStruct.New().Symbol(CogFeatureSystem.ConsonantType).Feature(CogFeatureSystem.StrRep).EqualTo("c").Value), SoundType.Consonant),
                    100, true);

                var project = new CogProject(_spanFactory);
                _projectService.Project.Returns(project);
            }