示例#1
0
        public void CreateEventBridge()
        {
            if (false == Factory.Settings.EnableEvents)
            {
                return;
            }

            if (null != _connectPoint)
            {
                return;
            }

            if (null == _activeSinkId)
            {
                _activeSinkId = SinkHelper.GetConnectionPoint(this, ref _connectPoint, Events._CustomControlEvents_SinkHelper.Id, Events.DispCustomControlEvents_SinkHelper.Id);
            }


            if (Events._CustomControlEvents_SinkHelper.Id.Equals(_activeSinkId, StringComparison.InvariantCultureIgnoreCase))
            {
                __CustomControlEvents_SinkHelper = new Events._CustomControlEvents_SinkHelper(this, _connectPoint);
                return;
            }

            if (Events.DispCustomControlEvents_SinkHelper.Id.Equals(_activeSinkId, StringComparison.InvariantCultureIgnoreCase))
            {
                _dispCustomControlEvents_SinkHelper = new Events.DispCustomControlEvents_SinkHelper(this, _connectPoint);
                return;
            }
        }
示例#2
0
        public void DisposeEventBridge()
        {
            if (null != __CustomControlEvents_SinkHelper)
            {
                __CustomControlEvents_SinkHelper.Dispose();
                __CustomControlEvents_SinkHelper = null;
            }
            if (null != _dispCustomControlEvents_SinkHelper)
            {
                _dispCustomControlEvents_SinkHelper.Dispose();
                _dispCustomControlEvents_SinkHelper = null;
            }

            _connectPoint = null;
        }