コード例 #1
0
ファイル: FolderObject.cs プロジェクト: xb013/BookmarkManager
        public FolderObject(string name, FolderObject fo)
        {
            this._name = name;

            _isRoot    = false;
            _bookmarks = new List <string>();
            _folders   = new List <FolderObject>();
            _parent    = fo;
        }
コード例 #2
0
ファイル: FolderObject.cs プロジェクト: xb013/BookmarkManager
        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);
        }
コード例 #3
0
        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();
        }
コード例 #4
0
ファイル: FolderObject.cs プロジェクト: xb013/BookmarkManager
 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);
     }
 }
コード例 #5
0
ファイル: FolderObject.cs プロジェクト: xb013/BookmarkManager
 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);
     }
 }