Exemple #1
0
 private static Rule Rule(S oldState, UnicodeCategory cat, S throughState, S newState = null)
 => new Rule(
     oldState: oldState,
     description: cat.ToString(),
     test: c => c.codePoints
     .First()
     .Match(
         Some: x =>
         x.UnicodeCategory(0) == cat,
         None: false),
     throughState: throughState,
     newState: newState ?? throughState);
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // c b U n i c o d e C p _ S e l e c t i o n C h a n g e d            //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Code-point item has changed.                                       //
        //                                                                    //
        //--------------------------------------------------------------------//

        private void cbUnicodeCp_SelectionChanged(object sender,
                                                  SelectionChangedEventArgs e)
        {
            if (_initialised)
            {
                String utf8HexVal = "";
                UInt32 unicodeUCS2;

                unicodeUCS2 = (UInt32)((cbUnicodeCp01.SelectedIndex * 256) +
                                       cbUnicodeCp02.SelectedIndex);

                String unicodeBlock =
                    UnicodeBlocks.getBlocknameForCodepoint(unicodeUCS2);

                UnicodeCategory unicodeCat =
                    CharUnicodeInfo.GetUnicodeCategory((Char)unicodeUCS2);

                if (_crntPDL == ToolCommonData.ePrintLang.PCL)
                {
                    _unicodeUCS2PCL = unicodeUCS2;
                }
                else
                {
                    _unicodeUCS2PCLXL = unicodeUCS2;
                }

                PrnParseDataUTF8.convertUTF32ToUTF8HexString(unicodeUCS2,
                                                             true,
                                                             ref utf8HexVal);

                txtUnicodeUTF8.Text = utf8HexVal;

                txtUnicodeBlock.Text = unicodeBlock;
                txtUnicodeCat.Text   = unicodeCat.ToString();
            }
        }
 /// <summary>Returns a <see cref="string" /> that represents this instance.</summary>
 /// <returns>A <see cref="string" /> that represents this instance.</returns>
 public override string ToString() => Category.ToString();
 /// <summary>Returns a <see cref="System.String" /> that represents this instance.</summary>
 /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
 public override string ToString()
 {
     return(Category.ToString());
 }