private static void TryContainer(string type, out TypeDecorator decorator) { decorator = null; string itemType = null; if (IsDictionary(type, out itemType)) { string[] pair = itemType.Trim().Split(Define.ConstDefine.REPEAT_DEFINE_SPLIT_CHAR); TypeDecorator key = InternalAdapter(pair[0]); TypeDecorator value = InternalAdapter(pair[1]); decorator = new TypeDecoratorDictionary(key, value); return; } if (IsList(type, out itemType)) { TypeDecorator item = InternalAdapter(itemType); decorator = new TypeDecoratorList(item); } }
public static bool HadExtends(TypeDecorator td) { if (IsContainer(td.typeDecotrator)) { TypeDecoratorList tdl = td as TypeDecoratorList; if (null != tdl) { return(HadExtends(tdl.child)); } TypeDecoratorDictionary tdm = td as TypeDecoratorDictionary; if (null != tdl) { return(HadExtends(tdm.value)); } } EDecotratorType type = td.typeDecotrator; return(EXTEND_DECORTATORTYPE.Contains(type)); }