public FolderObject(string name, FolderObject fo) { this._name = name; _isRoot = false; _bookmarks = new List <string>(); _folders = new List <FolderObject>(); _parent = fo; }
private FolderObject __getFolder(string folderName) { foreach (FolderObject fo in _folders) { if (fo.Name == folderName) { return(fo); } } FolderObject newFO = new FolderObject(folderName, this); _folders.Add(newFO); return(newFO); }
private void __writeToFile(SortableBindingList <BookmarkObject> sbl) { string output = _startOfFile; FolderObject root = new FolderObject("Bookmarks", null); root.IsRoot = true; foreach (BookmarkObject bo in sbl) { root.Add(bo); } output += root.ToString(); output += _endOfFile; //TextBoxPop tbp = new TextBoxPop(output); //tbp.Show(); }
private void __add(BookmarkObject bo, string currentPath) { if (string.IsNullOrEmpty(currentPath)) { _bookmarks.Add(bo.ToString()); } else { string nextPath = string.Empty; string nextFolder = string.Empty; nextFolder = __getNextFolder(currentPath); nextPath = __getNextPath(currentPath); FolderObject fo = __getFolder(nextFolder); fo.Parent = this; fo.__add(bo, nextPath); } }
public void Add(BookmarkObject bo) { if (bo.Parent == this._name) { _bookmarks.Add(bo.ToString()); } else { string nextPath = string.Empty; string nextFolder = string.Empty; string tmpPath = string.Empty; tmpPath = __getNextPath(bo.Path); nextFolder = __getNextFolder(tmpPath); nextPath = __getNextPath(tmpPath); FolderObject fo = __getFolder(nextFolder); fo.Parent = this; fo.__add(bo, nextPath); } }