All pastes #274716 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-12-10 22:25 UTC
rendered paste body
using System;
using System.Text;
using System.Data;
using System.Collections.Generic;
using LavishVMAPI; 
using LavishScriptAPI;
using System.Runtime.InteropServices;

namespace ISXWoW
{
    public class WoWDB
    {
        #region Delegates
        private delegate bool GetTableName(int nTable, char [] buf, int buflen);
        #endregion

        #region Stubs
        private static WoWDB.GetTableName getTableName = Stubs.GetTableName;


        internal class Stubs
        {
            static public bool GetTableName(int nTable, char [] buf, int buflen)
            {
                IntPtr Address = LavishVM.GetAPI("ISXWoW.WoWDB", "GetTableName", 1);
                WoWDB.getTableName = (WoWDB.GetTableName)Marshal.GetDelegateForFunctionPointer(Address, typeof(WoWDB.GetTableName));
                return false;
            }
        }
        #endregion

        #region Constructors
        public WoWDB()
        {

        }
        #endregion Constructors

        #region Public Methods
        public string TableName(int index)
        {
            char [] buff;
            int size;
            buff = new char[255];

            if (getTableName(index,buff,size))
            {
                return buff.ToString();
            }

            return "";
        }
        #endregion
    }
}