Exemplo n.º 1
0
        public override void Sync(HierachicalBaseWrapper aother, HierachicalWrapper_Folder[] parents)
        {
            var other = (HierachicalWrapper_Folder)aother;

            Debug.Assert(this.Header.ToLower() == other.Header.ToLower());
            Debug.Assert(this._isRoot == other._isRoot);

            _path           = other._path;
            _directSubNotes = other._directSubNotes;
            AllSubNotes.SynchronizeCollectionSafe(other.AllSubNotes);

            var me = this;

            bool FCompare(HierachicalWrapper_Folder a, HierachicalWrapper_Folder b)
            {
                return(a.Header.ToLower() == b.Header.ToLower());
            }

            HierachicalWrapper_Folder FCopy(HierachicalWrapper_Folder a)
            {
                if (a.GetType() == typeof(HierachicalWrapper_Folder) && a.IsSpecialNode_RootFolder)
                {
                    return(me.RootFolderViewWrapper = new HierachicalWrapper_Folder(a.Header, _config, a._path, a._isRoot, a.Permanent));
                }

                if (a.GetType() == typeof(HierachicalWrapper_Folder))
                {
                    return(new HierachicalWrapper_Folder(a.Header, _config, a._path, a._isRoot, a.Permanent));
                }

                if (a.GetType() == typeof(HierachicalWrapper_UnsortedNotes))
                {
                    return(me.EmptyPathViewWrapper = new HierachicalWrapper_UnsortedNotes(me, _config));
                }

                if (a.GetType() == typeof(HierachicalWrapper_AllNotes))
                {
                    return(me.AllNotesViewWrapper = new HierachicalWrapper_AllNotes(me, _config));
                }

                throw new NotSupportedException(a.GetType().ToString());
            }

            SubFolder.SynchronizeCollection(other.SubFolder, FCompare, FCopy);
            Debug.Assert(SubFolder.Count == other.SubFolder.Count);

            for (int i = 0; i < SubFolder.Count; i++)
            {
                SubFolder[i].Sync(other.SubFolder[i], parents.Concat(new [] { this }).ToArray());
            }
        }
Exemplo n.º 2
0
        public override void Sync(HierachicalBaseWrapper aother, HierachicalWrapper_Folder[] parents)
        {
            var other = (HierachicalWrapper_AllNotes)aother;

            AllSubNotes.SynchronizeCollectionSafe(other.AllSubNotes);
        }
Exemplo n.º 3
0
 public abstract void Sync(HierachicalBaseWrapper aother, HierachicalWrapper_Folder[] parents);