/// <summary>
 /// Initializes a new instance of the <see cref="HighlightDescriptor"/> class.
 /// </summary>
 /// <param name="token">The token.</param>
 /// <param name="color">The color.</param>
 /// <param name="font">The font.</param>
 /// <param name="highlightType">Type of the descriptor.</param>
 /// <param name="dr">The dr.</param>
 /// <param name="useForAutoComplete">if set to <c>true</c> [use for auto complete].</param>
 public HighlightDescriptor(string token, Color color, Font font, HighlightType highlightType,
                            DescriptorRecognition descriptorRecognition, UsedForAutoComplete isUsedForAutoComplete = UsedForAutoComplete.Yes)
 {
     if (highlightType == HighlightType.ToCloseToken)
     {
         throw new ArgumentException("You may not choose ToCloseToken HighlightType without specifing an end token.");
     }
     this.color                 = color;
     this.font                  = font;
     this.token                 = token;
     this.highlightType         = highlightType;
     this.descriptorRecognition = descriptorRecognition;
     this.closeToken            = null;
     this.isUsedForAutoComplete = isUsedForAutoComplete;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HighlightDescriptor"/> class.
 /// </summary>
 /// <param name="token">The token.</param>
 /// <param name="closeToken">The close token.</param>
 /// <param name="highlightType">Type of the descriptor.</param>
 /// <param name="dr">The dr.</param>
 /// <param name="color">The color.</param>
 /// <param name="font">The font.</param>
 /// <param name="useForAutoComplete">if set to <c>true</c> [use for auto complete].</param>
 public HighlightDescriptor(string token, string closeToken, HighlightType highlightType,
                            DescriptorRecognition descriptorRecognition, Color color, Font font, UsedForAutoComplete isUsedForAutoComplete = UsedForAutoComplete.Yes)
 {
     this.color                 = color;
     this.font                  = font;
     this.token                 = token;
     this.closeToken            = closeToken;
     this.highlightType         = highlightType;
     this.descriptorRecognition = descriptorRecognition;
     this.isUsedForAutoComplete = isUsedForAutoComplete;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Add a list of character having the same way to highlight.
 /// </summary>
 /// <param name="listThings">A list of characters.</param>
 /// <param name="recognition"></param>
 /// <param name="highlightType"></param>
 /// <param name="color"></param>
 /// <param name="font"></param>
 /// <param name="used"></param>
 public void AddListOfHighlightDescriptors(List <string> listDescriptor, DescriptorRecognition recognition,
                                           HighlightType highlightType, Color color, Font font, UsedForAutoComplete used)
 {
     foreach (string item in listDescriptor)
     {
         AddHighlightDescriptor(recognition, item, highlightType, color, font, used);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Use to add a single token expressing syntax highlighting.
 /// </summary>
 /// <param name="descriptorRecognition">Enum of DescriptorRecognition</param>
 /// <param name="token">The open token.</param>
 /// <param name="highlightType">Enum of HighlightType</param>s
 /// <param name="color">The color to highlight.</param>
 /// <param name="font">The font to highlight.</param>
 public void AddHighlightDescriptor(DescriptorRecognition descriptorRecognition, string token, HighlightType highlightType,
                                    Color color, Font font, UsedForAutoComplete used)
 {
     Descriptors.Add(new HighlightDescriptor(token, color, font, highlightType, descriptorRecognition, used));
 }