public override IInsightWindow ShowInsightWindow(IEnumerable<IInsightItem> items) { if (items == null) return null; var insightWindow = textEditor.ActiveInsightWindow; bool isNewWindow = false; if (insightWindow == null) { insightWindow = new SharpDevelopInsightWindow(this.TextEditor.TextArea); isNewWindow = true; } var adapter = new SharpDevelopInsightWindowAdapter(insightWindow); adapter.Items.AddRange(items); if (adapter.Items.Count > 0) { adapter.SelectedItem = adapter.Items[0]; } else { // don't open insight window when there are no items return null; } insightWindow.SetActiveAdapter(adapter, isNewWindow); if (isNewWindow) { textEditor.ShowInsightWindow(insightWindow); } return adapter; }
public override IInsightWindow ShowInsightWindow(IEnumerable <IInsightItem> items) { if (items == null) { return(null); } var insightWindow = textEditor.ActiveInsightWindow; bool isNewWindow = false; if (insightWindow == null) { insightWindow = new SharpDevelopInsightWindow(this.TextEditor.TextArea); isNewWindow = true; } var adapter = new SharpDevelopInsightWindowAdapter(insightWindow); adapter.Items.AddRange(items); if (adapter.Items.Count > 0) { adapter.SelectedItem = adapter.Items[0]; } else { // don't open insight window when there are no items return(null); } insightWindow.SetActiveAdapter(adapter, isNewWindow); if (isNewWindow) { textEditor.ShowInsightWindow(insightWindow); } return(adapter); }
internal void OnClosed() { if (Closed != null) { Closed(this, EventArgs.Empty); } insightWindow = null; }
internal SharpDevelopInsightWindowAdapter(SharpDevelopInsightWindow insightWindow) { this.insightWindow = insightWindow; provider = new SDItemProvider(this); provider.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "SelectedIndex") { OnSelectedItemChanged(EventArgs.Empty); } }; }
public override IInsightWindow ShowInsightWindow(IEnumerable<IInsightItem> items) { if (items == null) return null; var insightWindow = new SharpDevelopInsightWindow(this.TextEditor.TextArea); insightWindow.Items.AddRange(items); if (insightWindow.Items.Count > 0) { insightWindow.SelectedItem = insightWindow.Items[0]; } else { // don't open insight window when there are no items return null; } textEditor.ShowInsightWindow(insightWindow); return insightWindow; }
internal void ShowInsightWindow(SharpDevelopInsightWindow window) { CloseExistingInsightWindow(); insightWindow = window; window.Closed += delegate { insightWindow = null; }; Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action( delegate { if (insightWindow == window) { window.Show(); } } )); }
public override IInsightWindow ShowInsightWindow(IEnumerable <IInsightItem> items) { if (items == null) { return(null); } var insightWindow = new SharpDevelopInsightWindow(this.TextEditor.TextArea); insightWindow.Items.AddRange(items); if (insightWindow.Items.Count > 0) { insightWindow.SelectedItem = insightWindow.Items[0]; } else { // don't open insight window when there are no items return(null); } textEditor.ShowInsightWindow(insightWindow); return(insightWindow); }
public SDItemProvider(SharpDevelopInsightWindow insightWindow) { this.insightWindow = insightWindow; insightWindow.items.CollectionChanged += insightWindow_items_CollectionChanged; }
internal void OnClosed() { if (Closed != null) Closed(this, EventArgs.Empty); insightWindow = null; }
internal SharpDevelopInsightWindowAdapter(SharpDevelopInsightWindow insightWindow) { this.insightWindow = insightWindow; provider = new SDItemProvider(this); provider.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "SelectedIndex") OnSelectedItemChanged(EventArgs.Empty); }; }