ENVDTE中声明的类变量 [英] Type of declared Class Varaible in ENVDTE

查看:74
本文介绍了ENVDTE中声明的类变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道使用 CodeVariable
CodeElement 类的2个声明的类变量的数据类型。



我能找到,如果这个变量声明为私有和其他细节,但不知道如何检查此声明变量的数据类型。




  变量的数据类型应为 DataGridRow





解决方案


自动化模型(EnvDTE) )有一些限制:


- 方法级别的变量/常量:不支持


- 变量/常量at类级别:您获得有关变量/常量类型的有限信息:

EnvDTE.CodeVariable.Type
,返回
CodeTypeRef


为了获得更好的支持,在VS 2015及更高版本中,您可以使用Roslyn( .NET编译器平台),即VS使用的相同解析器/编译器/解析器等。


I want to know the data type of 2 declared class variables using CodeVariable or CodeElement class.

I am able to find that if this variable declared as private and other details but not know how to check the data type of this declared variable.

data type of row variable should be DataGridRow.

解决方案

Hi,

The automation model (EnvDTE) has some limitations:

- Variables/constants at method level: not supported

- Variables/constants at class level: you get limited information about the type of the variable/constant: EnvDTE.CodeVariable.Type, which returns a CodeTypeRef

For better support, in VS 2015 and higher you can use Roslyn (.NET Compiler Platform), that is, the same parser/compiler/resolver, etc. that VS uses.


这篇关于ENVDTE中声明的类变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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