Exemplo n.º 1
0
        /// <summary>
        /// The CodeWindowManager is constructed by the base LanguageService class when VS calls
        /// the IVsLanguageInfo.GetCodeWindowManager method.  You can override CreateCodeWindowManager
        /// on your LanguageService if you want to plug in a different CodeWindowManager.
        /// </summary>
        internal CodeWindowManager(LanguageService_DEPRECATED service, IVsCodeWindow codeWindow, ISource source)
        {
            this.service     = service;
            this.codeWindow  = codeWindow;
            this.viewFilters = new ArrayList();
            this.source      = source;
#if DOCUMENT_PROPERTIES
            this.properties = service.CreateDocumentProperties(this);
#endif
        }
Exemplo n.º 2
0
        /// <summary>Closes all view filters, and the document properties window</summary>
        internal void Close()
        {
#if     LANGTRACE
            Trace.WriteLine("CodeWindowManager::Close");
#endif
#if DOCUMENT_PROPERTIES
            if (this.properties != null)
            {
                this.properties.Close();
            }
#endif
            CloseFilters();
            this.viewFilters = null;
#if DOCUMENT_PROPERTIES
            properties = null;
#endif
            service         = null;
            source          = null;
            this.codeWindow = null;
        }
Exemplo n.º 3
0
        /// <summary>Returns S_OK if match found, S_FALSE if expansion UI is shown, and error otherwise</summary>
        internal virtual int FindExpansionByShortcut(IVsTextView view, string shortcut, TextSpan span, bool showDisambiguationUI, out string title, out string path)
        {
            if (this.expansionActive)
            {
                this.EndTemplateEditing(true);
            }
            this.view = view;
            title     = path = null;

            LanguageService_DEPRECATED svc = this.source.LanguageService;
            IVsExpansionManager        mgr = svc.Site.GetService(typeof(SVsExpansionManager)) as IVsExpansionManager;

            if (mgr == null)
            {
                return(NativeMethods.E_FAIL);
            }
            Guid guidLanguage = svc.GetLanguageServiceGuid();

            TextSpan[] pts = new TextSpan[1];
            pts[0] = span;
            int hr = mgr.GetExpansionByShortcut(this, guidLanguage, shortcut, this.TextView, pts, showDisambiguationUI ? 1 : 0, out path, out title);

            return(hr);
        }
Exemplo n.º 4
0
 /// <summary>
 /// This method is called to update the drop down bars to match the current contents of the text editor window.
 /// It is called during OnIdle when the caret position changes.  You can provide new drop down members here.
 /// It is up to you to sort the ArrayLists if you want them sorted in any particular order.
 /// </summary>
 /// <param name="languageService">The language service</param>
 /// <param name="textView">The editor window</param>
 /// <param name="line">The line on which the cursor is now positioned</param>
 /// <param name="col">The column on which the cursor is now position</param>
 /// <param name="dropDownTypes">The current list of types (you can update this)</param>
 /// <param name="dropDownMembers">The current list of members (you can update this)</param>
 /// <param name="selectedType">The selected type (you can update this)</param>
 /// <param name="selectedMember">The selected member (you can update this)</param>
 /// <returns>true if something was updated</returns>
 public abstract bool OnSynchronizeDropdowns(LanguageService_DEPRECATED languageService, IVsTextView textView, int line, int col, ArrayList dropDownTypes, ArrayList dropDownMembers, ref int selectedType, ref int selectedMember);
Exemplo n.º 5
0
 protected TypeAndMemberDropdownBars(LanguageService_DEPRECATED languageService)
 {
     this.languageService = languageService;
     this.dropDownTypes   = new ArrayList();
     this.dropDownMembers = new ArrayList();
 }