Exemplo n.º 1
0
 protected virtual void WriteProperties(XmlWriter aWriter)
 {
     aWriter.WriteAttributeString("Name", Name);
     aWriter.WriteAttributeString("Path", Path);
     aWriter.WriteAttributeString("Description", Description);
     aWriter.WriteAttributeString("IsAbstract", IsAbstract.ToString());
     aWriter.WriteAttributeString("Type", Type.ToString());
 }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public override int GetHashCode()
        {
            var hashCode = base.GetHashCode();

            hashCode = hashCode *
                       -1521134295 + SuperTypeId.GetHashSafe();
            hashCode = hashCode *
                       -1521134295 + IsAbstract.GetHashSafe();
            return(hashCode);
        }
Exemplo n.º 3
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Type != null?Type.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ IsAbstract.GetHashCode();
                hashCode = (hashCode * 397) ^ IsSealed.GetHashCode();
                hashCode = (hashCode * 397) ^ IsValueType.GetHashCode();
                hashCode = (hashCode * 397) ^ IsEnum.GetHashCode();
                return(hashCode);
            }
        }
Exemplo n.º 4
0
    public override int GetHashCode()
    {
        unchecked
        {
            var hashCode = EnumTypeFullyQualified.GetHashCode();
            hashCode = (hashCode * 397) ^ IsValidatable.GetHashCode();
            hashCode = (hashCode * 397) ^ HasCreateInvalidImplementation.GetHashCode();
            hashCode = (hashCode * 397) ^ IsReferenceType.GetHashCode();
            hashCode = (hashCode * 397) ^ IsAbstract.GetHashCode();
            hashCode = (hashCode * 397) ^ AttributeInfo.GetHashCode();
            hashCode = (hashCode * 397) ^ KeyProperty.GetHashCode();
            hashCode = (hashCode * 397) ^ (BaseEnum?.GetHashCode() ?? 0);
            hashCode = (hashCode * 397) ^ Settings.GetHashCode();
            hashCode = (hashCode * 397) ^ ItemNames.ComputeHashCode();
            hashCode = (hashCode * 397) ^ AssignableInstanceFieldsAndProperties.ComputeHashCode();
            hashCode = (hashCode * 397) ^ FullyQualifiedDerivedTypes.ComputeHashCode();

            return(hashCode);
        }
    }
Exemplo n.º 5
0
        public XElement ToXml()
        {
            var xElement = new XElement(ElementXNames.Element,
                                        new XAttribute(ElementXNames.Abstract, IsAbstract.ToString().ToLowerInvariant()),
                                        new XAttribute(ElementXNames.Id, Id),
                                        new XAttribute(ElementXNames.Name, Name.LocalName),
                                        new XAttribute(ElementXNames.Nillable, "true"),
                                        new XAttribute(ElementXNames.SubstitutionGroup, SubstitutionGroup),
                                        new XAttribute(ElementXNames.Type, DataType),
                                        new XAttribute(ElementXNames.PeriodType, PeriodType)
                                        );

            // A small (about 150) number of IFRS concepts are monetary and still lack a balance type. This occurs, e.g. for prices.
            if (DataType == DataTypeRegistry.Monetary && BalanceType != null)
            {
                xElement.Add(new XAttribute(ElementXNames.Balance, BalanceType));
            }

            return(xElement);
        }
Exemplo n.º 6
0
        private Tuple <Accessibility, IsAbstract, IsStatic, IsVirtual> EmitModifiers(MethodBase method)
        {
            Accessibility access = Accessibility.Private;

            if (method.IsPublic)
            {
                access = Accessibility.Public;
            }
            else if (method.IsFamily)
            {
                access = Accessibility.Protected;
            }
            else if (method.IsFamilyAndAssembly)
            {
                access = Accessibility.ProtectedInternal;
            }

            IsAbstract isAbstract = IsAbstract.NotAbstract;

            if (method.IsAbstract)
            {
                isAbstract = IsAbstract.Abstract;
            }

            IsStatic isStatic = IsStatic.NotStatic;

            if (method.IsStatic)
            {
                isStatic = IsStatic.Static;
            }

            IsVirtual isVirtual = IsVirtual.NotVirtual;

            if (method.IsVirtual)
            {
                isVirtual = IsVirtual.Virtual;
            }

            return(new Tuple <Accessibility, IsAbstract, IsStatic, IsVirtual>(access, isAbstract, isStatic, isVirtual));
        }
Exemplo n.º 7
0
        private Tuple <Accessibility, IsSealed, IsAbstract> EmitModifiers(Type type)
        {
            Accessibility accessLevel = Accessibility.Private;

            // check if not default
            if (type.IsPublic)
            {
                accessLevel = Accessibility.Public;
            }
            else if (type.IsNestedPublic)
            {
                accessLevel = Accessibility.Public;
            }
            else if (type.IsNestedFamily)
            {
                accessLevel = Accessibility.Protected;
            }
            else if (type.IsNestedFamANDAssem)
            {
                accessLevel = Accessibility.ProtectedInternal;
            }

            IsSealed sealedEnum = IsSealed.NotSealed;

            if (type.IsSealed)
            {
                sealedEnum = IsSealed.Sealed;
            }

            IsAbstract abstractEnum = IsAbstract.NotAbstract;

            if (type.IsAbstract)
            {
                abstractEnum = IsAbstract.Abstract;
            }

            return(new Tuple <Accessibility, IsSealed, IsAbstract>(accessLevel, sealedEnum, abstractEnum));
        }
Exemplo n.º 8
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);
        }