예제 #1
0
        public void ReadFrom( Stream aStream )
        {
            using ( var reader = new GMBinaryReader( aStream ) ) {
            int version = reader.ReadInt32();
            if ( version != FormatConstants.GMVersion50 && version != FormatConstants.GMVersion52 )
              throw new Exceptions.UnsupportedVersion( aStream.Position, version );

            TabCaption = reader.ReadString();
            ID = reader.ReadInt32();
            Author = reader.ReadString();
            Version = reader.ReadInt32();
            LastChanged = DateTime.FromOADate( reader.ReadDouble() );
            Information = reader.ReadString();
            InitializationCode = reader.ReadString();
            Advanced = reader.ReadInt32AsBool();

            reader.BaseStream.Position += 4;

            int count = reader.ReadInt32();
            Actions = new List<LibraryAction>( count );

            for ( int i = 0; i < count; i++ ) {
              var action = new LibraryAction();
              action.ReadFrom( reader );

              Actions.Add( action );
            }
              }
        }