Looked in your codes  - looks cool :-)

Yet one way to make that wee need is to _compile_ concrete classes from 
their sources using 
System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource(...)

Steps are next:

1) Make interface IFbClient

2) Make concreate class template, for example:

public const string FbClientCode clientCodeText =
       @"[SuppressUnmanagedCodeSecurity]
        public sealed class FbClient%macro% : IFbClient
        {
                [DllImport("%macro%")]
                public static extern int isc_array_get_slice(
                        [In, Out] int[] statusVector,
                        ref     int dbHandle,
                        ref     int trHandle,
                        ref     long arrayId,
                        IntPtr desc,
                        byte[] destArray,
                        ref     int sliceLength);

                int IFbClient.isc_array_get_slice(                              
                        [In, Out] int[] statusVector,
                        ref     int dbHandle,
                        ref     int trHandle,
                        ref     long arrayId,
                        IntPtr desc,
                        byte[] destArray,
                        ref     int sliceLength);

                {
                        return isc_array_get_slice(
                                statusVector,
                                ref dbHandle,
                                ref trHandle,
                                ref arrayId,
                                desc,
                                destArray,
                                ref sliceLength);
                }
...
";

3) Replace macroses in client FbClientCode and compile new assembly:
        CompilerResults compilerResults = new 
CSharpCodeProvider().CompileAssemblyFromSource(parameters, 
dynamicClassCode);

4) Get compiled result as IFbClient and object ready to use:
fbClient = (IFbClient) 
compilerResults.CompiledAssembly.CreateInstance("bla-bla-bla.FbClient%macro%");


I only donn't know if CSharpCodeProvider class exists under Linux 
because it from namespace Microsoft.CSharp...


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to