Esempio n. 1
0
            public SaveBinary(Save save)
            {
                int count = save.ValueCount;

                for (int i = 0; i < count; i++)
                {
                    string name = save.GetValueNameByIndex(i);
                    Value  v    = save.GetValue(name);
                    if (v != null)
                    {
                        ValueBinary vb = null;
                        if (v.ValueType == TValue.Boolean)
                        {
                            vb = new ValueBinary(name, v.Boolean);
                        }
                        else if (v.ValueType == TValue.Int)
                        {
                            vb = new ValueBinary(name, v.Int);
                        }
                        else if (v.ValueType == TValue.Float)
                        {
                            vb = new ValueBinary(name, v.Float);
                        }

                        if (vb != null)
                        {
                            Values.Add(vb);
                        }
                    }
                }
            }
Esempio n. 2
0
            protected SaveBinary(SerializationInfo info, StreamingContext context)
            {
                int count = info.GetInt32("Value.Count");

                for (int i = 0; i < count; i++)
                {
                    ValueBinary v = (ValueBinary)info.GetValue("Element." + i, typeof(ValueBinary));
                    Values.Add(v);
                }
            }
Esempio n. 3
0
        public int CompareTo(SCIMRepresentationAttribute other)
        {
            switch (SchemaAttribute.Type)
            {
            case SCIMSchemaAttributeTypes.BINARY:
                return(ValueBinary.CompareTo(other.ValueBinary));

            case SCIMSchemaAttributeTypes.DATETIME:
                if (ValueDateTime == null)
                {
                    return(-1);
                }

                if (other.ValueDateTime == null)
                {
                    return(1);
                }

                return(ValueDateTime.Value.CompareTo(other.ValueDateTime.Value));

            case SCIMSchemaAttributeTypes.DECIMAL:
                if (ValueDecimal == null)
                {
                    return(-1);
                }

                if (other.ValueDecimal == null)
                {
                    return(1);
                }

                return(ValueDecimal.Value.CompareTo(other.ValueDecimal.Value));

            case SCIMSchemaAttributeTypes.INTEGER:
                if (ValueInteger == null)
                {
                    return(-1);
                }

                if (other.ValueInteger == null)
                {
                    return(1);
                }

                return(ValueInteger.Value.CompareTo(other.ValueInteger.Value));

            case SCIMSchemaAttributeTypes.REFERENCE:
                return(ValueReference.CompareTo(other.ValueReference));

            case SCIMSchemaAttributeTypes.STRING:
                return(ValueString.CompareTo(other.ValueString));
            }

            return(0);
        }