34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
|
|
using System;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Windows;
|
|||
|
|
|
|||
|
|
namespace DBToolControls {
|
|||
|
|
public class Syntax {
|
|||
|
|
private List<string> wordsToFormat = new List<string>();
|
|||
|
|
private bool isCaseSensitive;
|
|||
|
|
|
|||
|
|
private Dictionary<DependencyProperty, object> propertyValues = new Dictionary<DependencyProperty, object>();
|
|||
|
|
internal Dictionary<DependencyProperty, object> PropertyValues {
|
|||
|
|
get { return propertyValues; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public Syntax(bool caseSensitive) {
|
|||
|
|
this.isCaseSensitive = caseSensitive;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
internal bool Contains(string s) {
|
|||
|
|
return wordsToFormat.Contains(isCaseSensitive ? s : s.ToLower());
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void AddWords(params string[] words) {
|
|||
|
|
wordsToFormat.AddRange(isCaseSensitive ? words : words.Select(w => w.ToLower()));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void AddFormatting(DependencyProperty dp, object value) {
|
|||
|
|
propertyValues.Add(dp, value);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|