示例#1
0
文件: Class.cs 项目: g-pechorin/xmlvm
        public virtual global::System.Object getConstructors()
        {
//XMLVM_BEGIN_WRAPPER[java.lang.Class: java.lang.reflect.Constructor[] getConstructors()]
            org.xmlvm._nTIB     tib        = (org.xmlvm._nTIB) this._ftib;
            global::System.Type nativeType = tib.getNativeType();
            global::System.Reflection.BindingFlags bindingFlags
                = global::System.Reflection.BindingFlags.DeclaredOnly
                  // | global::System.Reflection.BindingFlags.Static
                  | global::System.Reflection.BindingFlags.Instance
                  | global::System.Reflection.BindingFlags.Public
                  | global::System.Reflection.BindingFlags.NonPublic;
            global::System.Reflection.MemberInfo[] constructorInfos
                = nativeType.FindMembers(global::System.Reflection.MemberTypes.Method,
                                         bindingFlags, global::System.Type.FilterNameIgnoreCase, "this");
            global::System.Collections.Generic.IList <java.lang.reflect.Constructor> jConstructors
                = new global::System.Collections.Generic.List <java.lang.reflect.Constructor>();
            // note each MemberInfo is casted to MethodInfo:
            foreach (global::System.Reflection.MethodInfo constructorInfo in constructorInfos)
            {
                java.lang.reflect.Constructor jConstructor
                    = org.xmlvm._nMemberInfoAdapter <global::System.Reflection.MethodInfo,
                                                     java.lang.reflect.Constructor._nImpl> .getJavaClient(constructorInfo);

                jConstructors.Add(jConstructor);
            }
            java.lang.reflect.Constructor[] jConstructorArray = new java.lang.reflect.Constructor[jConstructors.Count];
            jConstructors.CopyTo(jConstructorArray, 0);
            return(new org.xmlvm._nArrayAdapter <object>(jConstructorArray));
//XMLVM_END_WRAPPER[java.lang.Class: java.lang.reflect.Constructor[] getConstructors()]
        }
示例#2
0
文件: Class.cs 项目: g-pechorin/xmlvm
        public virtual global::System.Object getDeclaredMethods()
        {
//XMLVM_BEGIN_WRAPPER[java.lang.Class: java.lang.reflect.Method[] getDeclaredMethods()]
            org.xmlvm._nTIB     tib        = (org.xmlvm._nTIB) this._ftib;
            global::System.Type nativeType = tib.getNativeType();
            global::System.Reflection.BindingFlags bindingFlags
                = global::System.Reflection.BindingFlags.DeclaredOnly
                  | global::System.Reflection.BindingFlags.Static
                  | global::System.Reflection.BindingFlags.Instance
                  | global::System.Reflection.BindingFlags.Public
                  | global::System.Reflection.BindingFlags.NonPublic;
            global::System.Reflection.MethodInfo[] methodInfos
                = nativeType.GetMethods(bindingFlags);
            global::System.Collections.Generic.IList <java.lang.reflect.Method> jMethods
                = new global::System.Collections.Generic.List <java.lang.reflect.Method>();
            foreach (global::System.Reflection.MethodInfo nativeMethodInfo in methodInfos)
            {
                java.lang.reflect.Method jMethod
                    = org.xmlvm._nMemberInfoAdapter <global::System.Reflection.MethodInfo,
                                                     java.lang.reflect.Method._nImpl> .getJavaClient(nativeMethodInfo);

                jMethods.Add(jMethod);
            }
            java.lang.reflect.Method[] jMethodArray = new java.lang.reflect.Method[jMethods.Count];
            jMethods.CopyTo(jMethodArray, 0);
            return(new org.xmlvm._nArrayAdapter <object>(jMethodArray));
//XMLVM_END_WRAPPER[java.lang.Class: java.lang.reflect.Method[] getDeclaredMethods()]
        }
