public COMObject(COMObject parentObject, object comProxy, Type comProxyType)
        {
            _parentObject     = parentObject;
            _underlyingObject = comProxy;
            _instanceType     = comProxyType;

            if (null != parentObject)
            {
                _parentObject.AddChildObject(this);
            }
        }
示例#2
0
        public COMVariant(COMObject parentObject, object unkownObject, Type unkownObjectType)
        {
            _parentObject     = parentObject;
            _underlyingObject = unkownObject;
            _instanceType     = unkownObjectType;

            if ((true == _instanceType.IsCOMObject) && (null != parentObject))
            {
                parentObject.AddChildObject(this);
            }
        }
        public COMObject(COMVariant replacedObject)
        {
            if (false == replacedObject.IsCOMProxy)
            {
                throw new ArgumentException("argument is not a com proxy");
            }

            // remove variant from parent and add himself
            COMObject parent = replacedObject.ParentObject;

            parent.RemoveChildObject(replacedObject);
            parent.AddChildObject(this);

            // store members
            _parentObject     = parent;
            _underlyingObject = replacedObject.UnderlyingObject;
            _instanceType     = replacedObject.InstanceType;
        }
        public COMObject(COMObject replacedObject)
        {
            // copy proxy
            _underlyingObject = replacedObject.UnderlyingObject;
            _parentObject     = replacedObject.ParentObject;
            _instanceType     = replacedObject.InstanceType;

            // copy childs
            foreach (IObject item in replacedObject.ListChildObjects)
            {
                AddChildObject(item);
            }

            // remove old object from parent chain
            if (null != replacedObject.ParentObject)
            {
                COMObject parentObject = replacedObject.ParentObject;
                parentObject.RemoveChildObject(replacedObject);

                // add himself as child to parent object
                parentObject.AddChildObject(this);
            }
        }
示例#5
0
        public COMObject(COMObject parentObject, object comProxy, Type comProxyType)
        {
            _parentObject = parentObject;
            _underlyingObject = comProxy;
            _instanceType = comProxyType;

            if (null != parentObject)
                _parentObject.AddChildObject(this);

            Factory.AddObjectToList(this);
        }
示例#6
0
        public COMObject(COMObject parentObject, object comProxy, bool isEnumerator)
        {
            _parentObject = parentObject;
            _underlyingObject = comProxy;
            _isEnumerator = isEnumerator;
            _instanceType = comProxy.GetType();

            if (null != parentObject)
                _parentObject.AddChildObject(this);

            Factory.AddObjectToList(this);
        }