Exemple #1
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);
     }
 }
Exemple #2
0
 public void LoadDefaultData()
 {
     this.Color                 = System.Drawing.Color.Red;
     this.Font                  = new Font(new FontFamily("Arial"), 20);
     this.Token                 = "TestToken";
     this.CloseToken            = "TestCloseToken";
     this.DescriptorType        = DescriptorType.Word;
     this.DescriptorRecognition = DescriptorRecognition.WholeWord;
     this.UseForAutoComplete    = true;
 }
 public HighlightDescriptor(String _token, String _closeToken, Color _color, Font _font, DescriptorType _descriptorType, DescriptorRecognition _dr, Boolean _useForAutoComplete)
 {
     color                 = _color;
     font                  = _font;
     token                 = _token;
     descriptorType        = _descriptorType;
     closeToken            = _closeToken;
     descriptorRecognition = _dr;
     useForAutoComplete    = _useForAutoComplete;
 }
 public HighlightDescriptor(string token, string closeToken, Color color, Font font, DescriptorType descriptorType, DescriptorRecognition dr, bool useForAutoComplete)
 {
     Color = color;
     Font = font;
     Token = token;
     DescriptorType = descriptorType;
     CloseToken = closeToken;
     DescriptorRecognition = dr;
     UseForAutoComplete = useForAutoComplete;
 }
 public HighlightDescriptor(string token, string closeToken, Color color, Font font, DescriptorType descriptorType, DescriptorRecognition dr, bool useForAutoComplete)
 {
     Color                 = color;
     Font                  = font;
     Token                 = token;
     DescriptorType        = descriptorType;
     CloseToken            = closeToken;
     DescriptorRecognition = dr;
     UseForAutoComplete    = useForAutoComplete;
 }
 /// <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;
 }
 public HighlightDescriptor(string token, Color color, Font font, DescriptorType descriptorType, DescriptorRecognition dr)
 {
     if (descriptorType == DescriptorType.ToCloseToken)
     {
         throw new ArgumentException("You may not choose ToCloseToken DescriptorType without specifing an end token.");
     }
     Color = color;
     Font = font;
     Token = token;
     DescriptorType = descriptorType;
     DescriptorRecognition = dr;
     CloseToken = null;
 }
 public HighlightDescriptor(string token, Color color, Font font, DescriptorType descriptorType, DescriptorRecognition dr, bool useForAutoComplete)
 {
     if (descriptorType ==  UseCaseMakerControls.DescriptorType.ToCloseToken)
     {
         throw new ArgumentException("You may not choose ToCloseToken DescriptorType without specifing an end token.");
     }
     Color = color;
     Font = font;
     Token = token;
     DescriptorType = descriptorType;
     DescriptorRecognition = dr;
     CloseToken = null;
     UseForAutoComplete = useForAutoComplete;
 }
 public HighlightDescriptor(String _token, Color _color, Font _font, DescriptorType _descriptorType, DescriptorRecognition _dr, Boolean _useForAutoComplete)
 {
     if (descriptorType == AcRichTextBoxControl.DescriptorType.ToCloseToken)
     {
         throw new ArgumentException("You may not choose ToCloseToken DescriptorType without specifing an end token.");
     }
     color                 = _color;
     font                  = _font;
     token                 = _token;
     descriptorType        = _descriptorType;
     descriptorRecognition = _dr;
     closeToken            = null;
     useForAutoComplete    = _useForAutoComplete;
 }
 public HighlightDescriptor(string token, Color color, Font font, DescriptorType descriptorType, DescriptorRecognition dr, bool useForAutoComplete)
 {
     if (descriptorType == MLifter.Controls.SyntaxHighlightingTextBox.DescriptorType.ToCloseToken)
     {
         throw new ArgumentException("You may not choose ToCloseToken DescriptorType without specifing an end token.");
     }
     Color                 = color;
     Font                  = font;
     Token                 = token;
     DescriptorType        = descriptorType;
     DescriptorRecognition = dr;
     CloseToken            = null;
     UseForAutoComplete    = useForAutoComplete;
 }
Exemple #11
0
 /// <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="descriptorType">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, DescriptorType descriptorType, DescriptorRecognition dr, Color color, Font font, bool useForAutoComplete)
 {
     if (dr == DescriptorRecognition.RegEx)
     {
         throw new ArgumentException("You may not choose RegEx DescriptorType with an end token.");
     }
     Color                 = color;
     Font                  = font;
     Token                 = token;
     DescriptorType        = descriptorType;
     CloseToken            = closeToken;
     DescriptorRecognition = dr;
     UseForAutoComplete    = useForAutoComplete;
 }
        public HighlightDescriptor(string token, Color color, Font font, DescriptorType descriptorType, DescriptorRecognition dr, bool useForAutoComplete)
        {
            if (descriptorType == this.DescriptorType.ToCloseToken)
            {
                throw new ArgumentException("You may not choose ToCloseToken DescriptorType without specifing an end token.");
            }

            this.Color                 = color;
            this.Font                  = font;
            this.Token                 = token;
            this.DescriptorType        = descriptorType;
            this.DescriptorRecognition = dr;
            this.CloseToken            = null;
            this.UseForAutoComplete    = useForAutoComplete;
        }
 /// <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;
 }
