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