Esempio n. 1
0
		public void EmptyViewTemplate()
		{
			LexEntry entry = GetNewEntry();

			using (DetailList dl = new DetailList())
			{
				LexEntryLayouter layout = new LexEntryLayouter(dl, new ViewTemplate(), null);
				_rowCount = layout.AddWidgets(entry);
				Assert.AreEqual(0, _rowCount);
			}
		}
Esempio n. 2
0
        public void EmptyViewTemplateWithMinorLabel()
        {
            LexEntry entry = GetNewEntry();

            using (DetailList dl = new DetailList())
            {
                LexEntryLayouter layout = new LexEntryLayouter(dl, 0, new ViewTemplate(), null, Context, entry, false, () => new TestConfirmDelete(), true);
                layout.AddWidgets();
                Assert.AreEqual(0, dl.RowCount);
            }
        }
Esempio n. 3
0
        private DetailList MakeDetailList(bool showNormallyHiddenFields, bool showMinorMeaningLabel, ViewTemplate template)
        {
            //TODO need tests for other data types when made optional
            //TODO need tests for showing non-empty optional tests in non-show-all mode

            LexEntry entry = GetNewEntry();

            DetailList       dl     = new DetailList();
            LexEntryLayouter layout = new LexEntryLayouter(dl, 0, template, null, Context, entry, false, () => new TestConfirmDelete(), showMinorMeaningLabel);

            layout.ShowNormallyHiddenFields = showNormallyHiddenFields;
            layout.AddWidgets();
            _rowCount = dl.RowCount;
            return(dl);
        }
Esempio n. 4
0
		private DetailList MakeDetailList(bool showNormallyHiddenFields)
		{
			string[] analysisWritingSystemIds = new string[]
													{
															BasilProject.Project.WritingSystems.
																	TestWritingSystemAnalId
													};
			string[] vernacularWritingSystemIds = new string[]
													  {
															  BasilProject.Project.WritingSystems.
																	  TestWritingSystemVernId
													  };
			ViewTemplate viewTemplate = new ViewTemplate();
			Field field = new Field(Field.FieldNames.EntryLexicalForm.ToString(),
									"LexEntry",
									vernacularWritingSystemIds);
			field.DisplayName = "Word";
			viewTemplate.Add(field);
#if GlossMeaning
			string meaningFieldName = Field.FieldNames.SenseGloss.ToString();
#else
			string meaningFieldName = LexSense.WellKnownProperties.Definition;
#endif
			viewTemplate.Add(new Field(meaningFieldName, "LexSense", analysisWritingSystemIds));
			viewTemplate.Add(new Field(Field.FieldNames.ExampleSentence.ToString(),
									   "LexExampleSentence",
									   vernacularWritingSystemIds));
			viewTemplate.Add(new Field(Field.FieldNames.ExampleTranslation.ToString(),
									   "LexExampleSentence",
									   analysisWritingSystemIds));

			Field rare = new Field("rare", "LexSense", analysisWritingSystemIds);
			rare.Visibility = CommonEnumerations.VisibilitySetting.NormallyHidden;
			viewTemplate.Add(rare);

			//TODO need tests for other data types when made optional
			//TODO need tests for showing non-empty optional tests in non-show-all mode

			LexEntry entry = GetNewEntry();

			DetailList dl = new DetailList();
			LexEntryLayouter layout = new LexEntryLayouter(dl, viewTemplate, null);
			layout.ShowNormallyHiddenFields = showNormallyHiddenFields;
			_rowCount = layout.AddWidgets(entry);
			return dl;
		}