Esempio n. 1
0
        /// <summary>
        /// 创建一个新的或者复用存在的UITask
        /// </summary>
        /// <param name="uiTaskRegisterItem"></param>
        /// <returns></returns>
        private UITask CreateOrGetUITaskInstance(UITaskRegisterItem uiTaskRegisterItem)
        {
            UITask instance = null;

            if (uiTaskRegisterItem.AllowMultipleInstance)
            {
                //AllowMultipleInstance总是会创建出新的实例
                instance = ClassLoader.CreateInstance(uiTaskRegisterItem.TypeFullName, uiTaskRegisterItem.Name) as UITask;
                int instanceId = GetInstanceID(uiTaskRegisterItem.Name);
                instance.SetInstanceID(instanceId);
            }
            else
            {
                //复用之前的UITask
                List <UITask> uiTasks;
                m_uiTaskDic.TryGetValue(uiTaskRegisterItem.Name, out uiTasks);
                if (uiTasks != null && uiTasks.Count != 0)
                {
                    instance = uiTasks[0];
                }
                else
                {
                    //如果不存在,创建一个新的
                    instance = ClassLoader.CreateInstance(uiTaskRegisterItem.TypeFullName, uiTaskRegisterItem.Name) as UITask;
                }
            }
            return(instance);
        }
Esempio n. 2
0
        public override IDbDataParameter CreateParameter(string name, Object dbtype, int gxlength, int gxdec)
        {
            IDbDataParameter parm = (IDbDataParameter)ClassLoader.CreateInstance(NpgsqlAssembly, "Npgsql.NpgsqlParameter");

            ClassLoader.SetPropValue(parm, "NpgsqlDbType", GXTypeToNpgsqlDbType(dbtype));
            ClassLoader.SetPropValue(parm, "Size", gxlength);
            ClassLoader.SetPropValue(parm, "Precision", (byte)gxlength);
            ClassLoader.SetPropValue(parm, "Scale", (byte)gxdec);
            ClassLoader.SetPropValue(parm, "ParameterName", name);
            return(parm);
        }
Esempio n. 3
0
        public override IDbDataParameter CreateParameter(string name, Object dbtype, int gxlength, int gxdec)
        {
            object ifxType = GXTypeToIfxType((GXType)dbtype);

            object[]         args = new object[] { name, ifxType, gxlength };
            IDbDataParameter parm = (IDbDataParameter)ClassLoader.CreateInstance(IfxAssembly, "IBM.Data.Informix.IfxParameter", args);

            ClassLoader.SetPropValue(parm, "IfxType", ifxType);
            parm.Precision = (byte)gxdec;
            parm.Scale     = (byte)gxdec;
            return(parm);
        }
Esempio n. 4
0
 public InformixConnectionWrapper(String connectionString, GxConnectionCache connCache, IsolationLevel isolationLevel)
 {
     try
     {
         _connection       = (IDbConnection)ClassLoader.CreateInstance(GxInformix.IfxAssembly, "IBM.Data.Informix.IfxConnection", new object[] { connectionString });
         m_isolationLevel  = isolationLevel;
         m_connectionCache = connCache;
     }
     catch (Exception ex)
     {
         GXLogging.Error(log, "Informix data provider Ctr error " + ex.Message + ex.StackTrace);
         throw ex;
     }
 }
Esempio n. 5
0
 public InformixConnectionWrapper()
 {
     try
     {
         GXLogging.Debug(log, "Creating Informix data provider ");
         _connection = (IDbConnection)ClassLoader.CreateInstance(GxInformix.IfxAssembly, "IBM.Data.Informix.IfxConnection");
         GXLogging.Debug(log, "Informix data provider created");
     }
     catch (Exception ex)
     {
         GXLogging.Error(log, "Informix data provider Ctr error " + ex.Message + ex.StackTrace);
         throw ex;
     }
 }
Esempio n. 6
0
 public PostgresqlConnectionWrapper(String connectionString, GxConnectionCache connCache, IsolationLevel isolationLevel)
 {
     try
     {
         _connection       = (IDbConnection)ClassLoader.CreateInstance(GxPostgreSql.NpgsqlAssembly, "Npgsql.NpgsqlConnection", new object[] { connectionString });
         m_isolationLevel  = isolationLevel;
         m_connectionCache = connCache;
     }
     catch (Exception ex)
     {
         GXLogging.Error(log, "Npgsql data provider Ctr error " + ex.Message + ex.StackTrace);
         throw ex;
     }
 }
Esempio n. 7
0
 public override IDbDataParameter CreateParameter()
 {
     return((IDbDataParameter)ClassLoader.CreateInstance(IfxAssembly, "IBM.Data.Informix.IfxParameter"));
 }
Esempio n. 8
0
 public PostgresqlConnectionWrapper()
 {
     _connection = (IDbConnection)ClassLoader.CreateInstance(GxPostgreSql.NpgsqlAssembly, "Npgsql.NpgsqlConnection");
 }
Esempio n. 9
0
 public override IDbDataParameter CreateParameter()
 {
     return((IDbDataParameter)ClassLoader.CreateInstance(NpgsqlAssembly, "Npgsql.NpgsqlParameter"));
 }
Esempio n. 10
0
 internal static object CreateInstance()
 {
     return(ClassLoader.CreateInstance(GeoAssembly, SqlGeographyClass, null));
 }