0
public abstract class InstallationStepLibrary
{
private Dictionary<string, InstallationStep> DictSteps;
protected InstallationStepLibrary()
{
DictSteps = new Dictionary<string, InstallationStep>();
}
public InstallationStep this[string s]
{
get
{
return DictSteps[s];
}
set
{
DictSteps[s] = value;
}
}
protected void NewStep(string name, InstallationStep step)
{
this[name] = step;
}
}
나는 처음 사용 '이'InstallationStep
의 정의에서 생성자 체인있다, 그러나 내가 알아낼 수 없습니다 것으로 생각하는 방법 두 번째 '이 [이름]'인텔리 저 클래스 InstallationStepLibrary
에 스코프 알려줍니다 (이되는 의미가 있습니다 ...) 유효한 구문이 될 수 있지만 그것은 있습니다. 그것은 사전에 범위 경우가 나을이 예제에서 두 번째 []의 목적은 무엇입니까?
...
[name] = step;'은 인덱서를 사용합니다. –
사전에 전용 수정 자, 인덱서가 있습니다.이 [string s]는 액세스 권한을 제공합니다. – Ryan