public bool IsAncestorOf(VssComponentDescriptor descendent) { // The child must have a longer full path if (descendent.FullPath.Length <= FullPath.Length) { return(false); } string fullPathWithBackslash = FullPath.AppendBackslash(); return(descendent.FullPath.AppendBackslash().StartsWith(FullPath.AppendBackslash(), StringComparison.OrdinalIgnoreCase)); }
internal void InitializeComponentsForRestore(IVssWriterComponents components) { // Erase the current list of components for this writer. ComponentDescriptors.Clear(); // Enumerate the components from the BC document foreach (IVssComponent component in components.Components) { VssComponentDescriptor desc = new VssComponentDescriptor(m_host, this.WriterMetadata.WriterName, component); m_host.WriteDebug("Found component available for restore: \"{0}\"", desc.FullPath); ComponentDescriptors.Add(desc); } }