Exemplo n.º 1
0
 void ITypeSerializer <List <T> > .Serialize(List <T> obj, ref AccelWriter writer)
 {
     for (int i = 0; i < obj.Count; i++)
     {
         writer.WriteValue(1, obj[i]);
     }
 }
Exemplo n.º 2
0
 void ITypeSerializer <T> .Serialize(T obj, ref AccelWriter writer)
 {
     foreach (TValue o in obj)
     {
         writer.WriteValue <TValue>(1, o);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 序列化方法(自动生成)
 /// </summary>
 public void Serialize(PackageDeclaration obj, ref AccelWriter writer)
 {
     obj.OnBeforeSerialization();
     if ((obj.m_PackageName != null))
     {
         writer.WriteValue(1, obj.m_PackageName);
     }
 }
Exemplo n.º 4
0
        void ITypeSerializer <T[]> .Serialize(T[] obj, ref AccelWriter writer)
        {
            writer.WriteValue(1, (VUInt)obj.Length);

            for (int i = 0; i < obj.Length; i++)
            {
                writer.WriteValue <T>(2, obj[i]);
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// 序列化方法(自动生成)
 /// </summary>
 public void Serialize(UsingAsDeclaration obj, ref AccelWriter writer)
 {
     obj.OnBeforeSerialization();
     if ((obj.m_TypeName != null))
     {
         writer.WriteValue(1, obj.m_TypeName);
     }
     if ((obj.m_AliasName != null))
     {
         writer.WriteValue(2, obj.m_AliasName);
     }
 }
Exemplo n.º 6
0
        void ITypeSerializer <object> .Serialize(object obj, ref AccelWriter writer)
        {
            if (obj == null)
            {
                return;
            }

            Type type = obj.GetType();

            writer.WriteValue(1, type.AssemblyQualifiedName);

            MethodInfo method     = MethodBase.GetMethodFromHandle(s_SerializeMethod) as MethodInfo;
            object     serializer = typeof(InternalTypeCache <>).MakeGenericType(type).GetField(s_SerializerFieldName).GetValue(null);

            writer = (AccelWriter)method.MakeGenericMethod(type).Invoke(null, new object[] { serializer, obj, writer });
        }
Exemplo n.º 7
0
 /// <summary>
 /// 序列化方法(自动生成)
 /// </summary>
 public void Serialize(StructDeclaration obj, ref AccelWriter writer)
 {
     obj.OnBeforeSerialization();
     writer.WriteValue(1, ((int32)(obj.m_Visibility)));
     writer.WriteValue(2, obj.m_IsFinal);
     writer.WriteValue(3, obj.m_IsRef);
     writer.WriteValue(4, obj.m_IsNested);
     writer.WriteValue(5, obj.m_IsFieldIndexContinuous);
     if ((obj.m_Name != null))
     {
         writer.WriteValue(6, obj.m_Name);
     }
     if ((obj.m_Doc != null))
     {
         writer.WriteValue(7, obj.m_Doc);
     }
     writer.WriteValue(8, obj.m_Size);
     writer.WriteValue(9, obj.m_Declarations);
 }
Exemplo n.º 8
0
 /// <summary>
 /// 序列化方法(自动生成)
 /// </summary>
 public void Serialize(FieldDeclaration obj, ref AccelWriter writer)
 {
     obj.OnBeforeSerialization();
     if ((obj.m_RealType != null))
     {
         writer.WriteValue(1, obj.m_RealType);
     }
     if ((obj.m_Type != null))
     {
         writer.WriteValue(2, obj.m_Type);
     }
     if ((obj.m_Name != null))
     {
         writer.WriteValue(3, obj.m_Name);
     }
     if ((obj.m_Doc != null))
     {
         writer.WriteValue(4, obj.m_Doc);
     }
     writer.WriteValue(5, obj.m_Index);
     writer.WriteValue(6, obj.m_IsObsolete);
     writer.WriteValue(7, obj.m_IsNeverNull);
 }
Exemplo n.º 9
0
 /// <summary>
 /// 序列化方法(自动生成)
 /// </summary>
 public void Serialize(TypeName obj, ref AccelWriter writer)
 {
     obj.OnBeforeSerialization();
     if ((obj.m_RawString != null))
     {
         writer.WriteValue(1, obj.m_RawString);
     }
     if ((obj.m_RawStringWithoutNullableAndArraySuffix != null))
     {
         writer.WriteValue(2, obj.m_RawStringWithoutNullableAndArraySuffix);
     }
     writer.WriteValue(3, obj.m_IsGenericType);
     if ((obj.m_GenericTypeDefinitionName != null))
     {
         writer.WriteValue(4, obj.m_GenericTypeDefinitionName);
     }
     if ((obj.m_GenericParameters != null))
     {
         writer.WriteValue(5, obj.m_GenericParameters);
     }
     writer.WriteValue(6, obj.m_IsNullable);
     writer.WriteValue(7, obj.m_ArraySuffixCount);
 }
Exemplo n.º 10
0
 void ITypeSerializer <Dictionary <TKey, TValue> > .Serialize(Dictionary <TKey, TValue> obj, ref AccelWriter writer)
 {
     foreach (KeyValuePair <TKey, TValue> pair in obj)
     {
         writer.WriteValue <TKey>(1, pair.Key);
         writer.WriteValue <TValue>(1, pair.Value);
     }
 }
Exemplo n.º 11
0
 void ITypeSerializer <KeyValuePair <TKey, TValue> > .Serialize(KeyValuePair <TKey, TValue> obj, ref AccelWriter writer)
 {
     writer.WriteValue <TKey>(2, obj.Key);
     writer.WriteValue <TValue>(2, obj.Value);
 }
Exemplo n.º 12
0
 void ITypeSerializer <Vector4> .Serialize(Vector4 obj, ref AccelWriter writer)
 {
     writer.WriteValue(writer.Index, obj);
 }
Exemplo n.º 13
0
 void ITypeSerializer <Color32> .Serialize(Color32 obj, ref AccelWriter writer)
 {
     writer.WriteValue(writer.Index, obj);
 }
Exemplo n.º 14
0
 void ITypeSerializer <float> .Serialize(float obj, ref AccelWriter writer)
 {
     writer.WriteValue(writer.Index, obj);
 }
Exemplo n.º 15
0
 public static AccelWriter Serialize <T>(ITypeSerializer <T> value, T obj, ref AccelWriter writer)
 {
     value.Serialize(obj, ref writer);
     return(writer);
 }
Exemplo n.º 16
0
 void ITypeSerializer <sbyte> .Serialize(sbyte obj, ref AccelWriter writer)
 {
     writer.WriteValue(writer.Index, obj);
 }
Exemplo n.º 17
0
 void ITypeSerializer <string> .Serialize(string obj, ref AccelWriter writer)
 {
     writer.WriteValue(writer.Index, obj);
 }
Exemplo n.º 18
0
 void ITypeSerializer <char> .Serialize(char obj, ref AccelWriter writer)
 {
     writer.WriteValue(writer.Index, obj);
 }
Exemplo n.º 19
0
 void ITypeSerializer <bool> .Serialize(bool obj, ref AccelWriter writer)
 {
     writer.WriteValue(writer.Index, obj);
 }
Exemplo n.º 20
0
 void ITypeSerializer <decimal> .Serialize(decimal obj, ref AccelWriter writer)
 {
     writer.WriteValue(writer.Index, obj);
 }
Exemplo n.º 21
0
 void ITypeSerializer <double> .Serialize(double obj, ref AccelWriter writer)
 {
     writer.WriteValue(writer.Index, obj);
 }
Exemplo n.º 22
0
 void ITypeSerializer <VUInt> .Serialize(VUInt obj, ref AccelWriter writer)
 {
     writer.WriteValue(writer.Index, obj);
 }
Exemplo n.º 23
0
 void ITypeSerializer <UIntPtr> .Serialize(UIntPtr obj, ref AccelWriter writer)
 {
     writer.WriteValue(writer.Index, obj);
 }
Exemplo n.º 24
0
 void ITypeSerializer <Type> .Serialize(Type obj, ref AccelWriter writer)
 {
     writer.WriteValue(1, obj.AssemblyQualifiedName);
 }
Exemplo n.º 25
0
 void ITypeSerializer <Quaternion> .Serialize(Quaternion obj, ref AccelWriter writer)
 {
     writer.WriteValue(writer.Index, obj);
 }
Exemplo n.º 26
0
 void ITypeSerializer <ushort> .Serialize(ushort obj, ref AccelWriter writer)
 {
     writer.WriteValue(writer.Index, obj);
 }