这个关键字在某些情况下并不清楚

Pra*_*age 0 c#

当我编写代码时,我遇到了像这样的函数=>

public RelayCommand(Action<object> execute): this(execute, null)
Run Code Online (Sandbox Code Playgroud)

我真的不知道这里的"这个"关键词用法

Ed *_* S. 5

它是构造函数链接. this(execute, null)调用在该类中定义的另一个构造函数,该构造函数接受一个Action<object>和其他值.例如:

class Whatever
{
    public Whatever() : this("string arg") {}  // calls Whatever(string)

    public Whatever(string something) {}
}
Run Code Online (Sandbox Code Playgroud)