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();
            }
        }
示例#2
0
        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();
                }
            }
        }