public Type GetProxyType(Type classType) { if (classType == null) { throw new ArgumentNullException(nameof(classType)); } if (!_validator.Validate(classType)) { throw new ArgumentException($"{classType.FullName} is an illegal type"); } var proxyType = _collection.GetProxyType(null, classType); if (proxyType == null) { lock (_sync) { proxyType = _collection.GetProxyType(null, classType); if (proxyType == null) { proxyType = _generator.GenerateProxyByClass(classType); } _collection.Add(null, classType, proxyType); } } return(proxyType); }
private void btnCreate_Click(object sender, EventArgs e) { _people.Add(new Person()); }