public BloxBlockData(BloxBlock b) { if (b != null) { Type type = b.GetType(); this.blockSysType = type.AssemblyQualifiedName; this.blockType = b.blockType; this.ident = b.ident; this.active = b.active; this._ed_viewOffs = b._ed_viewOffs; if (b.returnType != null) { this.returnType = b.returnType.AssemblyQualifiedName; this.returnValue = BloxSerializer.Serialize(b.returnValue); } if (b.mi != null && b.mi.IsValid) { this.memberReflectedType = b.mi.ReflectedType.AssemblyQualifiedName; this.memberType = b.mi.MemberType; this.memberName = b.mi.Name; ParameterInfo[] parameters = b.mi.GetParameters(); if (((parameters != null) ? parameters.Length : 0) != 0) { this.paramTypes = new string[parameters.Length]; for (int i = 0; i < parameters.Length; i++) { this.paramTypes[i] = parameters[i].ParameterType.AssemblyQualifiedName; } } } if (type != typeof(BloxBlock)) { FieldInfo[] array = type.GetFields(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public); this.fields = new BlockField[array.Length]; for (int j = 0; j < array.Length; j++) { object value = array[j].GetValue(b); if (value != null) { this.fields[j].fieldName = array[j].Name; this.fields[j].typeName = array[j].FieldType.AssemblyQualifiedName; this.fields[j].data = BloxSerializer.Serialize(value); } } } } }
public BloxBlockAttribute(string ident, BloxBlockType blockType) { this.Ident = ident; this.BlockType = blockType; }