Beispiel #1
0
        // ----------------------------------------------------------------------
        // Type references
        // ----------------------------------------------------------------------

        private PE.Row TypeDefOrRefRowFromTypeRef(DllSaveContext ctxt, TypeRef typeRef)
        {
            var row = default(PE.Row);

            if (!ctxt.TypeRefToRowCache.TryGetValue(typeRef, out row))
            {
                if (typeRef.Arguments.Count == 0)
                {
                    row = TypeDefOrRefRowFromQualifiedTypeName(ctxt, typeRef.QualifiedTypeName);
                }
                else
                {
                    row = new PE.TypeSpecRow {
                        Signature = { Value = TypeSigFromTypeRef(ctxt, typeRef) }
                    }
                };
                ctxt.TypeRefToRowCache.Add(typeRef, row);
            }
            return(row);
        }
Beispiel #2
0
        // ----------------------------------------------------------------------
        // Type references
        // ----------------------------------------------------------------------

        private PE.Row TypeDefOrRefRowFromTypeRef(DllSaveContext ctxt, TypeRef typeRef)
        {
            var row = default(PE.Row);
            if (!ctxt.TypeRefToRowCache.TryGetValue(typeRef, out row))
            {
                if (typeRef.Arguments.Count == 0)
                    row = TypeDefOrRefRowFromQualifiedTypeName(ctxt, typeRef.QualifiedTypeName);
                else
                    row = new PE.TypeSpecRow { Signature = { Value = TypeSigFromTypeRef(ctxt, typeRef) } };
                ctxt.TypeRefToRowCache.Add(typeRef, row);
            }
            return row;
        }