Exemplo n.º 1
0
 public override int GetHashCode()
 {
     return(Identifier.GetHashCode()
            ^ Type.GetHashCode()
            ^ IsArray.GetHashCode()
            ^ IsNullable.GetHashCode());
 }
Exemplo n.º 2
0
        public void Add(dynamic value)
        {
            IsArray.AssertTrue();
            var max_index = _complex.Keys.Select(s => int.Parse(s)).MaxOrDefault(-1);

            // todo. wtf dynamic ain't work here as well
            _complex.Add(ImportKey(max_index + 1), ImportValue((Object)value));
        }
Exemplo n.º 3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (FullName != null ? FullName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsArray.GetHashCode();
         hashCode = (hashCode * 397) ^ IsByRef.GetHashCode();
         return(hashCode);
     }
 }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (PackageName != null ? PackageName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TypeName != null ? TypeName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsBuiltIn.GetHashCode();
         hashCode = (hashCode * 397) ^ IsArray.GetHashCode();
         hashCode = (hashCode * 397) ^ ArraySize;
         return(hashCode);
     }
 }
Exemplo n.º 5
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Type != null?Type.GetHashCode() : 0;

                hashCode = GenericArguments.Aggregate(hashCode,
                                                      (current, type) => (current * 397) ^ (type != null ? type.GetHashCode() : 0));
                hashCode = (hashCode * 397) ^ IsArray.GetHashCode();
                hashCode = ArrayDimensions.Aggregate(hashCode, (current, dim) => (current * 397) ^ dim.GetHashCode());
                return(hashCode);
            }
        }
Exemplo n.º 6
0
            public override int GetHashCode()
            {
                unchecked // overflow is fine, just wrap
                {
                    var hash = 17;

                    // suitable nullity checks etc, of course :)
                    hash = hash * 23 + IsPrimitive.GetHashCode();
                    hash = hash * 23 + IsArray.GetHashCode();
                    hash = hash * 23 + Properties.GetHashCode();

                    return(hash);
                }
            }
Exemplo n.º 7
0
        public void Insert(int index, dynamic value)
        {
            IsArray.AssertTrue();

            var before = _complex.Where(kvp => int.Parse(kvp.Key) < index).ToDictionary();
            // todo. wtf dynamic ain't work here as well
            var inserted = new KeyValuePair <String, Json>(ImportKey(index), ImportValue((Object)value)).MkArray().ToDictionary();
            var after    = _complex.Where(kvp => int.Parse(kvp.Key) >= index).ToDictionary(kvp => (int.Parse(kvp.Key) + 1).ToString(), kvp => kvp.Value);

            _complex.Clear();
            _complex.AddElements(before);
            _complex.AddElements(inserted);
            _complex.AddElements(after);
        }
Exemplo n.º 8
0
        public override int GetHashCode()
        {
            var hashCode = -1128608277;

            if (Name != null)
            {
                hashCode = hashCode * -1521134295 + Name.GetHashCode();
            }
            hashCode = hashCode * -1521134295 + Address.GetHashCode();
            hashCode = hashCode * -1521134295 + Size.GetHashCode();
            hashCode = hashCode * -1521134295 + Type.GetHashCode();
            hashCode = hashCode * -1521134295 + IsArray.GetHashCode();
            hashCode = hashCode * -1521134295 + IsPointer.GetHashCode();
            hashCode = hashCode * -1521134295 + DisplayType.GetHashCode();
            hashCode = hashCode * -1521134295 + FixedAddr.GetHashCode();
            return(hashCode);
        }
Exemplo n.º 9
0
 public override int GetHashCode()
 {
     return(Context.GetHashCode() ^ (Type.GetHashCode() << 3) ^ (IsArray.GetHashCode() << 6));
 }
