Files
BeWoAdmin/DBToolControls/Syntax.cs

34 lines
1.1 KiB
C#
Raw Normal View History

2016-06-27 02:24:18 +02:00
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);
}
}
}