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.WriteLine("Found component available for restore: \"{0}\"", desc.FullPath); ComponentDescriptors.Add(desc); } }
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.WriteLine("Found component available for restore: \"{0}\"", desc.FullPath); ComponentDescriptors.Add(desc); } }
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); }
private void PrintComponent(VssComponentDescriptor component, bool detailed) { Host.WriteHeader("Component \"{0}:{1}\"", component.WriterName, component.FullPath); Host.PushIndent(); StringTable table = new StringTable(); table.Add("Name:", component.ComponentName); table.Add("Logical Path:", component.LogicalPath); table.Add("Full Path:", component.FullPath); table.Add("Caption: ", component.Caption); table.Add("Type:", component.ComponentType); table.Add("Is Selectable:", component.IsSelectable); table.Add("Is Top Level:", component.IsTopLevel); table.Add("Notify on backup complete:", component.NotifyOnBackupComplete); Host.WriteTable(table); if (detailed) { Host.WriteLine("Components:"); Host.PushIndent(); foreach (VssWMFileDescriptor file in component.Files) { PrintFileDescription(file, "File"); Host.WriteLine(); } foreach (VssWMFileDescriptor file in component.DatabaseFiles) { PrintFileDescription(file, "Database"); Host.WriteLine(); } foreach (VssWMFileDescriptor file in component.DatabaseLogFiles) { PrintFileDescription(file, "Database Log File"); Host.WriteLine(); } Host.PopIndent(); } Host.WriteLine("Paths affected by this component:"); Host.PushIndent(); foreach (string path in component.AffectedPaths) Host.WriteLine("{0}", path); Host.PopIndent(); Host.WriteLine("Volumes affected by this component:"); Host.PushIndent(); foreach (string volume in component.AffectedVolumes) { string displayName; try { displayName = Volume.GetDisplayNameForVolume(volume); } catch { displayName = "Not valid for local machine"; } Host.WriteLine("{0} [{1}]", volume, displayName); } Host.PopIndent(); if (component.Dependencies.Any()) { Host.WriteLine("Component Dependencies:"); Host.PushIndent(); foreach (var dependency in component.Dependencies) PrintDependency(dependency); Host.PopIndent(); } Host.PopIndent(); }