public mTagRef(iValue Value, CacheBase Cache) { InitializeComponent(); value = Value; cache = Cache; lblName.Text = value.Node.Attributes["name"].Value; }
public mComment(iValue Value, CacheBase Cache) { InitializeComponent(); value = Value; cache = Cache; SetText(value.Node.Attributes["name"].Value, value.Node.InnerText); }
public mMultiValue(iValue Value, CacheBase Cache) { InitializeComponent(); value = Value; cache = Cache; lblName.Text = value.Node.Attributes["name"].Value; try { lblDesc.Text = value.Node.Attributes["desc"].Value; } catch { lblDesc.Text = ""; } }
public mStructure(iValue Value, CacheBase Cache, CacheBase.IndexItem Tag, bool ShowInvisibles) { InitializeComponent(); value = Value; cache = Cache; showInvis = ShowInvisibles; tag = Tag; lblName.Text = value.Node.Attributes["name"].Value.ToUpper(); try { chunkSize = int.Parse(value.Node.Attributes["size"].Value); } catch { chunkSize = Convert.ToInt32(value.Node.Attributes["size"].Value, 16); } isLoaded = isLoading = false; }
public mValue(iValue Value, CacheBase Cache) { InitializeComponent(); value = Value; cache = Cache; ContextMenuStrip = null; lblName.Text = value.Node.Attributes["name"].Value; try { lblDesc.Text = value.Node.Attributes["desc"].Value; } catch { lblDesc.Text = ""; } #if DEBUG lblDesc.Text += " " + value.Node.Attributes["offset"].Value; #endif }
private void LoadControls() { pnlContainer.Controls.Clear(); int yLoc = 0; foreach (XmlNode n in value.Node.ChildNodes) { iValue val; try { val = new iValue(n); } catch { continue; } if (!val.Visible && !showInvis) { continue; } MetaViewerControl mvc = new MetaViewerControl(); switch (val.Type) { case iValue.ValueType.Comment: mvc = new mComment(val, cache); break; case iValue.ValueType.Struct: mvc = new mStructure(val, cache, tag, showInvis); ((mStructure)mvc).RequestTagLoad += new RequestTagLoadEventHandler(mTagRef_RequestTagLoad); ((mStructure)mvc).ResizeNeeded += new ResizeNeededEvent(mStructure_ResizeNeeded); break; case iValue.ValueType.TagRef: mvc = new mTagRef(val, cache); ((mTagRef)mvc).RequestTagLoad += new RequestTagLoadEventHandler(mTagRef_RequestTagLoad); break; case iValue.ValueType.String: case iValue.ValueType.StringID: mvc = new mString(val, cache); break; case iValue.ValueType.Bitmask8: case iValue.ValueType.Bitmask16: case iValue.ValueType.Bitmask32: mvc = new mBitmask(val, cache); break; case iValue.ValueType.Int8: case iValue.ValueType.Int16: case iValue.ValueType.Int32: case iValue.ValueType.Float32: case iValue.ValueType.UInt16: case iValue.ValueType.UInt32: case iValue.ValueType.Undefined: case iValue.ValueType.RawID: mvc = new mValue(val, cache); break; case iValue.ValueType.Enum8: case iValue.ValueType.Enum16: case iValue.ValueType.Enum32: mvc = new mEnum(val, cache); break; case iValue.ValueType.ShortBounds: case iValue.ValueType.RealBounds: case iValue.ValueType.ShortPoint2D: case iValue.ValueType.RealPoint2D: case iValue.ValueType.RealPoint3D: case iValue.ValueType.RealPoint4D: case iValue.ValueType.RealVector2D: case iValue.ValueType.RealVector3D: case iValue.ValueType.RealVector4D: case iValue.ValueType.Colour32RGB: case iValue.ValueType.Colour32ARGB: mvc = new mMultiValue(val, cache); break; default: continue; } mvc.Reload(chunkOffset); if (mvc is mStructure || mvc is mComment) { yLoc += 5; } mvc.Location = new Point(5, yLoc); yLoc += mvc.Height; if (mvc is mStructure || mvc is mComment) { yLoc += 5; } pnlContainer.Controls.Add(mvc); } Resize(); }