Esempio n. 1
0
        private static void GetParameterDerive(Assembly assembly, List <DBParameterDerive> lParameterDerive)
        {
            DBParameterDerive parameterDerive = null;

            Type[] types = assembly.GetTypes();
            foreach (Type t in types)
            {
                parameterDerive = null;
                if (!t.IsClass)
                {
                    continue;
                }

                if (!t.IsPublic)
                {
                    continue;
                }

                if (t.BaseType == typeof(DBParameterDerive))
                {
                    try
                    {
                        PropertyInfo pi = t.GetProperty("Instance", BindingFlags.Static | BindingFlags.Public);
                        if (pi != null)
                        {
                            parameterDerive = pi.GetValue(null, null) as DBParameterDerive;
                        }
                        if (parameterDerive == null)
                        {
                            parameterDerive = Activator.CreateInstance(t) as DBParameterDerive;
                        }
                        lParameterDerive.Add(parameterDerive);
                    }
                    catch
                    {
                    }
                }
            }
        }
 static DBUnnamedParameterDerive()
 {
     Instance = new DBUnnamedParameterDerive();
 }
 static DBOracleParameterDerive()
 {
     Instance = new DBOracleParameterDerive();
 }