Exemple #1
0
        public ByteArray Array2Binary(IAWArray array)
        {
            ByteArray byteArray = new ByteArray();

            byteArray.WriteByte(Convert.ToByte(17));
            byteArray.WriteShort(Convert.ToInt16(array.Size()));
            return(this.Arr2bin(array, byteArray));
        }
Exemple #2
0
 private ByteArray Arr2bin(IAWArray array, ByteArray buffer)
 {
     for (int i = 0; i < array.Size(); i++)
     {
         AWDataWrapper wrappedElementAt = array.GetWrappedElementAt(i);
         buffer = this.EncodeObject(buffer, wrappedElementAt.Type, wrappedElementAt.Data);
     }
     return(buffer);
 }
Exemple #3
0
        private ArrayList RebuildArray(IAWArray sfsArr)
        {
            ArrayList arrayList = new ArrayList();

            for (int i = 0; i < sfsArr.Size(); i++)
            {
                arrayList.Add(this.UnwrapField(sfsArr.GetWrappedElementAt(i)));
            }
            return(arrayList);
        }
Exemple #4
0
 private void ConvertSFSObject(IAWArray fieldList, object csObj, Type objType)
 {
     for (int i = 0; i < fieldList.Size(); i++)
     {
         IAWObject     sFSObject = fieldList.GetAWObject(i);
         string        utfString = sFSObject.GetUtfString(DefaultAWDataSerializer.FIELD_NAME_KEY);
         AWDataWrapper data      = sFSObject.GetData(DefaultAWDataSerializer.FIELD_VALUE_KEY);
         object        value     = this.UnwrapField(data);
         FieldInfo     field     = objType.GetField(utfString, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
         if (field != null)
         {
             field.SetValue(csObj, value);
         }
     }
 }