Exemplo n.º 1
0
 /// <summary>
 /// Copy the forms into the boxes that we already have. Does not change which boxes we have!
 /// </summary>
 /// <param name="text"></param>
 public void SetMultiText(MultiText text)
 {
     foreach (IControlThatKnowsWritingSystem box in TextBoxes)
     {
         var s = text.GetExactAlternative(box.WritingSystem.Id);
         box.Text = s ?? string.Empty;
     }
 }
Exemplo n.º 2
0
        private void AppendSearchKey(string ws, string searchKeys)
        {
            string s = searchKeys.Trim().Replace('\n', ' ').Replace("  ", " ");

            s = s.TrimEnd(new char[] { ',', ' ' });            //fieldworks has extra commas
            string existing = _searchKeys.GetExactAlternative(ws);

            if (existing != string.Empty)
            {
                existing += ", ";
            }
            _searchKeys.SetAlternative(ws, existing + s);
        }
Exemplo n.º 3
0
        public static IEnumerable <string> SplitGlossAtSemicolon(MultiText gloss, string writingSystemId)
        {
            bool   exact     = true;
            string glossText = gloss.GetExactAlternative(writingSystemId);

            if (glossText == string.Empty)
            {
                exact     = false;
                glossText = gloss.GetBestAlternative(writingSystemId, "*");
                if (glossText == "*")
                {
                    glossText = string.Empty;
                }
            }

            List <string> result = new List <string>();

            string[] keylist = glossText.Split(new char[] { ';' });
            for (int i = 0; i < keylist.Length; i++)
            {
                string k = keylist[i].Trim();
                if (/*keylist.Length > 1 &&*/ k.Length == 0)
                {
                    continue;
                }
                if (exact || i == keylist.Length - 1)
                {
                    result.Add(k);
                }
                else
                {
                    result.Add(k + "*");
                }
            }
            return(result);
        }
Exemplo n.º 4
0
		public static IEnumerable<string> SplitGlossAtSemicolon(MultiText gloss, string writingSystemId)
		{
			bool exact = true;
			string glossText = gloss.GetExactAlternative(writingSystemId);
			if (glossText == string.Empty)
			{
				exact = false;
				glossText = gloss.GetBestAlternative(writingSystemId, "*");
				if (glossText == "*")
				{
					glossText = string.Empty;
				}
			}

			List<string> result = new List<string>();
			string[] keylist = glossText.Split(new char[] { ';' });
			for (int i = 0; i < keylist.Length; i++)
			{
				string k = keylist[i].Trim();
				if (/*keylist.Length > 1 &&*/ k.Length == 0)
				{
					continue;
				}
				if (exact || i == keylist.Length - 1)
				{
					result.Add(k);
				}
				else
				{
					result.Add(k + "*");
				}
			}
			return result;
		}