예제 #1
0
        public object Clone() {
            Bookmark bookmark = new Bookmark();
            bookmark.Path = this.Path;
            bookmark.DisplayName = this.DisplayName;
            bookmark.ProviderIdentifier = this.ProviderIdentifier;

            return bookmark;
        }
        public Bookmark AddBookmark(Bookmark bookmark) {
            Bookmark existing = this.GetBookmarkWithPath(bookmark.Path);

            if (existing != null) {
                return existing;
            }

            lock (_Bookmarks) {
                _Bookmarks.Add(bookmark);
            }

            return bookmark;
        }
        public Bookmark AddBookmarkWithPath(string path, string displayName, string providerIdentifier) {
            Bookmark bookmark = this.GetBookmarkWithPath(path);

            if (bookmark != null) {
                return bookmark;
            }
                
            bookmark = new Bookmark(path, displayName, providerIdentifier);
            if (providerIdentifier.Length == 0) {
                bookmark.ProviderIdentifier = VagrantManager.Instance.DetectVagrantProvider(path);
            }

            lock(_Bookmarks) {
                _Bookmarks.Add(bookmark);
            }
                
            return bookmark;
        }