Esempio n. 1
0
 private void OpenLists(IList <ListSearchResult> chosen)
 {
     foreach (var open in UniqueLists(chosen))
     {
         ListBuilder.Open(open.SetID).ScrollToResult(open);
     }
 }
Esempio n. 2
0
        /// <summary>Opens a ListBuilder for the given Word List, or focusses an existing ListBuilder
        /// if one exists.</summary>
        public static ListBuilder Open(long setID)
        {
            foreach (Form f in Application.OpenForms)
            {
                var lb = f as ListBuilder;
                if (lb == null || lb.WordList.ID != setID)
                {
                    continue;
                }

                lb.BringToFront();
                return(lb);
            }

            var list = DataStore.Database.GetWordList(setID);

            if (list == null)
            {
                return(null);
            }

            var form = new ListBuilder(list);

            form.Show();
            return(form);
        }
Esempio n. 3
0
        private void AddToListClick(object sender, EventArgs e)
        {
            var lb = new ListBuilder();

            AddEntries(lb);
            lb.Show();
        }
Esempio n. 4
0
        private void AddToExistingList(long listID)
        {
            var form = ListBuilder.Open(listID);

            if (form != null)
            {
                AddEntries(form);
            }
        }
Esempio n. 5
0
        static void OpenRecentFile(object sender, EventArgs e)
        {
            var info = (((ToolStripMenuItem)sender).Tag as ListInfo);

            if (info != null && info.ID.HasValue)
            {
                ListBuilder.Open(info.ID.Value);
            }
        }
Esempio n. 6
0
 private void ImportCompleted(WordList result)
 {
     Debug.Assert(!InvokeRequired, "ImportCompleted called on a secondary thread");
     importedWordList = result;
     CurrentUI        = null;
     if (importedWordList.ID.HasValue)
     {
         ListBuilder.Open(importedWordList.ID.Value);
     }
     Close();
 }
Esempio n. 7
0
 private void AddToListClick(object sender, EventArgs e)
 {
     var lb = new ListBuilder();
     AddEntries(lb);
     lb.Show();
 }
Esempio n. 8
0
 private void AddEntries(ListBuilder lb)
 {
     // TODO: Maybe pass this method an IEnumerable instead.
     lb.AddEntries(GetSelectedTranslationPairs());
 }
Esempio n. 9
0
		/// <summary>Opens a ListBuilder for the given Word List, or focusses an existing ListBuilder 
		/// if one exists.</summary>
		public static ListBuilder Open(long setID) {
			foreach (Form f in Application.OpenForms) {
				var lb = f as ListBuilder;
			    if (lb == null || lb.WordList.ID != setID)
			        continue;

			    lb.BringToFront();
			    return lb;
			}

			var list = DataStore.Database.GetWordList(setID);
			if (list == null)
				return null;

			var form = new ListBuilder(list);
			form.Show();
			return form;
		}
Esempio n. 10
0
 private void AddEntries(ListBuilder lb)
 {
     // TODO: Maybe pass this method an IEnumerable instead.
     lb.AddEntries(GetSelectedTranslationPairs());
 }