Exemplo n.º 1
0
        public static TextChildren GetTextChildren(this widget wt)
        {
            string txt = "";// wt.text?.Value as string;

            if (string.IsNullOrEmpty(txt))
            {
                return(null);
            }
            else
            {
                var ja        = Newtonsoft.Json.JsonConvert.DeserializeObject(txt) as Newtonsoft.Json.Linq.JArray;
                var childrens = (ja.FirstOrDefault()?.ToObject(typeof(TextObject)) as TextObject)?.children;
                return(childrens?.FirstOrDefault());
            }
        }
Exemplo n.º 2
0
 public static string GetText(this widget wt)
 {
     if (wt.text == null || !wt.text.HasValues)
     {
         return(string.Empty);
     }
     else
     {
         try
         {
             return(wt.text.SelectToken("[0].children[0].text").ToObject <string>());
         }
         catch (Exception)
         {
             return(string.Empty);
         }
     }
 }
Exemplo n.º 3
0
 private static bool Check(widget wt, string st)
 {
     return(!string.IsNullOrEmpty(st) && wt != null && !string.IsNullOrEmpty(wt.GetText()) && st.Trim().Split(new char[] { ' ', (char)160 }, StringSplitOptions.RemoveEmptyEntries)[0].Equals(wt.GetText().Replace(" ", "").Replace("" + (char)160, "").Trim()));
 }