Exemplo n.º 1
0
 public override void ReadFrom(BinaryReader brrReader)
 {
     Magic = Global.ReplaceOrder(new string(brrReader.ReadChars(4)));
     foreach (char ch in Magic)
     {
         if (ch < 'A' || ch > 'Z')
         {
             throw new FormatException();
         }
     }
     m_shBom      = brrReader.ReadInt16();
     m_shUnknown1 = brrReader.ReadInt16();
     m_nFileSize  = brrReader.ReadInt32();
     if ((long)m_nFileSize > brrReader.BaseStream.Length - brrReader.BaseStream.Position + 12L)
     {
         throw new FormatException();
     }
     m_shHeaderSize = brrReader.ReadInt16();
     m_lstnffFrames = new List <NitroFileFrameBase>((int)brrReader.ReadUInt16());
     for (ushort index = 0; (int)index < m_lstnffFrames.Capacity - 1; ++index)
     {
         m_lstnffFrames.Add(NitroFileFrameBase.CreateFrom(brrReader));
         m_lstnffFrames[(int)index].ContentChanged += new EventHandler(NitroFile_ContentChanged);
         if (m_lstnffFrames[m_lstnffFrames.Count - 1].Size % 2 == 1 && brrReader.ReadByte() != (byte)0)
         {
             throw new FormatException();
         }
     }
     m_lstnffFrames.Add(NitroFileFrameBase.CreateFrom(brrReader));
     m_lstnffFrames[m_lstnffFrames.Count - 1].ContentChanged += new EventHandler(NitroFile_ContentChanged);
 }
Exemplo n.º 2
0
 public void InsertFrame(int nIndex, NitroFileFrameBase nffbFrame)
 {
     nffbFrame.ContentChanged += new EventHandler(NitroFile_ContentChanged);
     m_lstnffFrames.Insert(nIndex, nffbFrame);
     if (m_fcFileChanged == null)
     {
         return;
     }
     m_fcFileChanged((FIMGFrame.FileImageEntryBase) this);
 }
Exemplo n.º 3
0
 public void AddFrame(NitroFileFrameBase nffbFrame)
 {
     nffbFrame.ContentChanged += new EventHandler(NitroFile_ContentChanged);
     m_lstnffFrames.Add(nffbFrame);
     if (m_fcFileChanged == null)
     {
         return;
     }
     m_fcFileChanged((FIMGFrame.FileImageEntryBase) this);
 }
Exemplo n.º 4
0
 public void RemoveFrame(NitroFileFrameBase nffbFrame)
 {
     if (!m_lstnffFrames.Contains(nffbFrame))
     {
         return;
     }
     m_lstnffFrames.Remove(nffbFrame);
     nffbFrame.ContentChanged -= new EventHandler(NitroFile_ContentChanged);
     if (m_fcFileChanged == null)
     {
         return;
     }
     m_fcFileChanged((FIMGFrame.FileImageEntryBase) this);
 }
Exemplo n.º 5
0
        public void RemoveFrameAt(int nIndex)
        {
            if (nIndex >= m_lstnffFrames.Count)
            {
                return;
            }
            NitroFileFrameBase lstnffFrame = m_lstnffFrames[nIndex];

            m_lstnffFrames.RemoveAt(nIndex);
            lstnffFrame.ContentChanged -= new EventHandler(NitroFile_ContentChanged);
            if (m_fcFileChanged == null)
            {
                return;
            }
            m_fcFileChanged((FIMGFrame.FileImageEntryBase) this);
        }