Exemple #1
0
        public WritingSystemSetup(ILogger logger, IWritingSystemRepository store)
            : base("set up fonts, keyboards, and sorting", logger, "writingSystems")
        {
            InitializeComponent();
            store.WritingSystemIdChanged += OnWritingSystemIdChanged;
            var writingSystemSetupModel = new WritingSystemSetupModel(store);

            writingSystemSetupModel.WritingSystemSuggestor.SuggestVoice = true;
            //nb: I (JH) wanted to hide IPA, but then in one week 2 people locally asked for it...
            writingSystemSetupModel.WritingSystemSuggestor.SuggestIpa      = true;
            writingSystemSetupModel.WritingSystemSuggestor.SuggestDialects = false;             // pretty unlikely in WeSay

            this.SuspendLayout();
            _view = new WritingSystemSetupView(writingSystemSetupModel)
            {
                LeftColumnWidth = 350,
                Dock            = DockStyle.Fill
            };
            writingSystemSetupModel.AskIfOkToConflateWritingSystems += OnAskIfOkToConflateWritingSystems;
            writingSystemSetupModel.AskIfOkToDeleteWritingSystems   += OnAskIfOkToDeleteWritingSystems;
            writingSystemSetupModel.ItemAddedOrDeleted    += OnWritingSystemAddOrDelete;
            _view.UserWantsHelpWithDeletingWritingSystems += OnUserWantsHelpWithDeletingWritingSystems;
            _view.UserWantsHelpWithCustomSorting          += OnUserWantsHelpWithCustomSorting;
            store.WritingSystemDeleted   += OnWritingSystemDeleted;
            store.WritingSystemConflated += OnWritingSystemConflated;
            Controls.Add(_view);
            this.ResumeLayout(false);
            WeSayWordsProject.Project.EditorsSaveNow += OnEditorSaveNow;
        }
Exemple #2
0
		public void WritingSystemSetupViewWithComboAttached()
		{
			var runner = new CrossThreadTestRunner();
			runner.RunInSTA(
				delegate
				{
					using (var folder = new TemporaryFolder("WS-Test"))
					{
						var f = new Form();
						f.Size = new Size(800, 600);
						var repository = LdmlInFolderWritingSystemRepository.Initialize(folder.Path);
						var model = new WritingSystemSetupModel(repository);
						var v = new WritingSystemSetupView(model);
						var combo = new WSPickerUsingComboBox(model);
						f.Controls.Add(combo);
						f.Controls.Add(v);
						f.ShowDialog();
					}
				});
		}
Exemple #3
0
        public void WritingSystemSetupViewWithComboAttached()
        {
            var runner = new CrossThreadTestRunner();

            runner.RunInSTA(
                delegate
            {
                using (var folder = new TemporaryFolder("WS-Test"))
                {
                    var f          = new Form();
                    f.Size         = new Size(800, 600);
                    var repository = LdmlInFolderWritingSystemRepository.Initialize(folder.Path);
                    var model      = new WritingSystemSetupModel(repository);
                    var v          = new WritingSystemSetupView(model);
                    var combo      = new WSPickerUsingComboBox(model);
                    f.Controls.Add(combo);
                    f.Controls.Add(v);
                    f.ShowDialog();
                }
            });
        }