Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 private HostObject(object target, Type type)
 {
     this.target = CanonicalRefTable.GetCanonicalRef(target);
     this.type   = type ?? target.GetType();
 }