private void fctb_TextChanged(object sender, BestCS.TextChangedEventArgs e)
 {
     //clear previous highlighting
     e.ChangedRange.ClearStyle(brownStyle);
     //highlight tags
     e.ChangedRange.SetStyle(brownStyle, "<[^>]+>");
 }
 private void fctb_TextChanged(object sender, BestCS.TextChangedEventArgs e)
 {
     if (style == null) return;
     e.ChangedRange.ClearStyle(StyleIndex.All);
     foreach (var key in style.ImagesByText.Keys)
     {
         string pattern = Regex.Replace(key, RegexSpecSymbolsPattern, "\\$0");
         e.ChangedRange.SetStyle(style, pattern);
     }
 }
Example #3
0
        // Mouse cursor's position has changed within histogram control
        private void histogramControl_PositionChanged( object sender, BestCS.Controls.HistogramEventArgs e )
        {
            if ( histogram != null )
            {
                int pos = e.Position;

                if ( pos != -1 )
                {
                    textBox.Text = string.Format( "Value: {0}   Count: {1}   Percent: {2:F2}",
                        pos, histogram.Values[pos], ( (float) histogram.Values[pos] * 100 / histogram.TotalCount ) );
                }
                else
                {
                    textBox.Text = string.Empty;
                }
            }
        }
Example #4
0
        // Selection has changed within histogram control
        private void histogramControl_SelectionChanged( object sender, BestCS.Controls.HistogramEventArgs e )
        {
            if ( histogram != null )
            {
                int min = e.Min;
                int max = e.Max;
                int count = 0;

                // count pixels
                for ( int i = min; i <= max; i++ )
                {
                    count += histogram.Values[i];
                }

                textBox.Text = string.Format( "Values: {0}...{1}   Count: {2}   Percent: {3:F2}",
                    min, max, count, ( (float) count * 100 / histogram.TotalCount ) );
            }
        }
Example #5
0
 private void fctb_TextChangedDelayed(object sender, BestCS.TextChangedEventArgs e)
 {
     e.ChangedRange.ClearStyle(blueStyle);
     e.ChangedRange.SetStyle(blueStyle, @"(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?");
 }