public Stream CreateOpenWrite(string file, bool overwrite) { if (_underlayingResource == null) { return(null); } using (ServiceRegistration.Get <IImpersonationService>().CheckImpersonationFor(CanonicalLocalResourcePath)) return(_underlayingResource.CreateOpenWrite(file, overwrite)); }