public static PersistedBookmark Create(string bookmarkFileName) { var stream = File.Open(bookmarkFileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read); try { var bookmark = new PersistedBookmark(stream); bookmark.Read(); stream = null; return bookmark; } finally { if (stream != null) stream.Dispose(); } }
public static PersistedBookmark Create(string bookmarkFileName) { var stream = File.Open(bookmarkFileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read); try { var bookmark = new PersistedBookmark(stream); bookmark.Read(); stream = null; return(bookmark); } finally { if (stream != null) { stream.Dispose(); } } }