Beispiel #1
0
        public void Read(ArchiveReader ar)
        {
            string strSerializeID = ar.ReadStringL();

            if (strSerializeID != SERIALISEHEADER)
            {
                throw new System.IO.IOException("File does not start with correct header - not a SAW6 file");
            }
            Version = ar.ReadInt16();
            if (Version < 5004)
            {
                throw new InvalidOperationException("Cannot read SAW files from before version 5.00.4");
            }
            DesktopSize      = ar.ReadPoint();
            MainWindowBounds = ar.ReadRectangleRaw();
            PromptID         = -1;
            int.TryParse(ar.ReadStringL(), out PromptID);
            NextControlID = (int)ar.ReadUInt32();
        }
Beispiel #2
0
        /// <summary>Also creates a Splash document - reference is added to the archivereader</summary>
        public void Read(ArchiveReader ar)
        {
            NotifyArchiveTypes(ar);
            m_Header.Read(ar);
            ar.SAWVersion = m_Header.Version;
            ar.PageHeight = m_Header.MainWindowBounds.Height;
            var page = new Page()
            {
                ReverseRenderOrder = true, BackgroundImageMode = Page.BackgroundImageModes.FitWithin
            };

            page.SetSize(m_Header.MainWindowBounds.Size, 0);
            ar.IntoDocument = new Document(new[] { page })
            {
                ReverseRenderOrder = true
            };

            if (m_Header.Version == 5005 || m_Header.Version > 5009)
            {             // note these items were not serialised normally - the actual serialise method was called
                m_ItemDefault.Read(ar);
                m_ItemEscapeDefault.Read(ar);
                m_ItemGroupDefault.Read(ar);
            }
            m_ItemStartup.Read(ar);
            m_itemTop.Read(ar);
            page.BackgroundImage = m_itemTop.Main.Image;
            page.Colour          = m_itemTop.Main.FillStyle.Colour;
            page.HelpSAWID       = m_Header.PromptID;

            foreach (Item.LegacyItem item in m_itemTop.SubItems)
            {
                ar.ReadTransaction.Edit(item.Scripting);                 // not needed, but the Page asserts that it is in the transaction
                page.AddNew(item.Scripting, ar.ReadTransaction);
            }

            ar.IntoDocument.DefaultEscapeScripts = m_ItemEscapeDefault.Scripting ?? new Scriptable();
            ar.IntoDocument.DefaultGroupScripts  = m_ItemGroupDefault.Scripting ?? new Scriptable();
            ar.IntoDocument.DefaultItemScripts   = m_ItemDefault.Scripting ?? new Scriptable();
            ar.IntoDocument.SAWHeader            = m_Header;
            ar.IntoDocument.StartupScript        = m_ItemStartup?.Scripting?.GetScript(Scriptable.ScriptTypes.Select) ?? new Script();
        }
Beispiel #3
0
 public void Read(ArchiveReader ar)
 {
     VisitType = (VisitTypes)ar.ReadInt32();
     ItemID    = ar.ReadInt32();
 }
Beispiel #4
0
 /// <summary>Just calls through to Command.Read(ar) - used by derived classes that DON'T want this default implementation of reading the params</summary>
 protected void BaseRead(ArchiveReader ar)
 {
     base.Read(ar);
 }
Beispiel #5
0
 public virtual void Read(ArchiveReader ar)
 {
     m_ParamList = ar.ReadList <Param>();
 }