protected virtual List <ItemDetailPartInspector <T> > CreatePartInspector() { List <ItemDetailPartInspector <T> > partInspectors = new List <ItemDetailPartInspector <T> >(); List <Type> partInspectorTypeSet = AssemblyTool.FindTypesInCurrentDomainWhereExtend <ItemDetailPartInspector <T> >(); foreach (var partInspector in partInspectorTypeSet) { ItemDetailPartInspector <T> itemDetailPartInspector = ReflecTool.Instantiate(partInspector) as ItemDetailPartInspector <T>; partInspectors.Add(itemDetailPartInspector); } return(partInspectors); }
private void Init() { if (inited == null) { List <Type> partInspectors = AssemblyTool.FindTypesInCurrentDomainWhereExtend <ItemDetailPartInspector <T> >(); foreach (var partInspector in partInspectors) { ItemDetailPartInspector <T> itemDetailPartInspector = ReflecTool.Instantiate(partInspector) as ItemDetailPartInspector <T>; itemDetailPartInspectors.Add(itemDetailPartInspector); } itemDetailPartInspectors.Sort( (l, r) => { return(l.Order - r.Order); }); OnInit(); inited = new object(); } }