private void OnClickAddCertainDefinition(WritingSystemTreeItem treeItem) { var suggestionItem = (WritingSystemCreationTreeItem)treeItem; var def = suggestionItem.ShowDialogIfNeededAndGetDefinition(); if (def != null) //if the didn't cancel { _setupModel.AddPredefinedDefinition(def); } }
private void AddOtherLanguages(List <WritingSystemTreeItem> items) { var item = new WritingSystemTreeItem("Other Languages", null); item.Children = new List <WritingSystemTreeItem>( from suggestion in Suggestor.GetOtherLanguageSuggestions( _setupModel.WritingSystemDefinitions) select(WritingSystemTreeItem) new WritingSystemCreationTreeItem(suggestion, OnClickAddCertainDefinition)); if (item.Children.Count() > 0) { items.Add(item); } }
private static void PrintExpectationsVsActual(string[] names, WritingSystemTreeItem[] items) { Console.Write("exp: "); names.ToList().ForEach(c => Console.Write(c + ", ")); Console.WriteLine(); Console.Write("got: "); foreach (var item in items) { Console.Write(item.Text+", "); item.Children.ForEach(c=>Console.Write(c.Text+", ")); } }
private void OnClickAddCertainDefinition(WritingSystemTreeItem treeItem) { var suggestionItem = (WritingSystemCreationTreeItem)treeItem; var def = suggestionItem.ShowDialogIfNeededAndGetDefinition(); if (def != null)//if the didn't cancel { _setupModel.AddPredefinedDefinition(def); } }
private void AddOtherLanguages(List<WritingSystemTreeItem> items) { var item = new WritingSystemTreeItem("Other Languages", null); item.Children = new List<WritingSystemTreeItem>( from suggestion in Suggestor.GetOtherLanguageSuggestions( _setupModel.WritingSystemDefinitions) select (WritingSystemTreeItem) new WritingSystemCreationTreeItem(suggestion, OnClickAddCertainDefinition)); if(item.Children.Count()>0) items.Add(item ); }
private void OnClickExistingDefinition(WritingSystemTreeItem treeItem) { _setupModel.SetCurrentDefinition(((WritingSystemDefinitionTreeItem)treeItem).Definition); }