コード例 #1
0
        private string[] BrokerDescribe(IntPtr lib, IntPtr broker)
        {
            IntPtr method = Interop.Interop.GetMethod(lib, "enchant_broker_describe");
            EnchantBrokerDescribeDelegate enchantBrokerDescribe = Marshal.GetDelegateForFunctionPointer(method, typeof(EnchantBrokerDescribeDelegate)) as EnchantBrokerDescribeDelegate;

            ArrayList providers = new ArrayList();

            enchantBrokerDescribe(broker, (providerName, providerDesc, providerFile, userdata) => providers.Add(providerName), IntPtr.Zero);

            return((string[])providers.ToArray(typeof(string)));
        }
コード例 #2
0
 public static void enchant_broker_describe(SafeBrokerHandle broker,
                                            EnchantBrokerDescribeDelegate describe)
 {
     enchant_broker_describe(broker,
                             delegate(IntPtr provider_name,
                                      IntPtr provider_desc,
                                      IntPtr provider_dll_file,
                                      IntPtr user_data)
     {
         ProviderInfo provider =
             new ProviderInfo(
                 Utf8Marshaller.MarshalFromUtf8(provider_name),
                 Utf8Marshaller.MarshalFromUtf8(provider_desc),
                 Utf8Marshaller.MarshalFromUtf8(
                     provider_dll_file));
         describe(provider);
     },
                             IntPtr.Zero);
 }
コード例 #3
0
ファイル: Bindings.cs プロジェクト: Thor1Khan/enchant
        public static void enchant_broker_describe(SafeBrokerHandle broker,
																							 EnchantBrokerDescribeDelegate describe)
        {
            enchant_broker_describe(broker,
                                                            delegate(IntPtr provider_name,
                                                                             IntPtr provider_desc,
                                                                             IntPtr provider_dll_file,
                                                                             IntPtr user_data)
                                                                {
                                                                    ProviderInfo provider =
                                                                        new ProviderInfo(
                                                                            Utf8Marshaller.MarshalFromUtf8(provider_name),
                                                                            Utf8Marshaller.MarshalFromUtf8(provider_desc),
                                                                            Utf8Marshaller.MarshalFromUtf8(
                                                                                provider_dll_file));
                                                                    describe(provider);
                                                                },
                                                            IntPtr.Zero);
        }