添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
飞翔的小刀  ·  在 Monaco Editor ...·  2 月前    · 
风流倜傥的香烟  ·  分类 | woodwhale's blog·  3 月前    · 
发怒的花卷  ·  Kindle ...·  3 月前    · 

NET.interfaceView

Explicit interface view of .NET object

Since R2023b

Description

example

view = NET.interfaceView( obj , typename ) creates an explicit view of a .NET object as one of its implemented interfaces. Use view to access members of the .NET interface type typename that are explicitly implemented by obj . For more information, see the MSDN ® article Explicit Interface Implementation .

Examples

collapse all

Inspect methods of the System.IConvertible interface of a System.String object.

Create an IConvertible interface object from System.String .

str = System.String("Hello, world!");
itf = NET.interfaceView(str,"System.IConvertible");

System.String has methods such as ToLower which manipulate strings. The interface object has conversion methods to cast the object to different types, such as the datetime type using the ToDateTime method. Compare the output of these commands:

str.To<tab>
itf.To<tab>

Input Arguments

collapse all

Object to view, specified as a .NET object that implements an interface.

Namespace-qualified name of a .NET interface type, specified as a string or a character vector.

Example: "System.IConvertible"

Version History

Introduced in R2023b

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.