protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); TamilProcessor.Initialize(); this.DataContext = new MainWindowViewModel(); }
private IEnumerable <string> GetNativeFragments(string text) { if (string.IsNullOrEmpty(text) || string.IsNullOrWhiteSpace(text)) { yield return(text); } if (text.Length > 0) { if (text[0] == '[') { int endIndex = text.IndexOf(']'); if (endIndex == -1) { yield return(text); } else { yield return(text.Substring(1, endIndex - 1)); if (endIndex < text.Length - 1) { foreach (string s in GetNativeFragments(text.Substring(endIndex + 1))) { yield return(s); } } } } else { int startIndex = text.IndexOf('['); if (startIndex == -1) { yield return(TamilProcessor.GetNative(text)); } else { if (startIndex > 0) { foreach (string s in GetNativeFragments(text.Substring(0, startIndex))) { yield return(s); } } if (startIndex < text.Length - 1) { foreach (string s in GetNativeFragments(text.Substring(startIndex))) { yield return(s); } } } } } }