public static TypeReference[] WrapIfByRef(TypeReference[] references) { TypeReference[] result = new TypeReference[references.Length]; for (int i = 0; i < references.Length; i++) { result[i] = WrapIfByRef(references[i]); } return result; }
public static TypeReference WrapIfByRef(TypeReference reference) { return reference.Type.IsByRef ? new IndirectReference(reference) : reference; }
public IndirectReference(TypeReference byRefReference) : base(byRefReference, byRefReference.Type.GetElementType()) { if (! byRefReference.Type.IsByRef) throw new ArgumentException("Expected a reference whose type IsByRef", "byRefReference"); }