コード例 #1
0
        protected override void OnUnsubscribeControlEvents(Control c)
        {
            // Call the base method so the basic events are unsubscribed.
            base.OnUnsubscribeControlEvents(c);

            // Cast the control to a UCSymbols control.
            UCSymbols symbolsControl = (UCSymbols)c;

            // Remove the event.
            symbolsControl.SymbolChanged -= new EventHandler(OnSymbolChanged);
        }
コード例 #2
0
        // Subscribe and unsubscribe the control events you wish to expose.
        protected override void OnSubscribeControlEvents(Control c)
        {
            // Call the base so the base events are connected.
            base.OnSubscribeControlEvents(c);

            // Cast the control to a UCSymbols control.
            UCSymbols symbolsControl = (UCSymbols)c;

            // Add the event.
            symbolsControl.SymbolChanged += new EventHandler(OnSymbolChanged);
        }