예제 #1
0
            public COM_IOleInPlaceObject IOleInPlaceObject;    // cached interface obtained from UserConrol

            public ExposedUserControl()
            {
                _logger.Log(LogLevel.Trace, "ExposedUserControl constructor called");

                // Gain access to the IOleObject and IOleInPlaceObject interfaces implemented by the UserControl
                IOleObject        = (COM_IOleObject)AggregationHelper.ObtainInternalInterface(this, GetType().GetInterface("IOleObject"));
                IOleInPlaceObject = (COM_IOleInPlaceObject)AggregationHelper.ObtainInternalInterface(this, GetType().GetInterface("IOleInPlaceObject"));
            }
예제 #2
0
            protected override void Dispose(bool disposing)
            {
                if (IOleObject != null)
                {
                    Marshal.ReleaseComObject(IOleObject);
                    IOleObject = null;
                }

                if (IOleInPlaceObject != null)
                {
                    Marshal.ReleaseComObject(IOleInPlaceObject);
                    IOleInPlaceObject = null;
                }

                base.Dispose(disposing);
            }