示例#3
0
public virtual global::System.Object getDeclaredMethods(){
//XMLVM_BEGIN_WRAPPER[java.lang.Class: java.lang.reflect.Method[] getDeclaredMethods()]
    org.xmlvm._nTIB tib = (org.xmlvm._nTIB) this._ftib;
    global::System.Type nativeType = tib.getNativeType();
    //global::System.Reflection.BindingFlags bindingFlags
    //    = global::System.Reflection.BindingFlags.DeclaredOnly
    //      | global::System.Reflection.BindingFlags.Static
    //      | global::System.Reflection.BindingFlags.Instance
    //      | global::System.Reflection.BindingFlags.Public
    //      | global::System.Reflection.BindingFlags.NonPublic;
    global::System.Collections.Generic.IEnumerable<MethodInfo> methodInfosArray = nativeType.GetTypeInfo().DeclaredMethods;
    //global::System.Reflection.MethodInfo[] methodInfos 
    //    = nativeType.GetMethods(bindingFlags);
    global::System.Collections.Generic.IList<java.lang.reflect.Method> jMethods 
        = new global::System.Collections.Generic.List<java.lang.reflect.Method>();
    foreach (global::System.Reflection.MethodInfo nativeMethodInfo in methodInfosArray) {
        java.lang.reflect.Method jMethod
            = org.xmlvm._nMemberInfoAdapter<global::System.Reflection.MethodInfo,
                                            java.lang.reflect.Method._nImpl>.getJavaClient(nativeMethodInfo);
        jMethods.Add(jMethod);
    }
    java.lang.reflect.Method[] jMethodArray = new java.lang.reflect.Method[jMethods.Count];
    jMethods.CopyTo(jMethodArray, 0);
    return new org.xmlvm._nArrayAdapter<object>(jMethodArray);
//XMLVM_END_WRAPPER[java.lang.Class: java.lang.reflect.Method[] getDeclaredMethods()]
}
示例#4
0
        public virtual int UpdateAll(School_SystemDataSet6 dataSet)
        {
            if ((dataSet == null))
            {
                throw new global::System.ArgumentNullException("dataSet");
            }
            if ((dataSet.HasChanges() == false))
            {
                return(0);
            }
            global::System.Data.IDbConnection workConnection = this.Connection;
            if ((workConnection == null))
            {
                throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" +
                                                              "ger TableAdapter property to a valid TableAdapter instance.");
            }
            bool workConnOpened = false;

            if (((workConnection.State & global::System.Data.ConnectionState.Broken)
                 == global::System.Data.ConnectionState.Broken))
            {
                workConnection.Close();
            }
            if ((workConnection.State == global::System.Data.ConnectionState.Closed))
            {
                workConnection.Open();
                workConnOpened = true;
            }
            global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction();
            if ((workTransaction == null))
            {
                throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" +
                                                              "ctions or the current state is not allowing the transaction to begin.");
            }
            global::System.Collections.Generic.List <global::System.Data.DataRow>                     allChangedRows = new global::System.Collections.Generic.List <global::System.Data.DataRow>();
            global::System.Collections.Generic.List <global::System.Data.DataRow>                     allAddedRows   = new global::System.Collections.Generic.List <global::System.Data.DataRow>();
            global::System.Collections.Generic.List <global::System.Data.Common.DataAdapter>          adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List <global::System.Data.Common.DataAdapter>();
            global::System.Collections.Generic.Dictionary <object, global::System.Data.IDbConnection> revertConnections = new global::System.Collections.Generic.Dictionary <object, global::System.Data.IDbConnection>();
            int result = 0;

            global::System.Data.DataSet backupDataSet = null;
            if (this.BackupDataSetBeforeUpdate)
            {
                backupDataSet = new global::System.Data.DataSet();
                backupDataSet.Merge(dataSet);
            }
            try {
                // ---- Prepare for update -----------
                //
                //
                //---- Perform updates -----------
                //
                if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete))
                {
                    result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
                    result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
                }
                else
                {
                    result = (result + this.UpdateInsertedRows(dataSet, allAddedRows));
                    result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows));
                }
                result = (result + this.UpdateDeletedRows(dataSet, allChangedRows));
                //
                //---- Commit updates -----------
                //
                workTransaction.Commit();
                if ((0 < allAddedRows.Count))
                {
                    global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
                    allAddedRows.CopyTo(rows);
                    for (int i = 0; (i < rows.Length); i = (i + 1))
                    {
                        global::System.Data.DataRow row = rows[i];
                        row.AcceptChanges();
                    }
                }
                if ((0 < allChangedRows.Count))
                {
                    global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count];
                    allChangedRows.CopyTo(rows);
                    for (int i = 0; (i < rows.Length); i = (i + 1))
                    {
                        global::System.Data.DataRow row = rows[i];
                        row.AcceptChanges();
                    }
                }
            }
            catch (global::System.Exception ex) {
                workTransaction.Rollback();
                // ---- Restore the dataset -----------
                if (this.BackupDataSetBeforeUpdate)
                {
                    global::System.Diagnostics.Debug.Assert((backupDataSet != null));
                    dataSet.Clear();
                    dataSet.Merge(backupDataSet);
                }
                else
                {
                    if ((0 < allAddedRows.Count))
                    {
                        global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count];
                        allAddedRows.CopyTo(rows);
                        for (int i = 0; (i < rows.Length); i = (i + 1))
                        {
                            global::System.Data.DataRow row = rows[i];
                            row.AcceptChanges();
                            row.SetAdded();
                        }
                    }
                }
                throw ex;
            }
            finally {
                if (workConnOpened)
                {
                    workConnection.Close();
                }
                if ((0 < adaptersWithAcceptChangesDuringUpdate.Count))
                {
                    global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count];
                    adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters);
                    for (int i = 0; (i < adapters.Length); i = (i + 1))
                    {
                        global::System.Data.Common.DataAdapter adapter = adapters[i];
                        adapter.AcceptChangesDuringUpdate = true;
                    }
                }
            }
            return(result);
        }
