public Grammar() : this(true) { } //case sensitive by default public Grammar(bool caseSensitive) { _currentGrammar = this; this.CaseSensitive = caseSensitive; LanguageStringComparer = caseSensitive ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase; KeyTerms = new KeyTermTable(LanguageStringComparer); //Initialize console attributes ConsoleTitle = Resources.MsgDefaultConsoleTitle; ConsoleGreeting = string.Format(Resources.MsgDefaultConsoleGreeting, this.GetType().Name); ConsolePrompt = ">"; ConsolePromptMoreInput = "."; }
public Grammar() : this(true) { } //case sensitive by default public Grammar(bool caseSensitive) { _currentGrammar = this; this.CaseSensitive = caseSensitive; bool ignoreCase = !this.CaseSensitive; LanguageStringComparer = StringComparer.Create(System.Globalization.CultureInfo.InvariantCulture, ignoreCase); KeyTerms = new KeyTermTable(LanguageStringComparer); //Initialize console attributes ConsoleTitle = Resources.MsgDefaultConsoleTitle; ConsoleGreeting = string.Format(Resources.MsgDefaultConsoleGreeting, this.GetType().Name); ConsolePrompt = ">"; ConsolePromptMoreInput = "."; }
public Grammar() : this(true) { } //case sensitive by default public Grammar(bool caseSensitive) { _currentGrammar = this; this.CaseSensitive = caseSensitive; bool ignoreCase = !this.CaseSensitive; var stringComparer = ignoreCase ? StringComparer.CurrentCultureIgnoreCase : StringComparer.CurrentCulture; KeyTerms = new KeyTermTable(stringComparer); //Initialize console attributes ConsoleTitle = Resources.MsgDefaultConsoleTitle; ConsoleGreeting = string.Format(Resources.MsgDefaultConsoleGreeting, this.GetType().Name); ConsolePrompt = ">"; ConsolePromptMoreInput = "."; }
public Grammar(bool caseSensitive) { _currentGrammar = this; CaseSensitive = caseSensitive; var ignoreCase = !CaseSensitive; var stringComparer = StringComparer.Create(CultureInfo.InvariantCulture, ignoreCase); KeyTerms = new KeyTermTable(stringComparer); //Initialize console attributes ConsoleTitle = Resources.MsgDefaultConsoleTitle; ConsoleGreeting = string.Format(Resources.MsgDefaultConsoleGreeting, GetType().Name); ConsolePrompt = ">"; ConsolePromptMoreInput = "."; }
public Grammar() : this(true) { } //case sensitive by default public Grammar(bool caseSensitive) { _currentGrammar = this; this.CaseSensitive = caseSensitive; #if !SILICONSTUDIO_RUNTIME_CORECLR bool ignoreCase = !this.CaseSensitive; LanguageStringComparer = StringComparer.Create(CultureInfo.InvariantCulture, ignoreCase); #else LanguageStringComparer = CultureInfo.InvariantCulture.CompareInfo.GetStringComparer(caseSensitive ? CompareOptions.None : CompareOptions.IgnoreCase); #endif KeyTerms = new KeyTermTable(LanguageStringComparer); //Initialize console attributes ConsoleTitle = Resources.MsgDefaultConsoleTitle; ConsoleGreeting = string.Format(Resources.MsgDefaultConsoleGreeting, this.GetType().Name); ConsolePrompt = ">"; ConsolePromptMoreInput = "."; }