Beispiel #1
0
        protected static void Set(ToolStripItem tsItem, IAction accion, TSIContext context)
        {
            Set(tsItem, (IComponentUI)accion, context);
            tsItem.Enabled = accion.Enabled;

            // NOTA: la primera vez que se pinta, se actualiza 'Enabled'.
            PaintEventHandler[] update = new PaintEventHandler[1];
            update[0] = (sender, args) =>
            {
                ActionUtils.NotifyUpdateState(accion);
                tsItem.Enabled = accion.Enabled;

                tsItem.Paint -= update[0];
            };
            tsItem.Paint += update[0];
        }