public static uint RenderTwoInt16(FieldRenderInfo field, byte[] values, out string strVal) { byte[] rawField = values.GetBytes(field.Index, 4); var val1 = BitConverter.ToUInt16(rawField, 0); var val2 = BitConverter.ToUInt16(rawField, 2); //var val1 = values.GetUInt16(field.Index); //var val2 = values.GetUInt16(field.Index + 2); strVal = "Low: " + val1 + ", High: " + val2; return 1; }
public static uint RenderByteArray(FieldRenderInfo field, byte[] values, out string strVal) { var bytes = values.GetBytes(field.Index, 4); string[] s = new string[4]; for (int i = 0; i < s.Length; i++) { s[i] = string.Format("{0:X2}", bytes[i]); } strVal = s.ToString(", "); return 1; }
public FieldRenderer(ObjectTypeId enumType) { EnumType = enumType; var fields = FieldRenderUtil.GetValues(enumType); Fields = new FieldRenderInfo[fields.Length]; uint i = 0; var fieldDefs = UpdateFieldMgr.Get(enumType); foreach (var e in fields) { var fieldDef = fieldDefs.Fields.Get((uint)((int)e)); UpdateFieldType type = fieldDef == null ? UpdateFieldType.UInt32 : fieldDef.Type; Fields[i] = new FieldRenderInfo(e, type); i++; } }
public static uint RenderGUID(FieldRenderInfo field, byte[] values, out string strVal) { var val = values.GetUInt64(field.Index); strVal = new EntityId(val).ToString(); return 2; }
public static uint RenderFloat(FieldRenderInfo field, byte[] values, out string strVal) { float val = values.GetFloat(field.Index); strVal = val.ToString(); return 1; }
public static uint RenderUInt32(FieldRenderInfo field, byte[] values, out string strVal) { var val = values.GetUInt32(field.Index); strVal = val.ToString(); return 1; }
public static uint RenderDefault(FieldRenderInfo field, byte[] values, out string strVal) { return RenderUInt32(field, values, out strVal); }