protected override void OnClosed(EventArgs e) { base.OnClosed(e); base.Dispose(); this.codeCompletionListView.Dispose(); this.codeCompletionListView = null; this.declarationViewWindow.Dispose(); this.declarationViewWindow = null; }
private CodeCompletionWindow(ICompletionDataProvider completionDataProvider, Form parentForm, TextEditorControl control, string fileName) : base(parentForm, control, fileName) { this.workingScreen = Screen.GetWorkingArea(base.Location); this.startOffset = control.ActiveTextAreaControl.Caret.Offset + 1; this.endOffset = this.startOffset; if (completionDataProvider.PreSelection != null) { this.startOffset -= completionDataProvider.PreSelection.Length + 1; this.endOffset--; } this.codeCompletionListView = new CodeCompletionListView(CodeCompletionWindow.completionData); this.codeCompletionListView.ImageList = completionDataProvider.ImageList; this.codeCompletionListView.Dock = DockStyle.Fill; this.codeCompletionListView.SelectedItemChanged += new EventHandler(this.CodeCompletionListViewSelectedItemChanged); this.codeCompletionListView.DoubleClick += new EventHandler(this.CodeCompletionListViewDoubleClick); this.codeCompletionListView.Click += new EventHandler(this.CodeCompletionListViewClick); base.Controls.Add(this.codeCompletionListView); if (CodeCompletionWindow.completionData.Length > 10) { this.vScrollBar.Dock = DockStyle.Right; this.vScrollBar.Minimum = 0; this.vScrollBar.Maximum = CodeCompletionWindow.completionData.Length - 8; this.vScrollBar.SmallChange = 1; this.vScrollBar.LargeChange = 3; this.codeCompletionListView.FirstItemChanged += new EventHandler(this.CodeCompletionListViewFirstItemChanged); base.Controls.Add(this.vScrollBar); } this.drawingSize = new Size(this.codeCompletionListView.ItemHeight * 10, this.codeCompletionListView.ItemHeight * Math.Min(10, CodeCompletionWindow.completionData.Length)); this.SetLocation(); this.declarationViewWindow = new DeclarationViewWindow(parentForm); this.SetDeclarationViewLocation(); this.declarationViewWindow.ShowDeclarationViewWindow(); control.Focus(); this.CodeCompletionListViewSelectedItemChanged(this, EventArgs.Empty); if (completionDataProvider.PreSelection != null) { this.CaretOffsetChanged(this, EventArgs.Empty); } this.vScrollBar.Scroll += new ScrollEventHandler(this.DoScroll); }