示例#5
0
public virtual global::System.Object getDeclaredConstructors(){
//XMLVM_BEGIN_WRAPPER[java.lang.Class: java.lang.reflect.Constructor[] getDeclaredConstructors()]
    org.xmlvm._nTIB tib = (org.xmlvm._nTIB) this._ftib;
    global::System.Type nativeType = tib.getNativeType();
    //global::System.Reflection.BindingFlags bindingFlags = global::System.Reflection.BindingFlags.DeclaredOnly
    //      // | global::System.Reflection.BindingFlags.Static
    //      | global::System.Reflection.BindingFlags.Instance
    //      | global::System.Reflection.BindingFlags.Public
    //      | global::System.Reflection.BindingFlags.NonPublic;

    global::System.Collections.Generic.IEnumerable<MemberInfo> constructorInfosArray = nativeType.GetTypeInfo().DeclaredMembers; 
  //  global::System.Reflection.MemberInfo[] constructorInfos =;
        //.FindMembers(global::System.Reflection.MemberTypes.Method, bindingFlags, global::System.Type.FilterNameIgnoreCase, "this");
    global::System.Collections.Generic.IList<java.lang.reflect.Constructor> jConstructors  = new global::System.Collections.Generic.List<java.lang.reflect.Constructor>();
    // note each MemberInfo is casted to MethodInfo:
    foreach (global::System.Reflection.MemberInfo constructorInfo in constructorInfosArray)
    {
        if (constructorInfo.Name.ToLower().Equals("this") && constructorInfo is MethodInfo)
        {
            java.lang.reflect.Constructor jConstructor = org.xmlvm._nMemberInfoAdapter<global::System.Reflection.MethodInfo,
            java.lang.reflect.Constructor._nImpl>.getJavaClient((global::System.Reflection.MethodInfo)constructorInfo);
            jConstructors.Add(jConstructor);
        }
    }
    java.lang.reflect.Constructor[] jConstructorArray = new java.lang.reflect.Constructor[jConstructors.Count];
    jConstructors.CopyTo(jConstructorArray, 0);
    return new org.xmlvm._nArrayAdapter<object>(jConstructorArray);
//XMLVM_END_WRAPPER[java.lang.Class: java.lang.reflect.Constructor[] getDeclaredConstructors()]
}