Ejemplo n.º 1
0
 protected override void OnClick()
 {
     if (_filter == null)
     {
         _filter = new ExampleCustomizationFilter();
     }
     _filter.FilterOn = !_filter.FilterOn;
     this.Caption     = _filter.FilterOn ? "Turn Filter Off" : "Turn Filter On";
     this.Tooltip     = _filter.FilterOn ? "Turn the filter off" : "Turn the filter on";
 }
        protected override void OnClick()
        {
            //if (_filter == null)
            //{
            //    //TODO - instantiate the command filter
            //}

            ////TODO - Toggle the Filter on, off

            ////Bonus - toggle the Caption and Tooltip

            if (_filter == null)
            {
                _filter = new ExampleCustomizationFilter();
            }
            _filter.FilterOn = !_filter.FilterOn;
            this.Caption     = _filter.FilterOn ? "Turn Filter Off" : "Turn Filter On";
            this.Tooltip     = _filter.FilterOn ? "Turn the filter off" : "Turn the filter on";
        }