Exemplo n.º 1
0
Arquivo: Sector.cs Projeto: 71/nucleus
        public Sector(long end, string name, SectorType type, SectorEnumerator se)
        {
            Name       = name;
            Type       = type;
            Values     = new OrderedDictionary();
            enumerator = se;

            Length            = 0;
            Offset            = end + 4;
            isNew             = true;
            se.SectorMoved   += UpdateSectorWhenMovement;
            se.SectorChanged += UpdateSectorWhenChange;
        }
Exemplo n.º 2
0
Arquivo: Sector.cs Projeto: 71/nucleus
        public Sector(long end, int length, byte[] bytes, SectorEnumerator se)
        {
            Length     = length;
            Offset     = end - length;
            enumerator = se;

            Type = (SectorType)bytes[0];

            int    metadatalength = BitConverter.ToInt32(bytes, 1);
            string metadata       = Encoding.UTF8.GetString(bytes, 5, metadatalength);

            Name     = metadata.Substring(0, metadata.IndexOf(';'));
            metadata = metadata.Substring(Name.Length + 1);

            Values            = new OrderedDictionary(metadata);
            se.SectorMoved   += UpdateSectorWhenMovement;
            se.SectorChanged += UpdateSectorWhenChange;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Call this method once <see cref="GetRWStream"/> is ready to provide a <see cref="Stream"/>.
 /// </summary>
 protected void Initialize()
 {
     Enumerator = new SectorEnumerator(RWStream, this);
 }