private void rawNToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog dialog = new OpenFileDialog(); dialog.AddExtension = true; dialog.CheckFileExists = true; dialog.CheckPathExists = true; dialog.Multiselect = false; dialog.RestoreDirectory = true; dialog.Title = LangManager.GetString("nbtViewer_selectNBTFormatFile"); DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { this.cacheData.NBTViewerCache.Rows.Clear(); try { CompoundTag tag = NBTIO.ReadRawFile(dialog.FileName, this.Endian); this._Load(tag); } catch (Exception exc) { MessageBox.Show(exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
public void NBTIOTests_ReadRawFileTest() { CompoundTag tag = NBTIO.ReadRawFile(Environment.CurrentDirectory + "\\test.nbt"); tag.GetBool("bool"); tag.GetByte("byte"); tag.GetByteArray("byteArray"); tag.GetShort("short"); tag.GetInt("int"); tag.GetIntArray("intArray"); tag.GetLong("long"); tag.GetLongArray("longArray"); tag.GetFloat("float"); tag.GetDouble("double"); tag.GetList("list"); tag.GetCompound("com"); Console.WriteLine(tag); }
public void ReadRawFileTest() { NBTIO.ReadRawFile(Path + "\\" + "raw.nbt"); }