public void SubElementRemove(VirtualElement RemovedElement) { lock (SubElementLock) { this.SubElements.RemoveAll(x => x._ElementId.Equals(RemovedElement.ElementId)); } }
public void FlatElementAdd(VirtualElement VE) { lock (FlatElementsLock) { this.FlatElements.Add(VE); } }
public void SubElementAdd(VirtualElement VE) { lock (SubElementLock) { VE._ParentElement = this; VE.PathToRoot = this.PathRelative + Path.DirectorySeparatorChar; this.SubElements.Add(VE); } }
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 }); } }
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); } } }
public MatchingElement(VirtualElement pLocalElement, RepositoryElement pRemoteElement) { _LocalElement = pLocalElement; _RemoteElement = pRemoteElement; }