예제 #1
0
        public void GotoEntry_EntryNotInList_Throws()
        {
            AddInitialEntries();
            DictionaryControl control = (DictionaryControl)_task.Control;

            Assert.Throws <NavigationException>(() => control.GoToEntryWithId("bogus"));
        }
예제 #2
0
        public void GotoUrl_SameAsCurrentUrl_Ok()
        {
            AddInitialEntries();
            DictionaryControl control = (DictionaryControl)_task.Control;

            control.GoToUrl(control.CurrentUrl);
        }
예제 #3
0
        public void GotoEntry_EntryInList_GoesToIt()
        {
            AddInitialEntries();
            DictionaryControl control     = (DictionaryControl)_task.Control;
            string            idOfInitial = control.CurrentEntry.Id;

            GoToLexicalEntryUseFind("Secondary");             //go away from that one
            control.GoToEntryWithId(idOfInitial);
            Assert.AreEqual(idOfInitial, control.CurrentEntry.Id);
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="dictControl"></param>
 private void FillDictionary(object obj, DictionaryControl dictControl)
 {
     if (obj is Dictionary <string, string> stringDictionary)
     {
         foreach (KeyValuePair <string, string> item in stringDictionary)
         {
             dictControl.AddItem(item.Key, item.Value);
         }
     }
     else if (obj is Dictionary <string, string[]> stringArrayDictionary)
     {
         foreach (KeyValuePair <string, string[]> item in stringArrayDictionary)
         {
             dictControl.AddItem(item.Key, string.Join(';', item.Value));
         }
     }
 }
예제 #5
0
		public override void Activate()
		{
			try
			{
				base.Activate();
				_dictionaryControl = new DictionaryControl(LexEntryRepository, ViewTemplate);
//   Debug.Assert(_userSettings.Get("one", "0") == "1");

				if(_userSettings !=null && _userSettings.Get("lastUrl", null)!=null)
					_dictionaryControl.GoToEntry(_userSettings.Get("lastUrl", null));
			}
			catch (ConfigurationException)
			{
				IsActive = false;
				throw;
			}
		}
예제 #6
0
		public void Construct_EmptyViewTemplate_NoCrash()
		{
			using (
					DictionaryControl e = new DictionaryControl(_lexEntryRepository,
																new ViewTemplate()))
			{
				Assert.IsNotNull(e);
			}
		}
예제 #7
0
		public override void Deactivate()
		{
			base.Deactivate();
			_dictionaryControl.Dispose();
			_dictionaryControl = null;
		}