コード例 #1
0
ファイル: ViewFilter.cs プロジェクト: hesam/SketchSharp
 /// <include file='doc\ViewFilter.uex' path='docs/doc[@for="ViewFilter.ViewFilter"]/*' />
 public ViewFilter(CodeWindowManager mgr, IVsTextView view) {
     this.pvaChar = IntPtr.Zero;
     this.mgr = mgr;
     this.service = mgr.LanguageService;
     this.source = mgr.Source;
     this.commentSupported = this.service.Preferences.EnableCommenting;
     this.textView = view;
     NativeMethods.ThrowOnFailure(view.AddCommandFilter(this, out nextTarget));
     this.textViewEvents = new NativeMethods.ConnectionPointCookie(view, this, typeof(IVsTextViewEvents));
 }
コード例 #2
0
ファイル: ViewFilter.cs プロジェクト: hesam/SketchSharp
        /// <include file='doc\ViewFilter.uex' path='docs/doc[@for="ViewFilter.Close"]/*' />
        public virtual void Close() {
            Trace.WriteLine("ViewFilter::Close");

            if (textViewEvents != null) {
                textViewEvents.Dispose();
                textViewEvents = null;
            }

            if (textView == this.service.LastActiveTextView)
                this.service.OnActiveViewChanged(null);

            textView.RemoveCommandFilter(this); // do not care about HRESULT.
            if (textTipData != null) {
                textTipData.Close(textView);
                textTipData = null;
            }

            Dispose();
        }
コード例 #3
0
ファイル: Preferences.cs プロジェクト: hesam/SketchSharp
 private void Disconnect() {
     if (this.connection != null) {
         this.connection.Dispose();
         this.connection = null;
     }
 }
コード例 #4
0
ファイル: Preferences.cs プロジェクト: hesam/SketchSharp
 private void Connect() {
     if (this.connection == null && this.site != null) {
         IVsTextManager2 textMgr2 = this.site.GetService(typeof(SVsTextManager)) as IVsTextManager2;
         if (textMgr2 != null) {
             this.connection = new NativeMethods.ConnectionPointCookie(textMgr2, (IVsTextManagerEvents2)this, typeof(IVsTextManagerEvents2));
             Marshal.ReleaseComObject(textMgr2);
         }
     }
 }
コード例 #5
0
 /// <include file='doc\ViewFilter.uex' path='docs/doc[@for="ViewFilter.RegisterTextViewEventHandlers"]/*' />
 public virtual void RegisterTextViewEventHandlers(IVsTextView view)
 {
     this.textViewEvents = new NativeMethods.ConnectionPointCookie(view, this, typeof(IVsTextViewEvents));
 }
コード例 #6
0
 /// <include file='doc\ViewFilter.uex' path='docs/doc[@for="ViewFilter.RegisterTextViewEventHandlers"]/*' />
 public virtual void RegisterExpansionManagerEventHandlers(IVsExpansionManager emgr)
 {
     this.expansionEvents = new NativeMethods.ConnectionPointCookie(emgr, this, typeof(IVsExpansionEvents));
 }