Example #1
0
        public static void GetLayerInfos(SE_CONNECTION_64 connection, GetLayerInfosCallBack call)
        {
            if (call == null)
            {
                return;
            }
            try
            {
                unsafe
                {
                    //Pointer2Pointer ptr = new Pointer2Pointer();
                    //System.Int32 num = 0;

                    //System.Int32 status = Wrapper92_64.SE_layer_get_info_list(connection,ref ptr, ref num);
                    //if (status != 0)
                    //{
                    //    return;
                    //}
                    //IntPtr* layerInfo = (System.IntPtr*)ptr.pointer[0];

                    //for (int i = 0; i < num; i++)
                    //{
                    //    call(layerInfo[i]);
                    //}
                    //if (num > 0) Wrapper92_64.SE_layer_free_info_list(num, ptr.pointer[0]);
                }
            }
            catch (Exception ex)
            {
                return;
            }
        }
Example #2
0
        public static SE_ERROR_64 GetExtError(SE_CONNECTION_64 connection)
        {
            SE_ERROR_64 error = new SE_ERROR_64();

            Int64 err_no = SE_connection_get_ext_error(connection, ref error);

            return(error);
        }
Example #3
0
        public static string[] TableNames(SE_CONNECTION_64 connection)
        {
            try
            {
                unsafe
                {
                    Pointer2Pointer ptr = new Pointer2Pointer();
                    System.Int64    num = 0;


                    if (Wrapper92_64.SE_registration_get_info_list(connection, ref ptr, ref num) != 0)
                    {
                        return(null);
                    }
                    IntPtr *reginfo = (System.IntPtr *)ptr.pointer[0];

                    StringBuilder sb = new StringBuilder();
                    for (int i = 0; i < num; i++)
                    {
                        Int64 result = Wrapper92_64.SE_reginfo_has_layer(reginfo[i]);
                        if (result != 0)
                        {
                            byte[] buffer = new byte[CONST.SE_QUALIFIED_TABLE_NAME];
                            Wrapper92_64.SE_reginfo_get_table_name(reginfo[i], buffer);
                            string table = System.Text.Encoding.ASCII.GetString(buffer).Replace("\0", "");
                            sb.Append(table);

                            /*
                             * buffer = new byte[CONST.SE_MAX_DESCRIPTION_LEN];
                             * Wrapper92_64.SE_reginfo_get_description(reginfo[i], buffer);
                             * string descr = System.Text.Encoding.ASCII.GetString(buffer).Replace("\0", "");
                             * sb.Append(" ("+descr+")" + ";");
                             * */
                        }
                        Wrapper92_64.SE_reginfo_free(reginfo[i]);
                    }
                    return(sb.ToString().Split(';'));
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Example #4
0
 public static string GetErrorMsg(SE_CONNECTION_64 connection, Int64 err_no)
 {
     try
     {
         byte[] buffer = new byte[CONST.SE_MAX_MESSAGE_LENGTH];
         if (SE_connection_get_error_string(connection, err_no, buffer) == 0)
         {
             return(ASCIIEncoding.ASCII.GetString(buffer).Replace("\0", ""));
         }
         else
         {
             return("SDE ERROR: Unknown sde error!!");
         }
     }
     catch (Exception ex)
     {
         return("SDE ERROR: GetErrorMsg - " + ex.Message);
     }
 }
Example #5
0
 public static extern System.Int64 SE_layer_get_info_list(SE_CONNECTION_64 connection, ref IntPtr layer_list, ref System.Int64 count_addr);
Example #6
0
 public static extern System.Int64 SE_registration_get_info(SE_CONNECTION_64 connection, string table, IntPtr reginfo);
Example #7
0
 public static extern System.Int64 SE_registration_get_info_list(SE_CONNECTION_64 connection, ref Pointer2Pointer reg_list_addr, ref System.Int64 count_addr);
Example #8
0
 public static string GetErrorMsg(SE_CONNECTION_64 connection, SE_ERROR_64 error)
 {
     return(GetErrorMsg(connection, error.sde_error));
 }
Example #9
0
 public static extern System.Int64 SE_connection_get_ext_error(SE_CONNECTION_64 connection, ref SE_ERROR_64 error);
Example #10
0
 public static extern System.Int64 SE_connection_get_error_string(SE_CONNECTION_64 connection, System.Int64 error_code, [MarshalAs(UnmanagedType.LPArray)] byte[] error_string);
Example #11
0
 public static extern System.Int64 SE_stream_create(SE_CONNECTION_64 connection, ref SE_STREAM_64 stream);
Example #12
0
 public static extern System.Int64 SE_connection_free(SE_CONNECTION_64 conn);
Example #13
0
 public static extern System.Int64 SE_table_describe(SE_CONNECTION_64 connection, string table, ref System.Int16 num_columns, ref IntPtr column_defs);
Example #14
0
 public static extern System.Int64 SE_layer_get_info(SE_CONNECTION_64 connection, string table, string column, SE_LAYERINFO_64 layer);
Example #15
0
 public static extern System.Int64 SE_connection_create(string server, string instance, string database, string username, string password, ref SE_ERROR_64 error, ref SE_CONNECTION_64 conn);