Esempio n. 1
0
		public void Setup()
		{
			_tempFolder = new TemporaryFolder();
			_filePath = _tempFolder.GetTemporaryFile();

			WeSayWordsProject.InitializeForTests();
			string[] vernacularWritingSystemIds = new string[]
													  {
															  BasilProject.Project.WritingSystems.
																	  TestWritingSystemVernId
													  };
			_viewTemplate = new ViewTemplate();
			_viewTemplate.Add(new Field(Field.FieldNames.EntryLexicalForm.ToString(),
										"LexEntry",
										vernacularWritingSystemIds));
			_viewTemplate.Add(new Field("Note",
										"LexEntry",
										new string[] {"en"},
										Field.MultiplicityType.ZeroOr1,
										"MultiText"));
			_lexEntryRepository = new LexEntryRepository(_filePath);
			_task = new DictionaryTask( DictionaryBrowseAndEditConfiguration.CreateForTests(),  _lexEntryRepository, _viewTemplate);//, new UserSettingsForTask());
		}
Esempio n. 2
0
		public void CreateAndActivate_UserSettingsIsEmpty_Ok()
		{
			var task = new DictionaryTask(DictionaryBrowseAndEditConfiguration.CreateForTests(), _lexEntryRepository, _viewTemplate);//, new UserSettingsForTask());
			task.Activate();
			task.Deactivate();
		}
Esempio n. 3
0
		public override void Setup()
		{
			base.Setup();
			_tempFolder = new TemporaryFolder();
			_vernacularWritingSystem =
					new WritingSystem(BasilProject.Project.WritingSystems.TestWritingSystemVernId,
									  SystemFonts.DefaultFont);
			RtfRenderer.HeadWordWritingSystemId = _vernacularWritingSystem.Id;

			_filePath = _tempFolder.GetTemporaryFile();
			_lexEntryRepository = new LexEntryRepository(_filePath);

			string[] analysisWritingSystemIds = new string[]
													{
															BasilProject.Project.WritingSystems.
																	TestWritingSystemAnalId
													};
			string[] vernacularWritingSystemIds = new string[] {_vernacularWritingSystem.Id};
			ViewTemplate viewTemplate = new ViewTemplate();
			viewTemplate.Add(new Field(Field.FieldNames.EntryLexicalForm.ToString(),
									   "LexEntry",
									   vernacularWritingSystemIds));
			viewTemplate.Add(new Field("focusOnMe",
									   "LexEntry",
									   analysisWritingSystemIds,
									   Field.MultiplicityType.ZeroOr1,
									   "MultiText"));
			viewTemplate.Add(new Field("MyEntryCustom",
									   "LexEntry",
									   analysisWritingSystemIds,
									   Field.MultiplicityType.ZeroOr1,
									   "MultiText"));

			Field readOnlySemanticDomain =
					new Field(LexSense.WellKnownProperties.SemanticDomainsDdp4,
							  "LexSense",
							  analysisWritingSystemIds);
			readOnlySemanticDomain.Visibility = CommonEnumerations.VisibilitySetting.ReadOnly;
			viewTemplate.Add(readOnlySemanticDomain);

			Field shy1 = new Field("MyShyEntryCustom",
								   "LexEntry",
								   analysisWritingSystemIds,
								   Field.MultiplicityType.ZeroOr1,
								   "MultiText");
			shy1.Visibility = CommonEnumerations.VisibilitySetting.NormallyHidden;
			shy1.DisplayName = "MyShyEntryCustom";
			viewTemplate.Add(shy1);

#if GlossMeaning
			viewTemplate.Add(new Field(Field.FieldNames.SenseGloss.ToString(), "LexSense", analysisWritingSystemIds));
#else
			_definitionField = new Field(LexSense.WellKnownProperties.Definition,
										 "LexSense",
										 analysisWritingSystemIds);
			viewTemplate.Add(_definitionField);
#endif
			viewTemplate.Add(new Field("MySenseCustom",
									   "LexSense",
									   analysisWritingSystemIds,
									   Field.MultiplicityType.ZeroOr1,
									   "MultiText"));
			viewTemplate.Add(new Field(Field.FieldNames.ExampleSentence.ToString(),
									   "LexExampleSentence",
									   vernacularWritingSystemIds));
			viewTemplate.Add(new Field(Field.FieldNames.ExampleTranslation.ToString(),
									   "LexExampleSentence",
									   analysisWritingSystemIds));

			_firstEntryGuid = AddEntry("Initial", analysisWritingSystemIds[0], "meaning", true);
			_secondEntryGuid = AddEntry("Secondary", analysisWritingSystemIds[0], "secondarymeaning", false);
			AddEntry("Tertiary", analysisWritingSystemIds[0], "meaning", true);

			Field customField = new Field("SemanticDomains",
										  "LexSense",
										  analysisWritingSystemIds,
										  Field.MultiplicityType.ZeroOr1,
										  "OptionCollection");
			customField.DisplayName = "Sem Dom";
			customField.OptionsListFile = "SemanticDomains.xml";
			viewTemplate.Add(customField);

			Field customPOSField = new Field(LexSense.WellKnownProperties.PartOfSpeech,
											 "LexSense",
											 analysisWritingSystemIds,
											 Field.MultiplicityType.ZeroOr1,
											 "Option");
			customPOSField.DisplayName = "POS";
			customPOSField.OptionsListFile = "PartsOfSpeech.xml";
			viewTemplate.Add(customPOSField);

			Field customNotesField = new Field(WeSayDataObject.WellKnownProperties.Note,
											   "LexSense",
											   analysisWritingSystemIds);
			customNotesField.DisplayName = "s-note";
			viewTemplate.Add(customNotesField);

			Field exampleNotesField = new Field(WeSayDataObject.WellKnownProperties.Note,
												"LexExampleSentence",
												analysisWritingSystemIds);
			exampleNotesField.DisplayName = "ex-note";
			viewTemplate.Add(exampleNotesField);

			_task = new DictionaryTask(DictionaryBrowseAndEditConfiguration.CreateForTests(), _lexEntryRepository, viewTemplate);//, new UserSettingsForTask());
			_detailTaskPage = new TabPage();
			ActivateTask();

			_tabControl = new TabControl();

			_tabControl.Dock = DockStyle.Fill;
			_tabControl.TabPages.Add(_detailTaskPage);
			_tabControl.TabPages.Add(new TabPage("Dummy"));
			_window = new Form();
			_window.Controls.Add(_tabControl);
			_window.Width = 700;
			_window.Height = 500;
			_window.Show();
		}