点击或拖拽改变大小

NeedsAccessToLocalsAttribute 类

X#
This class is used to mark methods, properties etc. that want access to Local Variables by name.
继承层次
Object
  Attribute
    NeedsAccessToLocalsAttribute

命名空间:  XSharp.Internal
程序集:  XSharp.Core (在 XSharp.Core.dll 中) 版本:2.22 GA
语法
[AttributeUsageAttribute(AttributeTargets.Constructor|AttributeTargets.Method|AttributeTargets.Property)]
 SEALED CLASS NeedsAccessToLocalsAttribute INHERIT Attribute
查看代码

NeedsAccessToLocalsAttribute 类型公开以下成员。

构造函数
  名称说明
公共方法NeedsAccessToLocalsAttribute
初始化 NeedsAccessToLocalsAttribute 类的一个新实例
Top
属性
  名称说明
公共属性WritesToLocals
Top
备注
In FoxPro several built-in functions have access to locals "by name". We can't do that because it violates the normal rules of encapsulation. However we can "emulate" this behavior by adding this attribute to a function or method that wants access to locals. At runtime we will then populate a table in the runtime with the names and values of local variables And we can access this table with the normal MemVarGet() and MemVarPut() functions.
参见