PostSharp:如何获取 ILocationBinding
我正在写一个基于位置的方面。 OnGetValue
方法获取 LocationInterceptionArgs
类型的参数,允许我访问原始属性(或者,如果有多个活动方面,则可以访问链中的下一个级别)调用)。
现在我想在 OnGetValue
方法之外的不同时间读取该属性。来自 文档,我发现我需要一个 ILocationBinding
的实例,然后我可以随时致电。我可以在第一次调用 OnGetValue
时从 LocationInterceptionArgs
参数中保存 ILocationBinding
。但我想在第一次调用 getter 之前访问该值。
如何在调用 OnGetValue
之前获取 ILocationBinding
实例?
I'm writing a location-based aspect. The OnGetValue
method gets an argument of type LocationInterceptionArgs
, allowing me to access the original property (or, if there are multiple active aspects, to access the next level in the chain of invocation).
Now I want to read the property at various times outside the OnGetValue
method. From the documentation, I gather that I need an instance of ILocationBinding
, which I can then call at any time. I could save the ILocationBinding
from the LocationInterceptionArgs
argument the first time OnGetValue
is called. But I want to access the value before the getter is called for the first time.
How can I get an ILocationBinding
instance before OnGetValue
is called?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
绑定位于 LocationInterceptionArgs.Binding 中。
The binding is in LocationInterceptionArgs.Binding.