public static FileStream ToWriteStream(this FileInfo obj, FileMode mode) #endif { if (null == obj) { throw new ArgumentNullException("obj"); } #if NET20 if (!GenericExtensionMethods.In(mode, #else if (!mode.In( #endif FileMode.Create, FileMode.CreateNew, FileMode.Append, FileMode.Truncate)) { throw new ArgumentOutOfRangeException("mode"); } return(obj.Open(mode, FileAccess.Write, FileShare.Read)); }
public static FileStream ToWriteStream(this FileInfo obj, FileMode mode) #endif { if (null == obj) { throw new ArgumentNullException("obj"); } #if NET20 if (!GenericExtensionMethods.In(mode, #else if (!mode.In( #endif FileMode.Create, FileMode.CreateNew, FileMode.Append, FileMode.Truncate)) { throw new ArgumentOutOfRangeException("mode"); } return obj.Open(mode, FileAccess.Write, FileShare.Read); }