예제 #1
0
        public void Load(Stream inStream, TagContext context)
        {
            if (!inStream.CanRead)
            {
                return;
            }
            if (!inStream.CanSeek)
            {
                return;
            }
            blocks.Clear();

            using (BinaryReader reader = new BinaryReader(inStream))
            {
                BlockName = reader.ReadUTF8NullTerminated();
                Count     = reader.ReadInt32();

                for (int i = 0; i < Count; i++)
                {
                    Block block = context.CreateBlock(BlockName);
                    block.Read(reader);
                    blocks.Add(block);
                }
            }
        }
예제 #2
0
 public AbideTagGroup(Group group, TagContext context) : base(context)
 {
     this.group = group ?? throw new ArgumentNullException(nameof(group));
     foreach (var block in group.TagBlocks)
     {
         var b = new AbideTagBlock(context, this, block);
         TagBlocks.Add(b);
         b.PostprocessTagBlock();
     }
 }
예제 #3
0
 protected AbideTagObject(TagContext context, AbideTagObject owner) : this(context)
 {
     Owner = owner ?? throw new ArgumentNullException(nameof(owner));
 }
예제 #4
0
 protected AbideTagObject(TagContext context)
 {
     Context = context ?? throw new ArgumentNullException(nameof(context));
 }