Esempio n. 1
0
 public override bool Equals(object obj)
 {
     if (obj != null)
     {
         BPrimitiveType Casted = (BPrimitiveType)obj;
         if (Casted != null && Casted.Type == Type)
         {
             return((Casted.Type == EBPrimitiveTypeEnum.Double && Casted.AsDouble == AsDouble) ||
                    (Casted.Type == EBPrimitiveTypeEnum.Integer && Casted.AsInteger == AsInteger) ||
                    (Casted.Type == EBPrimitiveTypeEnum.String && Casted.AsString == AsString) ||
                    (Casted.Type == EBPrimitiveTypeEnum.ByteArray && Casted.ToString() == ToString()));
         }
     }
     return(false);
 }
Esempio n. 2
0
        public void SetKeyValuePrimitiveReference(BPrimitiveType _PrimitiveRef)
        {
            KeyValuePrimitiveType = (int)_PrimitiveRef.Type;
            switch (_PrimitiveRef.Type)
            {
            case EBPrimitiveTypeEnum.ByteArray:
                KeyValueStringified = Convert.ToBase64String(_PrimitiveRef.AsByteArray);
                break;

            case EBPrimitiveTypeEnum.Double:
                KeyValueStringified = "" + _PrimitiveRef.AsDouble;
                break;

            case EBPrimitiveTypeEnum.Integer:
                KeyValueStringified = "" + _PrimitiveRef.AsInteger;
                break;

            case EBPrimitiveTypeEnum.String:
                KeyValueStringified = _PrimitiveRef.AsString;
                break;
            }
        }
Esempio n. 3
0
        public BPrimitiveType(BPrimitiveType _Other)
        {
            Type = _Other.Type;
            switch (Type)
            {
            case EBPrimitiveTypeEnum.Double:
                AsDouble = _Other.AsDouble;
                break;

            case EBPrimitiveTypeEnum.Integer:
                AsInteger = _Other.AsInteger;
                break;

            case EBPrimitiveTypeEnum.ByteArray:
                AsByteArray = _Other.AsByteArray;
                break;

            default:
                AsString = _Other.AsString;
                break;
            }
        }
Esempio n. 4
0
 public BPrimitiveType_JStringified(BPrimitiveType _PrimitiveRef)
 {
     SetKeyValuePrimitiveReference(_PrimitiveRef);
 }