/// <summary> /// Uses the specified interning provider to intern /// strings and lists in this entity. /// This method does not test arbitrary objects to see if they implement ISupportsInterning; /// instead we assume that those are interned immediately when they are created (before they are added to this entity). /// </summary> public virtual void ApplyInterningProvider(InterningProvider provider) { if (provider == null) throw new ArgumentNullException("provider"); FreezableHelper.ThrowIfFrozen(this); name = provider.Intern(name); attributes = provider.InternList(attributes); constraints = provider.InternList(constraints); }
public override void ApplyInterningProvider(InterningProvider provider) { base.ApplyInterningProvider(provider); if (provider != null) { returnTypeAttributes = provider.InternList(returnTypeAttributes); typeParameters = provider.InternList(typeParameters); parameters = provider.InternList(parameters); } }
/// <summary> /// Uses the specified interning provider to intern /// strings and lists in this entity. /// This method does not test arbitrary objects to see if they implement ISupportsInterning; /// instead we assume that those are interned immediately when they are created (before they are added to this entity). /// </summary> public virtual void ApplyInterningProvider(InterningProvider provider) { if (provider == null) { throw new ArgumentNullException("provider"); } ThrowIfFrozen(); name = provider.Intern(name); attributes = provider.InternList(attributes); }
public override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider = null) { if (interningProvider == null) { interningProvider = InterningProvider.Dummy; } var typeArguments = new List <ITypeReference>(); foreach (var ta in this.TypeArguments) { typeArguments.Add(ta.ToTypeReference(lookupMode, interningProvider)); } string identifier = interningProvider.Intern(this.Identifier); if (typeArguments.Count == 0 && string.IsNullOrEmpty(identifier)) { // empty SimpleType is used for typeof(List<>). return(SpecialType.UnboundTypeArgument); } var t = new SimpleTypeOrNamespaceReference(identifier, interningProvider.InternList(typeArguments), lookupMode); return(interningProvider.Intern(t)); }
public override void ApplyInterningProvider(InterningProvider provider) { base.ApplyInterningProvider(provider); interfaceImplementations = provider.InternList(interfaceImplementations); }
public override ITypeReference ToTypeReference(NameLookupMode lookupMode, InterningProvider interningProvider = null) { if (interningProvider == null) { interningProvider = InterningProvider.Dummy; } TypeOrNamespaceReference t; if (this.IsDoubleColon) { if (this.Target is SimpleType st) { t = interningProvider.Intern(new AliasNamespaceReference(interningProvider.Intern(st.Identifier))); } else { t = null; } } else { t = this.Target.ToTypeReference(lookupMode, interningProvider) as TypeOrNamespaceReference; } if (t == null) { return(SpecialType.UnknownType); } var typeArguments = new List <ITypeReference>(); foreach (var ta in this.TypeArguments) { typeArguments.Add(ta.ToTypeReference(lookupMode, interningProvider)); } string memberName = interningProvider.Intern(this.MemberName); return(interningProvider.Intern(new MemberTypeOrNamespaceReference(t, memberName, interningProvider.InternList(typeArguments), lookupMode))); }
/// <summary> /// Uses the specified interning provider to intern /// strings and lists in this entity. /// This method does not test arbitrary objects to see if they implement ISupportsInterning; /// instead we assume that those are interned immediately when they are created (before they are added to this entity). /// </summary> public virtual void ApplyInterningProvider(InterningProvider provider) { if (provider == null) throw new ArgumentNullException("provider"); ThrowIfFrozen(); name = provider.Intern(name); attributes = provider.InternList(attributes); if (rareFields != null) rareFields.ApplyInterningProvider(provider); }
public override void ApplyInterningProvider(InterningProvider provider) { base.ApplyInterningProvider(provider); parameters = provider.InternList(parameters); }