Exemple #1
0
        public void CheckSubProperty(Type mainType)
        {
            for (int index = SubPropertyMeta.Count - 1; index >= 0; index--)
            {
                SearchMetaSubProperty sub = SubPropertyMeta[index];
                bool keep = false;

                //PropertyInfo pi = mainType.GetProperty(sub.PropertyName);
                PropertyInfo pi = SerializableData.GetObjPro(sub.PropertyName, mainType);
                if (pi != null && pi.PropertyType.IsGenericType)
                {
                    sub.SubProperty  = pi;
                    sub.PropertyType = pi.PropertyType;

                    foreach (Type tParam in pi.PropertyType.GetGenericArguments())
                    {
                        if (tParam.IsSubclassOf(typeof(SerializableData)))
                        {
                            sub.PropertyGenericType = tParam;
                            keep = true;
                            break;
                        }
                    }
                }

                if (!keep)
                {
                    SubPropertyMeta.RemoveAt(index);
                }
            }
        }
Exemple #2
0
 private void ParseSubSearch(string subSearch)
 {
     if (!string.IsNullOrEmpty(subSearch))
     {
         foreach (string s in subSearch.Split(";".ToCharArray()))
         {
             SearchMetaSubProperty subProperty = new SearchMetaSubProperty(s);
             if (subProperty.FieldMatch.Count > 0)
             {
                 SubPropertyMeta.Add(subProperty);
             }
         }
     }
 }