Beispiel #1
0
 private void SendCedeFocusEvent(IPAddressControlAction ipAddressControlAction)
 {
     if (null != this.CedeFocusEvent)
     {
         CedeFocusEventArgs args = new CedeFocusEventArgs
         {
             FieldIndex             = this.FieldIndex,
             IPAddressControlAction = ipAddressControlAction
         };
         this.CedeFocusEvent(this, args);
     }
 }
Beispiel #2
0
        private void OnCedeFocus(Object sender, CedeFocusEventArgs e)
        {
            switch (e.IPAddressControlAction)
            {
            case IPAddressControlAction.Home:

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

            case IPAddressControlAction.End:

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

            case IPAddressControlAction.Trim:

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

                this.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;
            }

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

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

                case IPAddressControlAction.End:

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

                case IPAddressControlAction.Trim:

                    if (e.FieldIndex == 0)
                        return;

                    this.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;

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