Exemplo n.º 10
0
        public virtual string GetProperty(string strPropertyName, string strFormat, System.Globalization.CultureInfo formatProvider, DotNetNuke.Entities.Users.UserInfo accessingUser, DotNetNuke.Services.Tokens.Scope accessLevel, ref bool propertyNotFound)
        {
            switch (strPropertyName.ToLower())
            {
            case "classid": // Int
                return(ClassId.ToString(strFormat, formatProvider));

            case "namespaceid": // Int
                return(NamespaceId.ToString(strFormat, formatProvider));

            case "componentid": // Int
                if (ComponentId == null)
                {
                    return("");
                }
                ;
                return(((int)ComponentId).ToString(strFormat, formatProvider));

            case "classname": // NVarChar
                return(PropertyAccess.FormatString(ClassName, strFormat));

            case "declaration": // NVarChar
                if (Declaration == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(Declaration, strFormat));

            case "documentation": // NVarCharMax
                if (Documentation == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(Documentation, strFormat));

            case "description": // NVarCharMax
                if (Description == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(Description, strFormat));

            case "appearedinversion": // VarChar
                return(PropertyAccess.FormatString(AppearedInVersion, strFormat));

            case "deprecatedinversion": // VarChar
                if (DeprecatedInVersion == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(DeprecatedInVersion, strFormat));

            case "disappearedinversion": // VarChar
                if (DisappearedInVersion == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(DisappearedInVersion, strFormat));

            case "isdeprecated": // Bit
                return(IsDeprecated.ToString());

            case "deprecationmessage": // NVarChar
                if (DeprecationMessage == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(DeprecationMessage, strFormat));

            case "documentationid": // Int
                if (DocumentationId == null)
                {
                    return("");
                }
                ;
                return(((int)DocumentationId).ToString(strFormat, formatProvider));

            case "pendingdescription": // NVarCharMax
                if (PendingDescription == null)
                {
                    return("");
                }
                ;
                return(PropertyAccess.FormatString(PendingDescription, strFormat));

            case "fullname": // NVarChar
                return(PropertyAccess.FormatString(FullName, strFormat));

            case "isabstract": // Bit
                return(IsAbstract.ToString());

            case "isansiclass": // Bit
                return(IsAnsiClass.ToString());

            case "isarray": // Bit
                return(IsArray.ToString());

            case "isautoclass": // Bit
                return(IsAutoClass.ToString());

            case "isautolayout": // Bit
                return(IsAutoLayout.ToString());

            case "isbeforefieldinit": // Bit
                return(IsBeforeFieldInit.ToString());

            case "isbyreference": // Bit
                return(IsByReference.ToString());

            case "isclass": // Bit
                return(IsClass.ToString());

            case "isdefinition": // Bit
                return(IsDefinition.ToString());

            case "isenum": // Bit
                return(IsEnum.ToString());

            case "isexplicitlayout": // Bit
                return(IsExplicitLayout.ToString());

            case "isfunctionpointer": // Bit
                return(IsFunctionPointer.ToString());

            case "isgenericinstance": // Bit
                return(IsGenericInstance.ToString());

            case "isgenericparameter": // Bit
                return(IsGenericParameter.ToString());

            case "isimport": // Bit
                return(IsImport.ToString());

            case "isinterface": // Bit
                return(IsInterface.ToString());

            case "isnested": // Bit
                return(IsNested.ToString());

            case "isnestedassembly": // Bit
                return(IsNestedAssembly.ToString());

            case "isnestedprivate": // Bit
                return(IsNestedPrivate.ToString());

            case "isnestedpublic": // Bit
                return(IsNestedPublic.ToString());

            case "isnotpublic": // Bit
                return(IsNotPublic.ToString());

            default:
                propertyNotFound = true;
                break;
            }

            return(Null.NullString);
        }
Exemplo n.º 11
0
 public void RemoveAt(int index)
 {
     IsArray.AssertTrue();
     _complex.Remove(ImportKey(index));
 }
Exemplo n.º 12
0
 public int IndexOf(dynamic value)
 {
     IsArray.AssertTrue();
     // todo. wtf dynamic ain't work here as well
     return(_complex.IndexOf(kvp => Equals(kvp.Value, ImportValue((Object)value))));
 }
Exemplo n.º 13
0
 public bool Contains(dynamic value)
 {
     IsArray.AssertTrue();
     return(IndexOf(ImportValue(value)) != -1);
 }