internal string GetRelativeName(AllorsDirectoryInfo baseDirectory)
        {
            if (this.directoryInfo.Root.FullName.Equals(baseDirectory.directoryInfo.Root.FullName))
            {
                AllorsDirectoryInfo commonAncestor = this.GetCommonAncestor(baseDirectory);

                var ancestors = new List <AllorsDirectoryInfo>();
                this.BuildAncestors(commonAncestor, ancestors);

                var baseAncestors = new List <AllorsDirectoryInfo>();
                baseDirectory.BuildAncestors(commonAncestor, baseAncestors);

                var relativePath = new StringBuilder();
                foreach (AllorsDirectoryInfo baseAncestor in baseAncestors)
                {
                    if (relativePath.Length > 0)
                    {
                        relativePath.Append(Path.DirectorySeparatorChar);
                    }

                    relativePath.Append("..");
                }

                for (int i = ancestors.Count - 1; i >= 0; --i)
                {
                    AllorsDirectoryInfo ancestor = ancestors[i];
                    if (relativePath.Length > 0)
                    {
                        relativePath.Append(Path.DirectorySeparatorChar);
                    }

                    relativePath.Append(ancestor.directoryInfo.Name);
                }

                return(relativePath.ToString());
            }

            return(null);
        }