Exemple #14
0
 public void ReadXml(System.Xml.XmlReader reader)
 {
     try
     {
         string[] s;
         this.Token      = reader.ReadElementString("Token");
         this.CloseToken = reader.ReadElementString("CloseToken");
         s                          = reader.ReadElementString("Color").Split(',');
         this.Color                 = Color.FromArgb(255, int.Parse(s[0]), int.Parse(s[1]), int.Parse(s[2]));
         s                          = reader.ReadElementString("Font").Split(',');
         this.Font                  = new Font(s[0], Convert.ToInt32(s[1]));
         this.DescriptorType        = (DescriptorType)Common.GetEnum(typeof(DescriptorType), reader.ReadElementString("DescriptorType"));
         this.DescriptorRecognition = (DescriptorRecognition)Common.GetEnum(typeof(DescriptorRecognition), reader.ReadElementString("DescriptorRecognition"));
         this.UseForAutoComplete    = (reader.ReadElementString("UseForAutoComplete").ToLower() == "true") ? true : false;
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine(ex.Message + " : " + ex.InnerException.Message);
         LoadDefaultData();
     }
 }
Exemple #15
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));
 }
 public HighlightDescriptor(string token, string closeToken, Color color, Font font, DescriptorType descriptorType, DescriptorRecognition dr)
 {
     Color = color;
     Font = font;
     Token = token;
     DescriptorType = descriptorType;
     CloseToken = closeToken;
     DescriptorRecognition = dr;
 }
 /// <summary>
 /// For DescriptorProccessModes.ProcsessLineForDescriptor use this constructor
 /// </summary>
 /// <param name="token"></param>
 /// <param name="tokenLeftCondition"></param>
 /// <param name="tokenRightCondition"></param>
 /// <param name="color"></param>
 /// <param name="font"></param>
 public HighlightDescriptor(string token, string tokenLeftCondition, string tokenRightCondition, Color color, Font font)
 {
     Color = color;
     Font = font;
     Token = token;
     TokenLeftCondition = tokenLeftCondition;
     TokenRightCondition = tokenRightCondition;
     // default values, not in use for DescriptorProccessModes.ProcsessLineForDescriptor
     DescriptorType = DescriptorType.Word;
     DescriptorRecognition = DescriptorRecognition.Contains;
     CloseToken = null;
 }
 /// <summary>
 /// Adds a highlight-descriptor.
 /// </summary>
 /// <param name="dr">The dr.</param>
 /// <param name="token">The token.</param>
 /// <param name="descriptorType">Type of the descriptor.</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 void AddHighlightDescriptor(DescriptorRecognition dr, string token, DescriptorType descriptorType, Color color, Font font, bool useForAutoComplete)
 {
     this.HighlightDescriptors.Add(new HighlightDescriptor(token, color, font, descriptorType, dr, useForAutoComplete));
 }
Exemple #19
0
 /// <summary>
 /// Adds the highlight descriptor.
 /// </summary>
 /// <param name="dr">The dr.</param>
 /// <param name="token">The token.</param>
 /// <param name="descriptorType">Type of the descriptor.</param>
 /// <param name="closeToken">The close token.</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>
 /// /// <returns>Index of added descriptor</returns>
 public int AddHighlightDescriptor(DescriptorRecognition dr, string token, DescriptorType descriptorType, string closeToken, Color color, Font font, bool useForAutoComplete)
 {
     return(this.HighlightDescriptors.Add(new HighlightDescriptor(token, closeToken, descriptorType, dr, color, font, useForAutoComplete)));
 }
 /// <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="descriptorType">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, DescriptorType descriptorType, DescriptorRecognition dr, Color color, Font font, bool useForAutoComplete)
 {
     if (dr == DescriptorRecognition.RegEx)
     {
         throw new ArgumentException("You may not choose RegEx DescriptorType with an end token.");
     }
     Color = color;
     Font = font;
     Token = token;
     DescriptorType = descriptorType;
     CloseToken = closeToken;
     DescriptorRecognition = dr;
     UseForAutoComplete = useForAutoComplete;
 }