Esempio n. 1
0
        private void LoadSDSMessages(FileFormat.Chunks.SDS ChunkSDS)
        {
            if (ChunkSDS.Messages.Count > 0)
            {
                MessageList.Items.Clear();
                ActiveGUI();

                foreach (Resource.SDS.Message Message in ChunkSDS.Messages)
                {
                    if (Message.ContentClean.Length > 25)
                    {
                        MessageList.Items.Add(Message.ContentClean.Substring(0, 25) + " [...]");
                    }
                    else
                    {
                        MessageList.Items.Add(Message.ContentClean);
                    }
                }

                MessageList.SelectedIndex = 0;
            }
            else
            {
                UnloadSDSMessages();
            }
        }
Esempio n. 2
0
        private void LoadSDSInfo(FileFormat.Chunks.SDS ChunkSDS)
        {
            MarkCaption.Text    = Encoding.Default.GetString(ChunkSDS.Mark);
            VersionCaption.Text = new string(ChunkSDS.Version);
            IndexCaption.Text   = Convert.ToString(ChunkSDS.Index);

            SaveFileButton.Enabled = true;

            SaveFileTButton.Enabled = true;
        }
Esempio n. 3
0
        private void ShowSize(FileFormat.Chunks.SDS ChunkSDS)
        {
            int index = MessageList.SelectedIndex;

            if (index < 0)
            {
                return;
            }

            BubbleWidth.Text  = Convert.ToString(ChunkSDS.Sizes[index][0]);
            BubbleHeight.Text = Convert.ToString(ChunkSDS.Sizes[index][1]);
        }
        public static FileFormat.Chunks.SDS ChunkSDS(string fileName)
        {
            FileFormat.Chunks.SDS chunkSDS = null;

            BinaryReader bin = new BinaryReader(new MemoryStream(File.ReadAllBytes(fileName)));

            char[] id = new char[4];
            uint   chunkSize;

            byte[] data = new byte[] { };

            using (bin)
            {
                id        = bin.ReadChars(4);
                chunkSize = bin.ReadUInt32();
                data      = bin.ReadBytes((int)chunkSize);
            }

            chunkSDS = new FileFormat.Chunks.SDS(id, data);

            return(chunkSDS);
        }
 public Brain(FileFormat.Chunks.SDS sdsOpened)
 {
     SDSOpened = sdsOpened;
 }