Esempio n. 1
0
 /// <summary>
 /// Returns the hashcode for this instance.
 /// </summary>
 ///
 /// <returns>A 32-bit signed integer hash code.</returns>
 ///
 public override int GetHashCode( )
 {
     return
         (V00.GetHashCode( ) + V01.GetHashCode( ) + V02.GetHashCode( ) +
          V10.GetHashCode( ) + V11.GetHashCode( ) + V12.GetHashCode( ) +
          V20.GetHashCode( ) + V21.GetHashCode( ) + V22.GetHashCode( ));
 }
Esempio n. 2
0
        public override byte[] Serialize()
        {
            List <byte> s = new List <byte>();

            // serialize V0
            s.Add((byte)((V0 == null) ? 0 : 1));
            if (V0 != null)
            {
                s.AddRange(BitConverter.GetBytes((bool)V0));
            }

            // serialize V1
            s.Add((byte)((V1 == null) ? 0 : 1));
            if (V1 != null)
            {
                s.AddRange(BitConverter.GetBytes((char)V1));
            }

            // serialize V2
            s.Add((byte)((V2 == null) ? 0 : 1));
            if (V2 != null)
            {
                s.Add((byte)V2);
            }

            // serialize V3
            s.Add((byte)((V3 == null) ? 0 : 1));
            if (V3 != null)
            {
                s.Add((byte)V3);
            }

            // serialize V4
            s.Add((byte)((V4 == null) ? 0 : 1));
            if (V4 != null)
            {
                s.AddRange(BitConverter.GetBytes((short)V4));
            }

            // serialize V5
            s.Add((byte)((V5 == null) ? 0 : 1));
            if (V5 != null)
            {
                s.AddRange(BitConverter.GetBytes((ushort)V5));
            }

            // serialize V6
            s.Add((byte)((V6 == null) ? 0 : 1));
            if (V6 != null)
            {
                s.AddRange(BitConverter.GetBytes((int)V6));
            }

            // serialize V7
            s.Add((byte)((V7 == null) ? 0 : 1));
            if (V7 != null)
            {
                s.AddRange(BitConverter.GetBytes((uint)V7));
            }

            // serialize V8
            s.Add((byte)((V8 == null) ? 0 : 1));
            if (V8 != null)
            {
                s.AddRange(BitConverter.GetBytes((long)V8));
            }

            // serialize V9
            s.Add((byte)((V9 == null) ? 0 : 1));
            if (V9 != null)
            {
                s.AddRange(BitConverter.GetBytes((ulong)V9));
            }

            // serialize V10
            s.Add((byte)((V10 == null) ? 0 : 1));
            if (V10 != null)
            {
                s.AddRange(BitConverter.GetBytes((float)V10));
            }

            // serialize V11
            s.Add((byte)((V11 == null) ? 0 : 1));
            if (V11 != null)
            {
                s.AddRange(BitConverter.GetBytes((double)V11));
            }

            // serialize V12
            s.Add((byte)((V12 == null) ? 0 : 1));
            if (V12 != null)
            {
                List <byte> tmp15 = new List <byte>();
                tmp15.AddRange(BitConverter.GetBytes((uint)V12.Count()));
                while (tmp15.Count > 0 && tmp15.Last() == 0)
                {
                    tmp15.RemoveAt(tmp15.Count - 1);
                }
                s.Add((byte)tmp15.Count);
                s.AddRange(tmp15);

                s.AddRange(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(V12));
            }

            // serialize V13
            s.Add((byte)((V13 == null) ? 0 : 1));
            if (V13 != null)
            {
                s.Add((byte)((sbyte)V13));
            }

            // serialize V14
            s.Add((byte)((V14 == null) ? 0 : 1));
            if (V14 != null)
            {
                s.AddRange(V14.Serialize());
            }

            // serialize V15
            s.Add((byte)((V15 == null) ? 0 : 1));
            if (V15 != null)
            {
                List <byte> tmp16 = new List <byte>();
                tmp16.AddRange(BitConverter.GetBytes((uint)V15.Count()));
                while (tmp16.Count > 0 && tmp16.Last() == 0)
                {
                    tmp16.RemoveAt(tmp16.Count - 1);
                }
                s.Add((byte)tmp16.Count);
                s.AddRange(tmp16);

                foreach (var tmp17 in V15)
                {
                    s.Add((byte)((tmp17 == null) ? 0 : 1));
                    if (tmp17 != null)
                    {
                        s.AddRange(BitConverter.GetBytes((int)tmp17));
                    }
                }
            }

            // serialize V16
            s.Add((byte)((V16 == null) ? 0 : 1));
            if (V16 != null)
            {
                List <byte> tmp18 = new List <byte>();
                tmp18.AddRange(BitConverter.GetBytes((uint)V16.Count()));
                while (tmp18.Count > 0 && tmp18.Last() == 0)
                {
                    tmp18.RemoveAt(tmp18.Count - 1);
                }
                s.Add((byte)tmp18.Count);
                s.AddRange(tmp18);

                foreach (var tmp19 in V16)
                {
                    s.Add((byte)((tmp19 == null) ? 0 : 1));
                    if (tmp19 != null)
                    {
                        List <byte> tmp20 = new List <byte>();
                        tmp20.AddRange(BitConverter.GetBytes((uint)tmp19.Count()));
                        while (tmp20.Count > 0 && tmp20.Last() == 0)
                        {
                            tmp20.RemoveAt(tmp20.Count - 1);
                        }
                        s.Add((byte)tmp20.Count);
                        s.AddRange(tmp20);

                        foreach (var tmp21 in tmp19)
                        {
                            s.Add((byte)((tmp21 == null) ? 0 : 1));
                            if (tmp21 != null)
                            {
                                s.AddRange(BitConverter.GetBytes((char)tmp21));
                            }
                        }
                    }
                }
            }

            // serialize V17
            s.Add((byte)((V17 == null) ? 0 : 1));
            if (V17 != null)
            {
                List <byte> tmp22 = new List <byte>();
                tmp22.AddRange(BitConverter.GetBytes((uint)V17.Count()));
                while (tmp22.Count > 0 && tmp22.Last() == 0)
                {
                    tmp22.RemoveAt(tmp22.Count - 1);
                }
                s.Add((byte)tmp22.Count);
                s.AddRange(tmp22);

                foreach (var tmp23 in V17)
                {
                    s.Add((byte)((tmp23.Key == null) ? 0 : 1));
                    if (tmp23.Key != null)
                    {
                        List <byte> tmp24 = new List <byte>();
                        tmp24.AddRange(BitConverter.GetBytes((uint)tmp23.Key.Count()));
                        while (tmp24.Count > 0 && tmp24.Last() == 0)
                        {
                            tmp24.RemoveAt(tmp24.Count - 1);
                        }
                        s.Add((byte)tmp24.Count);
                        s.AddRange(tmp24);

                        s.AddRange(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(tmp23.Key));
                    }

                    s.Add((byte)((tmp23.Value == null) ? 0 : 1));
                    if (tmp23.Value != null)
                    {
                        s.AddRange(BitConverter.GetBytes((int)tmp23.Value));
                    }
                }
            }

            // serialize V18
            s.Add((byte)((V18 == null) ? 0 : 1));
            if (V18 != null)
            {
                List <byte> tmp25 = new List <byte>();
                tmp25.AddRange(BitConverter.GetBytes((uint)V18.Count()));
                while (tmp25.Count > 0 && tmp25.Last() == 0)
                {
                    tmp25.RemoveAt(tmp25.Count - 1);
                }
                s.Add((byte)tmp25.Count);
                s.AddRange(tmp25);

                foreach (var tmp26 in V18)
                {
                    s.Add((byte)((tmp26.Key == null) ? 0 : 1));
                    if (tmp26.Key != null)
                    {
                        s.AddRange(BitConverter.GetBytes((char)tmp26.Key));
                    }

                    s.Add((byte)((tmp26.Value == null) ? 0 : 1));
                    if (tmp26.Value != null)
                    {
                        List <byte> tmp27 = new List <byte>();
                        tmp27.AddRange(BitConverter.GetBytes((uint)tmp26.Value.Count()));
                        while (tmp27.Count > 0 && tmp27.Last() == 0)
                        {
                            tmp27.RemoveAt(tmp27.Count - 1);
                        }
                        s.Add((byte)tmp27.Count);
                        s.AddRange(tmp27);

                        foreach (var tmp28 in tmp26.Value)
                        {
                            s.Add((byte)((tmp28 == null) ? 0 : 1));
                            if (tmp28 != null)
                            {
                                List <byte> tmp29 = new List <byte>();
                                tmp29.AddRange(BitConverter.GetBytes((uint)tmp28.Count()));
                                while (tmp29.Count > 0 && tmp29.Last() == 0)
                                {
                                    tmp29.RemoveAt(tmp29.Count - 1);
                                }
                                s.Add((byte)tmp29.Count);
                                s.AddRange(tmp29);

                                foreach (var tmp30 in tmp28)
                                {
                                    s.Add((byte)((tmp30.Key == null) ? 0 : 1));
                                    if (tmp30.Key != null)
                                    {
                                        s.AddRange(BitConverter.GetBytes((double)tmp30.Key));
                                    }

                                    s.Add((byte)((tmp30.Value == null) ? 0 : 1));
                                    if (tmp30.Value != null)
                                    {
                                        s.Add((byte)((sbyte)tmp30.Value));
                                    }
                                }
                            }
                        }
                    }
                }
            }

            // serialize V19
            s.Add((byte)((V19 == null) ? 0 : 1));
            if (V19 != null)
            {
                for (uint tmp31 = 0; tmp31 < 10; tmp31++)
                {
                    s.Add((byte)((V19[tmp31] == null) ? 0 : 1));
                    if (V19[tmp31] != null)
                    {
                        s.Add((byte)V19[tmp31]);
                    }
                }
            }

            // serialize V20
            s.Add((byte)((V20 == null) ? 0 : 1));
            if (V20 != null)
            {
                for (uint tmp32 = 0; tmp32 < 10; tmp32++)
                {
                    for (uint tmp33 = 0; tmp33 < 20; tmp33++)
                    {
                        s.Add((byte)((V20[tmp32, tmp33] == null) ? 0 : 1));
                        if (V20[tmp32, tmp33] != null)
                        {
                            List <byte> tmp34 = new List <byte>();
                            tmp34.AddRange(BitConverter.GetBytes((uint)V20[tmp32, tmp33].Count()));
                            while (tmp34.Count > 0 && tmp34.Last() == 0)
                            {
                                tmp34.RemoveAt(tmp34.Count - 1);
                            }
                            s.Add((byte)tmp34.Count);
                            s.AddRange(tmp34);

                            foreach (var tmp35 in V20[tmp32, tmp33])
                            {
                                s.Add((byte)((tmp35 == null) ? 0 : 1));
                                if (tmp35 != null)
                                {
                                    List <byte> tmp36 = new List <byte>();
                                    tmp36.AddRange(BitConverter.GetBytes((uint)tmp35.Count()));
                                    while (tmp36.Count > 0 && tmp36.Last() == 0)
                                    {
                                        tmp36.RemoveAt(tmp36.Count - 1);
                                    }
                                    s.Add((byte)tmp36.Count);
                                    s.AddRange(tmp36);

                                    s.AddRange(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(tmp35));
                                }
                            }
                        }
                    }
                }
            }

            // serialize V21
            s.Add((byte)((V21 == null) ? 0 : 1));
            if (V21 != null)
            {
                List <byte> tmp37 = new List <byte>();
                tmp37.AddRange(BitConverter.GetBytes((uint)V21.Count()));
                while (tmp37.Count > 0 && tmp37.Last() == 0)
                {
                    tmp37.RemoveAt(tmp37.Count - 1);
                }
                s.Add((byte)tmp37.Count);
                s.AddRange(tmp37);

                foreach (var tmp38 in V21)
                {
                    s.Add((byte)((tmp38 == null) ? 0 : 1));
                    if (tmp38 != null)
                    {
                        for (uint tmp39 = 0; tmp39 < 4; tmp39++)
                        {
                            s.Add((byte)((tmp38[tmp39] == null) ? 0 : 1));
                            if (tmp38[tmp39] != null)
                            {
                                s.AddRange(tmp38[tmp39].Serialize());
                            }
                        }
                    }
                }
            }

            // serialize V22
            s.Add((byte)((V22 == null) ? 0 : 1));
            if (V22 != null)
            {
                List <byte> tmp40 = new List <byte>();
                tmp40.AddRange(BitConverter.GetBytes((uint)V22.Count()));
                while (tmp40.Count > 0 && tmp40.Last() == 0)
                {
                    tmp40.RemoveAt(tmp40.Count - 1);
                }
                s.Add((byte)tmp40.Count);
                s.AddRange(tmp40);

                foreach (var tmp41 in V22)
                {
                    s.Add((byte)((tmp41.Key == null) ? 0 : 1));
                    if (tmp41.Key != null)
                    {
                        List <byte> tmp42 = new List <byte>();
                        tmp42.AddRange(BitConverter.GetBytes((uint)tmp41.Key.Count()));
                        while (tmp42.Count > 0 && tmp42.Last() == 0)
                        {
                            tmp42.RemoveAt(tmp42.Count - 1);
                        }
                        s.Add((byte)tmp42.Count);
                        s.AddRange(tmp42);

                        s.AddRange(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(tmp41.Key));
                    }

                    s.Add((byte)((tmp41.Value == null) ? 0 : 1));
                    if (tmp41.Value != null)
                    {
                        s.AddRange(tmp41.Value.Serialize());
                    }
                }
            }

            // serialize V23
            s.Add((byte)((V23 == null) ? 0 : 1));
            if (V23 != null)
            {
                for (uint tmp43 = 0; tmp43 < 5; tmp43++)
                {
                    for (uint tmp44 = 0; tmp44 < 10; tmp44++)
                    {
                        s.Add((byte)((V23[tmp43, tmp44] == null) ? 0 : 1));
                        if (V23[tmp43, tmp44] != null)
                        {
                            s.AddRange(V23[tmp43, tmp44].Serialize());
                        }
                    }
                }
            }

            return(s.ToArray());
        }