private void Write(string filename, T data) { STREAM_SYSTEM.Write(filename, delegate(Stream stream) { HuskWriter writer = new HuskWriter(stream); writer.WriteVersionHeader(); husker.Dehydrate(writer, data); }, 0); }
public override void Dehydrate(HuskWriter writer, Assembly to_dehydrate) { if (to_dehydrate != null) { writer.WriteString(to_dehydrate.FullName); } else { writer.WriteString(""); } }
public override void Dehydrate(HuskWriter writer, Module to_dehydrate) { if (to_dehydrate != null) { writer.WriteString(to_dehydrate.ScopeName); writer.WriteRecurrant(to_dehydrate.Assembly, AssemblyHusker.INSTANCE); } else { writer.WriteString(""); } }
public override void Dehydrate(HuskWriter writer, FieldInfoEX to_dehydrate) { if (to_dehydrate != null) { writer.WriteInt(to_dehydrate.MetadataToken); writer.WriteRecurrant(to_dehydrate.DeclaringType, TypeHusker.INSTANCE); } else { writer.WriteInt(0); } }
public override void Dehydrate(HuskWriter writer, Type to_dehydrate) { if (to_dehydrate != null) { writer.WriteInt(to_dehydrate.MetadataToken); writer.WriteRecurrant(to_dehydrate.Module, ModuleHusker.INSTANCE); if (to_dehydrate.IsGenericClass()) { if (writer.WriteBoolBranch(to_dehydrate.IsGenericTypedClass())) { TypeListHusker.INSTANCE.Dehydrate(writer, to_dehydrate.GetGenericArguments().ToList()); } } } else { writer.WriteInt(0); } }
public override void Dehydrate(HuskWriter writer, MethodInfoEX to_dehydrate) { if (to_dehydrate != null) { writer.WriteInt(to_dehydrate.MetadataToken); writer.WriteRecurrant(to_dehydrate.DeclaringType, TypeHusker.INSTANCE); if (to_dehydrate.IsGenericMethod()) { if (writer.WriteBoolBranch(to_dehydrate.IsGenericTypedMethod())) { TypeListHusker.INSTANCE.Dehydrate(writer, to_dehydrate.GetGenericArguments().ToList()); } } } else { writer.WriteInt(0); } }
public override void Dehydrate(HuskWriter writer, PropInfoEX to_dehydrate) { PropInfoEX_Field field_cast; PropInfoEX_MethodPair method_pair_cast; if (to_dehydrate.Convert <PropInfoEX_Field>(out field_cast)) { writer.WriteByte(1); DehydrateAsField(writer, field_cast); } else if (to_dehydrate.Convert <PropInfoEX_MethodPair>(out method_pair_cast)) { writer.WriteByte(2); DehydrateAsMethodPair(writer, method_pair_cast); } else { writer.WriteByte(0); } }
private void DehydrateAsMethodPair(HuskWriter writer, PropInfoEX_MethodPair to_dehydrate) { MethodInfoEXHusker.INSTANCE.Dehydrate(writer, to_dehydrate.GetSetMethodInfo()); MethodInfoEXHusker.INSTANCE.Dehydrate(writer, to_dehydrate.GetGetMethodInfo()); }
private void DehydrateAsField(HuskWriter writer, PropInfoEX_Field to_dehydrate) { FieldInfoEXHusker.INSTANCE.Dehydrate(writer, to_dehydrate.GetFieldInfo()); }
static public void WriteVersionHeader(this HuskWriter item) { item.WriteHeader(VersionInfo.GetId().GetBytes()); }