Ejemplo n.º 1
0
 public void Write(Slice slice, StringBuilder sb)
 {
     foreach (var section in slice.Sections)
     {
         Write(section, sb);
     }
 }
Ejemplo n.º 2
0
 public void ConstructsOk()
 {
     var sviB = new SemVerInfo("slices-1");
     var svi = new SemVerInfo(sviB.NameSemVer, "item-2");
     var slice = new Slice("root", svi, new List<string> {""});
     Assert.Equal(slice.RelPath, "root");
     Assert.Equal(slice.Info.BunchSemVer.Item1, 1);
     Assert.Equal(slice.Info.NameSemVer.Item1, 2);
     Assert.Equal(slice.Info.Name, "item");
 }
Ejemplo n.º 3
0
 public Layer(SliceList sliceList, Slice slice)
 {
     SliceList = sliceList;
     Slice = slice;
 }
Ejemplo n.º 4
0
        private Slice LoadSlice(FileInfo fi)
        {
            if (fi.Name.StartsWith("."))
                return null;

            var ext = Path.GetExtension(fi.Name);
            if (ext == ".md" || ext == ".txt")
                return null;

            var relPath = fi.FullName.Replace(RootDir.FullName + Path.DirectorySeparatorChar, "");
            var sliceInfo = new SemVerInfo(BunchInfo.NameSemVer, fi.Name);
            var lines = File.ReadAllLines(fi.FullName);
            var slice = new Slice(relPath, sliceInfo, lines);
            return slice;
        }