Ejemplo n.º 1
0
 private void SendCedeFocusEvent(IPAddressControlDirection ipAddressControlDirection, IPAddressControlSelection ipAddressControlSelection)
 {
     if (null != CedeFocusEvent)
     {
         CedeFocusEventArgs args = new CedeFocusEventArgs();
         args.FieldIndex                = FieldIndex;
         args.IPAddressControlAction    = IPAddressControlAction.None;
         args.IPAddressControlDirection = ipAddressControlDirection;
         args.IPAddressControlSelection = ipAddressControlSelection;
         CedeFocusEvent(this, args);
     }
 }
Ejemplo n.º 2
0
        private void OnCedeFocus(Object sender, CedeFocusEventArgs e)
        {
            switch (e.IPAddressControlAction)
            {
            case IPAddressControlAction.Home:

                ipAddressFieldControls[0].TakeFocus(IPAddressControlAction.Home);
                return;

            case IPAddressControlAction.End:

                ipAddressFieldControls[FieldCount - 1].TakeFocus(IPAddressControlAction.End);
                return;

            case IPAddressControlAction.Trim:

                if (e.FieldIndex == 0)
                {
                    return;
                }

                ipAddressFieldControls[e.FieldIndex - 1].TakeFocus(IPAddressControlAction.Trim);
                return;
            }

            if ((e.IPAddressControlDirection == IPAddressControlDirection.Reverse && e.FieldIndex == 0) ||
                (e.IPAddressControlDirection == IPAddressControlDirection.Forward && e.FieldIndex == (FieldCount - 1)))
            {
                return;
            }

            int fieldIndex = e.FieldIndex;

            if (e.IPAddressControlDirection == IPAddressControlDirection.Forward)
            {
                ++fieldIndex;
            }
            else
            {
                --fieldIndex;
            }

            ipAddressFieldControls[fieldIndex].TakeFocus(e.IPAddressControlDirection, e.IPAddressControlSelection);
        }
 private void SendCedeFocusEvent(IPAddressControlDirection ipAddressControlDirection, IPAddressControlSelection ipAddressControlSelection)
 {
     if (null != CedeFocusEvent)
     {
         CedeFocusEventArgs args = new CedeFocusEventArgs();
         args.FieldIndex = FieldIndex;
         args.IPAddressControlAction = IPAddressControlAction.None;
         args.IPAddressControlDirection = ipAddressControlDirection;
         args.IPAddressControlSelection = ipAddressControlSelection;
         CedeFocusEvent(this, args);
     }
 }
        private void OnCedeFocus(Object sender, CedeFocusEventArgs e)
        {
            switch (e.IPAddressControlAction)
            {
                case IPAddressControlAction.Home:

                    ipAddressFieldControls[0].TakeFocus(IPAddressControlAction.Home);
                    return;

                case IPAddressControlAction.End:

                    ipAddressFieldControls[FieldCount - 1].TakeFocus(IPAddressControlAction.End);
                    return;

                case IPAddressControlAction.Trim:

                    if (e.FieldIndex == 0)
                        return;

                    ipAddressFieldControls[e.FieldIndex - 1].TakeFocus(IPAddressControlAction.Trim);
                    return;
            }

            if ((e.IPAddressControlDirection == IPAddressControlDirection.Reverse && e.FieldIndex == 0) ||
                (e.IPAddressControlDirection == IPAddressControlDirection.Forward && e.FieldIndex == (FieldCount - 1)))
                return;

            int fieldIndex = e.FieldIndex;

            if (e.IPAddressControlDirection == IPAddressControlDirection.Forward)
                ++fieldIndex;
            else
                --fieldIndex;

            ipAddressFieldControls[fieldIndex].TakeFocus(e.IPAddressControlDirection, e.IPAddressControlSelection);
        }