以编程方式在VS编辑器中打开“视图空白" [英] Turn on 'view whitespaces' in VS editor programmatically

查看:85
本文介绍了以编程方式在VS编辑器中打开“视图空白"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用插件与Visual Studio集成.我需要以编程方式在VS编辑器中打开视图空白".有办法做到吗?

I use addin for integration with visual studio. I need programmatically turn on 'view whitespaces' in VS editor. Is there a way to do this?

推荐答案

尝试:

DTE.ExecuteCommand("Edit.ViewWhiteSpace")

DTE.ExecuteCommand("Edit.ViewWhiteSpace")

在此之前,您可以使用DTE.Commands.Item("Edit.ViewWhiteSpace").IsAvailable来确保该命令可用,并且在执行命令时始终使用Try/Catch块始终是个好主意.

Prior you can ensure that the command is available using DTE.Commands.Item("Edit.ViewWhiteSpace").IsAvailable, and always it is a good idea to use a Try/Catch block when executing a command.


这篇关于以编程方式在VS编辑器中打开“视图空白"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