All pastes #294672 Raw Edit

Mine

public text v1 · immutable
#294672 ·published 2006-12-28 18:52 UTC
rendered paste body
using System;
using System.Text;
using System.Data;
using System.Collections.Generic;
using LavishVMAPI; 
using LavishScriptAPI;
using System.Runtime.InteropServices;

// GetRowSize div 4 (# cols)

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 = 255;
            buff = new char[255];

            if (getTableName(index,buff,size))
            {
                return new string(buff);
            }

            return "";
        }
        #endregion
    }
}