Var textManager = (IVsTextManager)ServiceProvider.GetService( typeof(SVsTextManager)) ĮrrorHandler.ThrowOnFailure(textManager. Public IVsTextView GetCurrentNativeTextView( ) Return editorAdapter.GetWpfTextView(GetCurrentNativeTextView()) IVsEditorAdaptersFactoryService editorAdapter = compService.GetService() Var compService = ServiceProvider.GetService( typeof(SComponentModel)) as IComponentModel Public IWpfTextView GetCurrentTextView( ) MethodLogic.GoToFile( wpfTextView, dte) MethodLogic methodLogic = new MethodLogic( ) This.wpfTextView = GetCurrentTextView( ) Private void Execute( object sender, EventArgs e) These are the top rated real world Python examples of pyvim.gotofile extracted from open source projects. / OleMenuCommandService service and MenuCommand class. / See the constructor to see how the menu item is associated with this function using / This function is the callback used to execute the command when the menu item is clicked. ![]() Instance = new CommandGoToFile( package, commandService ) OleMenuCommandService commandService = await package.GetServiceAsync( typeof( IMenuCommandService ) ) as OleMenuCommandService Switch to the main thread - the call to AddCommand in CommandGoToFile's constructor requiresĪwait ( package.DisposalToken ) ĭte = (DTE) await package.GetServiceAsync( typeof(DTE)) Public static async Task InitializeAsync( AsyncPackage package) / Initializes the singleton instance of the command. / Gets the service provider from the owner package. Var menuItem = new MenuCommand( this.Execute, menuCommandID ) Var menuCommandID = new CommandID( CommandSet, CommandId ) This.package = package ? throw new ArgumentNullException( nameof( package ) ) ĬommandService = commandService ? throw new ArgumentNullException( nameof( commandService ) ) Private CommandGoToFile( AsyncPackage package, OleMenuCommandService commandService) / Command service to add command to, not null. ![]() / Adds our command handlers for menu (commands must exist in the command table file) ![]() / Initializes a new instance of the class. / VS Package that provides this command, not null. / Command menu group (command set GUID). Public void Toggle( IWpfTextView wpfTextView) Var result = Path.Combine( dirName, path) Var result = Path.Combine(slnDir, first.Value, path) ĭte.ItemOperations.OpenFile( result, Constants.vsViewKindAny ) String dirName = Path.GetDirectoryName( currentDocumentPath ) Var match = Regex.Match(substractPath, first = match.Groups String substractPath = currentDocumentPath.Replace( slnDir, "" ) If(File.Exists(path) = true) ( path, Constants.vsViewKindAny ) Public void GoToFile( IWpfTextView wpfTextView, DTE dte)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |