Пример #1
0
        public COMObject(COMObject parentObject, object comProxy, Type comProxyType)
        {
            // copy current factory info or set default
            if (null != parentObject)
            {
                Factory = parentObject.Factory;
            }
            else
            {
                Factory = Core.Default;
            }

            _parentObject     = parentObject;
            _underlyingObject = comProxy;

            if (null != comProxyType)
            {
                _instanceType = comProxyType;
            }
            else
            {
                comProxyType.GetType();
            }

            if (Settings.Default.EnableProxyManagement && !Object.ReferenceEquals(parentObject, null))
            {
                _parentObject.AddChildObject(this);
            }

            Factory.AddObjectToList(this);
        }
Пример #2
0
        public COMObject(Core factory, COMObject replacedObject)
        {
            // copy current factory info or set default
            if (null == factory)
            {
                factory = Core.Default;
            }
            Factory = factory;

            // copy proxy
            _underlyingObject = replacedObject.UnderlyingObject;
            _parentObject     = replacedObject.ParentObject;
            _instanceType     = replacedObject.InstanceType;

            // copy childs
            foreach (COMObject item in replacedObject.ChildObjects)
            {
                AddChildObject(item);
            }

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

                // add himself as child to parent object
                parentObject.AddChildObject(this);
            }

            Factory.RemoveObjectFromList(replacedObject);
            Factory.AddObjectToList(this);
        }
Пример #3
0
        public COMObject(COMObject replacedObject)
        {
            Factory.CheckInitialize();

            // copy proxy
            _underlyingObject = replacedObject.UnderlyingObject;
            _parentObject     = replacedObject.ParentObject;
            _instanceType     = replacedObject.InstanceType;

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

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

                // add himself as child to parent object
                parentObject.AddChildObject(this);
            }

            Factory.RemoveObjectFromList(replacedObject);
            Factory.AddObjectToList(this);
        }
Пример #4
0
        public COMObject(COMObject parentObject, object comProxy, Type comProxyType)
        {
            Factory.CheckInitialize();

            _parentObject     = parentObject;
            _underlyingObject = comProxy;
            _instanceType     = comProxyType;

            if (Settings.EnableProxyManagement && !Object.ReferenceEquals(parentObject, null))
            {
                _parentObject.AddChildObject(this);
            }

            Factory.AddObjectToList(this);
        }
Пример #5
0
        public COMObject(Core factory, COMObject parentObject, object comProxy)
        {
            // copy current factory info or set default
            if (null == factory)
            {
                factory = Core.Default;
            }
            Factory = factory;

            _parentObject     = parentObject;
            _underlyingObject = comProxy;
            _instanceType     = comProxy.GetType();

            if (Settings.Default.EnableProxyManagement && !Object.ReferenceEquals(parentObject, null))
            {
                _parentObject.AddChildObject(this);
            }

            Factory.AddObjectToList(this);
        }
Пример #6
0
        public COMObject(COMObject parentObject, object comProxy, Type comProxyType)
        {
            // copy current factory info or set default
            if (null != parentObject)
                Factory = parentObject.Factory;
            else
                Factory = Core.Default;

            _parentObject = parentObject;
            _underlyingObject = comProxy;

            if (null != comProxyType)
                _instanceType = comProxyType;
            else
                comProxyType.GetType();

            if (Settings.Default.EnableProxyManagement && !Object.ReferenceEquals(parentObject, null))
                _parentObject.AddChildObject(this);

            Factory.AddObjectToList(this);
        }
Пример #7
0
        public COMObject(Core factory, COMObject parentObject, object comProxy, bool isEnumerator)
        {
            // copy current factory info
            if (null == factory)
                factory = Core.Default;
            Factory = factory;

            _parentObject = parentObject;
            _underlyingObject = comProxy;
            _isEnumerator = isEnumerator;
            _instanceType = comProxy.GetType();

            if (Settings.Default.EnableProxyManagement && !Object.ReferenceEquals(parentObject, null))
                _parentObject.AddChildObject(this);

            Factory.AddObjectToList(this);
        }
Пример #8
0
        public COMObject(COMObject parentObject, object comProxy, Type comProxyType)
        {
            Factory.CheckInitialize();

            _parentObject = parentObject;
            _underlyingObject = comProxy;
            _instanceType = comProxyType;
            
            if(!Object.ReferenceEquals(parentObject, null))
                _parentObject.AddChildObject(this);

            Factory.AddObjectToList(this);
        }
Пример #9
0
        public COMObject(COMObject parentObject, object comProxy, bool isEnumerator)
        {
            Factory.CheckInitialize();

            _parentObject = parentObject;
            _underlyingObject = comProxy;
            _isEnumerator = isEnumerator;
            _instanceType = comProxy.GetType();

            if (!Object.ReferenceEquals(parentObject, null))
                _parentObject.AddChildObject(this);

            Factory.AddObjectToList(this);
        }