コード例 #1
0
        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);
        }
コード例 #2
0
 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();
     }
 }