public virtual Directive Create(String name, Stack directiveStack) { Type type = (Type)name2Type[name]; if (type == null) { if (directiveStack.Count != 0) { Directive parent = (Directive)directiveStack.Peek(); if (parent.SupportsNestedDirective(name)) { return(parent.CreateNestedDirective(name)); } } } else { return((Directive)Activator.CreateInstance(type)); } return(null); }
public virtual Directive Create(string name, Stack directiveStack) { Type type = (Type)this.name2Type[name]; Directive result; if (type != null) { result = (Directive)Activator.CreateInstance(type); } else { if (directiveStack.Count != 0) { Directive directive = (Directive)directiveStack.Peek(); if (directive.SupportsNestedDirective(name)) { result = directive.CreateNestedDirective(name); return(result); } } result = null; } return(result); }