public bool ExtraUsedType(QualifiedTypeName name) { var assemblyDef = default(AssemblyDef); var typeDef = default(TypeDef); if (name.PrimTryResolve(Global, out assemblyDef, out typeDef)) { return(typeDef.MarkAsUsed(this, assemblyDef)); } return(false); }
public bool FirstOccuranceOfType(MessageContext ctxt, CST.QualifiedTypeName name, Trace trace) { var prev = default(Trace); if (TypeToTrace.TryGetValue(name, out prev)) { Env.Log(new DuplicateTraceEntryMessage(ctxt, prev.Name, trace.Name)); return(false); } else { TypeToTrace.Add(name, trace); return(true); } }
private PE.Row TypeDefOrRefRowFromQualifiedTypeName(DllSaveContext ctxt, QualifiedTypeName name) { if (name.Assembly.Equals(ctxt.AssemblyName)) { var assemblyDef = default(AssemblyDef); var typeDef = default(TypeDef); if (!name.PrimTryResolve(rootEnv.Global, out assemblyDef, out typeDef)) { throw new InvalidOperationException("no such type"); } return(TypeDefRowFromTypeDef(ctxt, typeDef)); } else { var row = default(PE.TypeRefRow); var resScope = default(PE.Row); if (name.Type.IsNested) { resScope = TypeDefOrRefRowFromQualifiedTypeName(ctxt, name.Outer()); } else { resScope = AssemblyNameToAssemblyRefRow(ctxt, name.Assembly); } if (!ctxt.QualifiedTypeNameToRowCache.TryGetValue(name, out row)) { row = new PE.TypeRefRow { ResolutionScope = { Value = resScope }, TypeName = { Value = name.Type.Types[name.Type.Types.Count - 1] }, TypeNamespace = { Value = name.Type.Namespace } }; ctxt.QualifiedTypeNameToRowCache.Add(name, row); } return(row); } }
public InvalidTypeName(MessageContext ctxt, QualifiedTypeName name, string message) : base(ctxt, Severity.Warning, "1020") { Name = name; Message = message; }
public NamedTypeRef(QualifiedTypeName name, params TypeRef[] arguments) : this(null, name, arguments) { }
public NamedTypeRef(IImSeq <Annotation> annotations, QualifiedTypeName name, params TypeRef[] arguments) : base(annotations) { this.name = name; this.arguments = arguments == null || arguments.Length == 0 ? Constants.EmptyTypeRefs : new Seq <TypeRef>(arguments); }
public NamedTypeRef(QualifiedTypeName name, IImSeq <TypeRef> arguments) : this(null, name, arguments) { }
public NamedTypeRef(IImSeq <Annotation> annotations, QualifiedTypeName name, IImSeq <TypeRef> arguments) : base(annotations) { this.name = name; this.arguments = arguments ?? Constants.EmptyTypeRefs; }
public static TypeRef Named(QualifiedTypeName name, IImSeq <TypeRef> arguments) { return(new NamedTypeRef(name, arguments)); }
public static TypeRef Named(QualifiedTypeName name, params TypeRef[] arguments) { return(new NamedTypeRef(name)); }
public QualifiedMemberName(QualifiedTypeName definingType, Signature signature) { DefiningType = definingType; Signature = signature; }