public override MarshalByRefObject CreateInstance(Type cmdLineObjType) { if (_dictService.ContainsKey(cmdLineObjType)) { return((MarshalByRefObject)_dictService.GetValue(cmdLineObjType).GetTransparentProxy()); } lock (_dictService.SyncRoot) { if (_dictService.ContainsKey(cmdLineObjType)) { return((MarshalByRefObject)_dictService.GetValue(cmdLineObjType).GetTransparentProxy()); } else { //ChoCmdLineArgMetaDataManager.LoadFromConfig(cmdLineObjType, this); RealProxy proxy = new ChoCommandLineArgsObjectProxy(base.CreateInstance(cmdLineObjType), cmdLineObjType); _dictService.SetValue(cmdLineObjType, proxy); //if (ChoType.GetAttribute<ChoIgnorePrintHeaderAttribute>(cmdLineObjType) == null) PrintHeader(); return((MarshalByRefObject)proxy.GetTransparentProxy()); } } }
public override MarshalByRefObject CreateInstance(Type configObjType) { if (_dictService.ContainsKey(configObjType)) { return((MarshalByRefObject)_dictService.GetValue(configObjType).GetTransparentProxy()); } lock (_dictService.SyncRoot) { if (_dictService.ContainsKey(configObjType)) { return((MarshalByRefObject)_dictService.GetValue(configObjType).GetTransparentProxy()); } else { RealProxy proxy = new ChoCommandLineArgsObjectProxy(base.CreateInstance(configObjType), configObjType); _dictService.SetValue(configObjType, proxy); PrintHeader(); return((MarshalByRefObject)proxy.GetTransparentProxy()); } } }