Exemplo n.º 1
0
 internal static ResourceDirectory DirFromStream(BinaryReader rd, ResourceSpring owner)
 {
     ResourceDirectory ret = new ResourceDirectory(owner);
     int count = rd.ReadInt32();
     for (int i = 0; i < count; i++)
     {
         var entry = ResourceEntry.FromStream(rd, owner);
         entry.parent = ret;
         ret.entries.Add(entry);
     }
     return ret;
 }
Exemplo n.º 2
0
 internal ResourceEntry(ResourceSpring spring, ResourceDirectory parent)
 {
     this.parent = parent;
     this.owner = spring;
 }
Exemplo n.º 3
0
 public ResourceDirectory(ResourceSpring spring, ResourceDirectory parent)
     : base(spring, parent)
 {
 }
Exemplo n.º 4
0
 public static void BuildFile(FileInfo file, ResourceDirectory parent, ResourceSpring target)
 {
     ResourceFile new_file = new ResourceFile(target);
     new_file.source_file = file.FullName;
     new_file.parent = parent;
     new_file.name = file.Name;
     parent.entries.Add(new_file);
 }
Exemplo n.º 5
0
 public static void BuildDirectory(DirectoryInfo dir, ResourceDirectory parent, ResourceSpring target)
 {
     var dirs = dir.GetDirectories();
     foreach (var d in dirs)
     {
         ResourceDirectory new_dir = new ResourceDirectory(target);
         new_dir.name = d.Name;
         new_dir.parent = parent;
         parent.entries.Add(new_dir);
         BuildDirectory(d, new_dir, target);
     }
     var files = dir.GetFiles();
     foreach (var file in files)
         BuildFile(file, parent, target);
 }
Exemplo n.º 6
0
 internal ResourceSpring()
 {
     root = new ResourceDirectory(this);
 }
Exemplo n.º 7
0
 public ResourceSpring(string file)
 {
     root = new ResourceDirectory(this);
     src = new System.IO.FileStream(file, System.IO.FileMode.Open, System.IO.FileAccess.Read);
 }
Exemplo n.º 8
0
 internal ResourceFile(ResourceSpring owner, ResourceDirectory parent)
     : base(owner, parent)
 {
 }