Exemplo n.º 1
0
        public static string[] TableNames(SE_CONNECTION connection)
        {
            try
            {
                unsafe
                {
                    Pointer2Pointer ptr = new Pointer2Pointer();
                    System.Int32    num = 0;


                    if (Wrapper92.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++)
                    {
                        Int32 result = Wrapper92.SE_reginfo_has_layer(reginfo[i]);
                        if (result != 0)
                        {
                            byte[] buffer = new byte[CONST.SE_QUALIFIED_TABLE_NAME];
                            Wrapper92.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.SE_reginfo_get_description(reginfo[i], buffer);
                             * string descr = System.Text.Encoding.ASCII.GetString(buffer).Replace("\0", "");
                             * sb.Append(" ("+descr+")" + ";");
                             * */
                        }
                        Wrapper92.SE_reginfo_free(reginfo[i]);
                    }
                    return(sb.ToString().Split(';'));
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }