Beispiel #1
0
 public void SubElementRemove(VirtualElement RemovedElement)
 {
     lock (SubElementLock)
     {
         this.SubElements.RemoveAll(x => x._ElementId.Equals(RemovedElement.ElementId));
     }
 }
Beispiel #2
0
 public void FlatElementAdd(VirtualElement VE)
 {
     lock (FlatElementsLock)
     {
         this.FlatElements.Add(VE);
     }
 }
Beispiel #3
0
 public void SubElementAdd(VirtualElement VE)
 {
     lock (SubElementLock)
     {
         VE._ParentElement = this;
         VE.PathToRoot     = this.PathRelative + Path.DirectorySeparatorChar;
         this.SubElements.Add(VE);
     }
 }
Beispiel #4
0
        public void SubElementDelete(VirtualElement VE, List <VirtualElementDeleted> RemovedElements, Int32?CallerTaskId)
        {
            VE.ActionInvalidateAll(CallerTaskId);
            VE.SubElementsDeleteAllRecursive(RemovedElements, CallerTaskId);

            lock (SubElementLock)
            {
                this.SubElements.RemoveAll(x => x.ElementId == VE.ElementId);
            }
            if (RemovedElements != null)
            {
                RemovedElements.Add(new VirtualElementDeleted()
                {
                    ElementId = VE.ElementId, ElementType = VE.ElementType
                });
            }
        }
Beispiel #5
0
        public VirtualElement FlatElementsGetElementBasedOnPath(String RelativePath, VirtualElementType ElementType, bool IncludeDeleted, bool SearchTargetNameFirst = false)
        {
            lock (FlatElementsLock)
            {
                if (String.IsNullOrEmpty(RelativePath))
                {
                    return((VirtualElement)this);
                }
                else
                {
                    VirtualElement VE = null;

                    if (SearchTargetNameFirst)
                    {
                        if (IncludeDeleted)
                        {
                            VE = this.FlatElements.FirstOrDefault(x => x.TargetPathRelativeAfterSync.Equals(RelativePath, StringComparison.OrdinalIgnoreCase) && x.ElementType == ElementType);
                        }
                        else
                        {
                            VE = this.FlatElements.FirstOrDefault(x => x.TargetPathRelativeAfterSync.Equals(RelativePath, StringComparison.OrdinalIgnoreCase) && !x.IsDeleted && x.ElementType == ElementType);
                        }

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

                    if (IncludeDeleted)
                    {
                        VE = this.FlatElements.FirstOrDefault(x => x.PathRelative.Equals(RelativePath, StringComparison.OrdinalIgnoreCase) && x.ElementType == ElementType);
                    }
                    else
                    {
                        VE = this.FlatElements.FirstOrDefault(x => x.PathRelative.Equals(RelativePath, StringComparison.OrdinalIgnoreCase) && !x.IsDeleted && x.ElementType == ElementType);
                    }

                    return(VE);
                }
            }
        }
Beispiel #6
0
 public MatchingElement(VirtualElement pLocalElement, RepositoryElement pRemoteElement)
 {
     _LocalElement  = pLocalElement;
     _RemoteElement = pRemoteElement;
 }