Пример #1
0
        private bool HasReferencedAssembly(AssemblyGroup assemblyGroup)
        {
            bool           flag;
            IPlatformTypes platformMetadata = (IPlatformTypes)this.PlatformMetadata;

            using (IEnumerator <IAssemblyId> enumerator = platformMetadata.GetAssemblyGroup(assemblyGroup).GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    IAssemblyId current = enumerator.Current;
                    using (IEnumerator <IAssembly> enumerator1 = this.AssemblyReferences.GetEnumerator())
                    {
                        while (enumerator1.MoveNext())
                        {
                            IAssemblyId assemblyId = enumerator1.Current;
                            if (current.Name != assemblyId.Name)
                            {
                                continue;
                            }
                            flag = true;
                            return(flag);
                        }
                    }
                }
                return(false);
            }
            return(flag);
        }
Пример #2
0
        public virtual IType ResolveType(ITypeId typeId)
        {
            IType                type;
            IPlatformTypes       platformMetadata     = (IPlatformTypes)this.PlatformMetadata;
            ProjectNeutralTypeId projectNeutralTypeId = typeId as ProjectNeutralTypeId;

            if (projectNeutralTypeId != null && projectNeutralTypeId.AssemblyGroup != AssemblyGroup.Interactivity && !this.HasReferencedAssembly(projectNeutralTypeId.AssemblyGroup))
            {
                return(PlatformTypes.NullTypeInstance);
            }
            IType type1 = this.PlatformMetadata.ResolveType(typeId);

            if (!this.PlatformMetadata.IsNullType(type1))
            {
                return(type1);
            }
            if (projectNeutralTypeId != null)
            {
                using (IEnumerator <IAssemblyId> enumerator = platformMetadata.GetAssemblyGroup(projectNeutralTypeId.AssemblyGroup).GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        IAssemblyId current = enumerator.Current;
                        type1 = this.GetType(current.Name, projectNeutralTypeId.FullName);
                        if (type1 == null)
                        {
                            using (IEnumerator <string> enumerator1 = projectNeutralTypeId.PotentialFullNames.GetEnumerator())
                            {
                                while (enumerator1.MoveNext())
                                {
                                    string str = enumerator1.Current;
                                    type1 = this.GetType(current.Name, str);
                                    if (type1 == null)
                                    {
                                        continue;
                                    }
                                    type = type1;
                                    return(type);
                                }
                            }
                        }
                        else
                        {
                            type = type1;
                            return(type);
                        }
                    }
                    return(PlatformTypes.NullTypeInstance);
                }
                return(type);
            }
            return(PlatformTypes.NullTypeInstance);
        }
Пример #3
0
        public override bool Equals(object obj)
        {
            bool flag;

            if (this == obj)
            {
                return(true);
            }
            ITypeId typeId = obj as ITypeId;

            if (typeId != null && (base.FullName == typeId.FullName || this.MatchesPotentialFullName(typeId.FullName)))
            {
                ProjectContextType projectContextType = typeId as ProjectContextType;
                if (projectContextType == null)
                {
                    return(true);
                }
                IPlatformTypes platformMetadata = (IPlatformTypes)projectContextType.PlatformMetadata;
                using (IEnumerator <IAssemblyId> enumerator = platformMetadata.GetAssemblyGroup(this.AssemblyGroup).GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        IAssemblyId current = enumerator.Current;
                        if (projectContextType.RuntimeAssembly.Name != current.Name)
                        {
                            continue;
                        }
                        flag = true;
                        return(flag);
                    }
                    return(false);
                }
                return(flag);
            }
            return(false);
        }