Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        public COMObject(Core factory, COMObject parentObject, object comProxy, Type comProxyType)
        {
            // copy current factory info
            if (null == factory)
            {
                factory = Core.Default;
            }
            Factory = factory;

            _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);
        }
Ejemplo n.º 3
0
        public COMObject(Core factory, string progId)
        {
            // copy current factory info
            if (null == factory)
            {
                factory = Core.Default;
            }
            Factory = factory;

            CreateFromProgId(progId);
            Factory.AddObjectToList(this);
        }
Ejemplo n.º 4
0
        public COMObject(Core factory, object comProxy)
        {
            // copy current factory info or set default
            if (null == factory)
            {
                factory = Core.Default;
            }
            Factory = factory;

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

            Factory.AddObjectToList(this);
        }
Ejemplo n.º 5
0
        public COMObject(Core factory, string progId)
        {
            // copy current factory info
            if (null == factory)
                factory = Core.Default;
            Factory = factory;

            CreateFromProgId(progId);
            Factory.AddObjectToList(this);
        }
Ejemplo n.º 6
0
        public COMObject(Core factory, COMObject parentObject, object comProxy, Type comProxyType)
        {
            // copy current factory info
            if (null == factory)
                factory = Core.Default;
            Factory = factory;

            _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);
        }
Ejemplo n.º 7
0
        public COMObject(Core factory, object comProxy)
        {
            // copy current factory info or set default
            if (null == factory)
                factory = Core.Default;
            Factory = factory;

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

            Factory.AddObjectToList(this);
        }
Ejemplo n.º 8
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);
        }