/// <inheritdoc/> public override void OnApplyTemplate() { base.OnApplyTemplate(); listBox = GetTemplateChild("PART_ListBox") as CompletionListBox; if (listBox != null) { listBox.ItemsSource = completionData; } }
/// <inheritdoc/> public override void OnApplyTemplate() { base.OnApplyTemplate(); listBox = GetTemplateChild("PART_ListBox") as CompletionListBox; if (listBox != null) { listBox.ItemsSource = completionData; if (completionData.Count > 0) { listBox.SelectIndex(0); } } }
/// <inheritdoc/> public override void OnApplyTemplate() { base.OnApplyTemplate(); listBox = GetTemplateChild("PART_ListBox") as CompletionListBox; if (listBox != null) { listBox.ItemsSource = completionData; if (AvalonEditDarkThemeUtility.DarkTheme) { listBox.Background = new SolidColorBrush(Color.FromArgb(255, 40, 40, 40)); listBox.Foreground = new SolidColorBrush(Color.FromArgb(255, 230, 230, 230)); } //listBox.Background = new SolidColorBrush( Color.FromArgb( 255, 10, 10, 10 ) ); //////listBox.Background = new SolidColorBrush( Color.FromArgb( 255, 40, 40, 40 ) ); //listBox.Foreground = new SolidColorBrush( Color.FromArgb( 255, 230, 230, 230 ) ); } }
public void FilterByKind(object obs, bool add = true) { ICSharpCode.AvalonEdit.CodeCompletion.CompletionListBox c = completionList.ListBox; var b = completionList.Master; List <CsCompletionData> d = new List <CsCompletionData>(); if (add) { if (allitems == false) { foreach (var bc in c.Items) { d.Add(bc as CsCompletionData); } } for (int i = 0; i < completionList.Master.Count; i++) { CsCompletionData dd = (CsCompletionData)completionList.Master[i]; if (CompletionControls.GetHashCode(dd.obs) == (int)obs) { d.Add(dd); } //if (obs is SymbolKind) //{ // SymbolKind s = (SymbolKind)obs; // if (dd.obs is SymbolKind) // if (s == (SymbolKind)dd.obs) // d.Add(dd); //} //else if (obs is TypeKind) //{ // TypeKind s = (TypeKind)obs; // if (dd.obs is TypeKind) // if (s == (TypeKind)dd.obs) // d.Add(dd); //} else if (obs is CsCompletionData) //{ // string s = ((CsCompletionData)obs).obs as string; // if (dd.obs is string) // if ( s == (string)dd.obs) // d.Add(dd); //} } } else { foreach (var bc in c.Items) { d.Add(bc as CsCompletionData); } for (int i = 0; i < c.Items.Count; i++) { CsCompletionData dd = (CsCompletionData)c.Items[i]; if (CompletionControls.GetHashCode(dd.obs) == (int)obs) { d.Remove(dd); } //if (obs is SymbolKind) //{ // SymbolKind s = (SymbolKind)obs; // if (dd.obs is SymbolKind) // if (s == (SymbolKind)dd.obs) // d.Remove(dd); //} //else if (obs is TypeKind) //{ // TypeKind s = (TypeKind)obs; // if (dd.obs is TypeKind) // if (s == (TypeKind)dd.obs) // d.Remove(dd); //} //if (obs is CsCompletionData) //{ // string s = ((CsCompletionData)obs).obs as string; // if (dd.obs is string) // if (s == (string)dd.obs) // d.Remove(dd); //} } } c.ItemsSource = d; }