private HostObject(object target, Type type) { target = CanonicalRefTable.GetCanonicalRef(target); if (type == null) { type = target.GetType(); } if (type.IsUnknownCOMObject()) { if (target is IEnumVARIANT enumVariant) { target = new EnumeratorWrapper(enumVariant); type = typeof(IEnumerator); } } this.target = target; this.type = type; }
private HostObject(object target, Type type) { this.target = CanonicalRefTable.GetCanonicalRef(target); this.type = type ?? target.GetType(); }