예제 #1
0
        public override void InitViewer(TREInfoFile treInfoFile)
        {
            base.InitViewer(treInfoFile);

            var stringsFile = new StringFileReader()
                .Load(treInfoFile.Data);

            listView.BeginUpdate();
            listView.Items.Clear();
            foreach (var stringItem in stringsFile.Items)
            {
                var listViewItem = new ListViewItem(new string[]
                {
                    stringItem.Id.ToString(),
                    stringItem.Name,
                    stringItem.Value
                })
                {
                    Tag = stringItem
                };

                listView.Items.Add(listViewItem);
            }
            listView.EndUpdate();

        }
예제 #2
0
        private void openButton_Click(object sender, EventArgs e)
        {
            var node = treeView.SelectedNode;

            if (node == null)
            {
                return;
            }

            var item = (IFFFile.Node)node.Tag;

            if (item == null)
            {
                return;
            }

            try
            {
                string             fileName = item.Data.ReadString();
                IRepositoryTREFile repositoryTREFile;
                TREFile.TreInfo    treInfo;
                if (TREInfoFile.Repository.Find(fileName, out repositoryTREFile, out treInfo))
                {
                    var treInfoFile = new TREInfoFile(TREInfoFile.Repository, repositoryTREFile.FileName, treInfo);
                    ViewForm.Show(TREInfoFile.Repository, treInfoFile);
                }
            }
            catch
            {
            }
        }
예제 #3
0
        public override void InitViewer(TREInfoFile treInfoFile)
        {
            base.InitViewer(treInfoFile);

            var stringsFile = new StringFileReader()
                              .Load(treInfoFile.Data);

            listView.BeginUpdate();
            listView.Items.Clear();
            foreach (var stringItem in stringsFile.Items)
            {
                var listViewItem = new ListViewItem(new string[]
                {
                    stringItem.Id.ToString(),
                    stringItem.Name,
                    stringItem.Value
                })
                {
                    Tag = stringItem
                };

                listView.Items.Add(listViewItem);
            }
            listView.EndUpdate();
        }
예제 #4
0
        public override void InitViewer(TREInfoFile treInfoFile)
        {
            base.InitViewer(treInfoFile);

            string text = Encoding.ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII, treInfoFile.Data));

            XDocument xmlDoc = null;

            if (text.TrimStart().StartsWith("<"))
            {
                try
                {
                    xmlDoc = XDocument.Parse(text.Trim());
                }
                catch { }
            }

            if (xmlDoc != null)
            {
                var converter = new XmlToRtfConverter();
                var rtfText   = converter.Process(xmlDoc, true);
                richTextBox.Rtf = rtfText;
            }
            else
            {
                richTextBox.Text = text;
            }
        }
예제 #5
0
        public override void InitViewer(TREInfoFile treInfoFile)
        {
            base.InitViewer(treInfoFile);

            string text = Encoding.ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII, treInfoFile.Data));

            XDocument xmlDoc = null;
            if (text.TrimStart().StartsWith("<"))
            {
                try
                {
                    xmlDoc = XDocument.Parse(text.Trim());
                }
                catch { }
            }

            if (xmlDoc != null)
            {
                var converter = new XmlToRtfConverter();
                var rtfText = converter.Process(xmlDoc, true);
                richTextBox.Rtf = rtfText;
            }
            else
                richTextBox.Text = text;
        }
예제 #6
0
        public override void InitViewer(TREInfoFile treInfoFile)
        {
            base.InitViewer(treInfoFile);

            IFFFile = new IFFFileReader().Load(treInfoFile.Data);

            dataSizeLabel.Text = "";
            RefreshTreeView();
        }
예제 #7
0
        public override void InitViewer(TREInfoFile treInfoFile)
        {
            base.InitViewer(treInfoFile);

            IFFFile = new IFFFileReader().Load(treInfoFile.Data);

            dataSizeLabel.Text = "";
            RefreshTreeView();
        }
예제 #8
0
        public override void InitViewer(TREInfoFile treInfoFile)
        {
            base.InitViewer(treInfoFile);

            if (treInfoFile.FileType.DebugToString != null)
            {
                try
                {
                    using (var writer = new StringWriter())
                    {
                        treInfoFile.FileType.DebugToString(treInfoFile.Data, writer);
                        richTextBox.Text = writer.ToString();
                    }
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine(ex);
                    richTextBox.Text = string.Format("Error loading Debug Information: \r\n{0}", ex);
                }
            }
        }
예제 #9
0
        public override void InitViewer(TREInfoFile treInfoFile)
        {
            base.InitViewer(treInfoFile);

            if (treInfoFile.FileType.DebugToString != null)
            {
                try
                {
                    using (var writer = new StringWriter())
                    {
                        treInfoFile.FileType.DebugToString(treInfoFile.Data, writer);
                        richTextBox.Text = writer.ToString();
                    }
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine(ex);
                    richTextBox.Text = string.Format("Error loading Debug Information: \r\n{0}", ex);
                }
            }

        }
예제 #10
0
 public override void InitViewer(TREInfoFile treInfoFile)
 {
     base.InitViewer(treInfoFile);
     hexBox.ByteProvider = new DynamicByteProvider(treInfoFile.Data);
 }
예제 #11
0
 public virtual void InitViewer(TREInfoFile treInfoFile)
 {
     TREInfoFile = treInfoFile;
 }
예제 #12
0
        public override void InitViewer(TREInfoFile treInfoFile)
        {
            base.InitViewer(treInfoFile);

            pictureBox.Image = DDSHelper.LoadBitmap(treInfoFile.Data);
        }
예제 #13
0
 public override void InitViewer(TREInfoFile treInfoFile)
 {
     base.InitViewer(treInfoFile);
 }
예제 #14
0
 public override void InitViewer(TREInfoFile treInfoFile)
 {
     base.InitViewer(treInfoFile);
 }
예제 #15
0
        private void openButton_Click(object sender, EventArgs e)
        {
            var node = treeView.SelectedNode;
            if (node == null)
                return;
                
            var item = (IFFFile.Node)node.Tag;
            if (item == null)
                return;

            try
            {
                string fileName = item.Data.ReadString();
                IRepositoryTREFile repositoryTREFile;
                TREFile.TreInfo treInfo;
                if (TREInfoFile.Repository.Find(fileName, out repositoryTREFile, out treInfo))
                {
                    var treInfoFile = new TREInfoFile(TREInfoFile.Repository, repositoryTREFile.FileName, treInfo);
                    ViewForm.Show(TREInfoFile.Repository, treInfoFile);
                }
            }
            catch
            {
            }
        }
예제 #16
0
 public virtual void InitViewer(TREInfoFile treInfoFile)
 {
     TREInfoFile = treInfoFile;
 }