public static int enchant_broker_dict_exists(SafeBrokerHandle broker, string tag) { using (Utf8Marshaller utf8Tag = new Utf8Marshaller(tag)) { return(enchant_broker_dict_exists(broker, utf8Tag.MarshalledValue)); } }
public static int enchant_broker_dict_exists(SafeBrokerHandle broker, string tag) { using (Utf8Marshaller utf8Tag = new Utf8Marshaller(tag)) { return enchant_broker_dict_exists(broker, utf8Tag.MarshalledValue); } }
public static SafeDictionaryHandle enchant_broker_request_pwl_dict(SafeBrokerHandle broker, string pwl) { using (Utf8Marshaller utf8Pwl = new Utf8Marshaller(pwl)) { IntPtr handle = enchant_broker_request_pwl_dict(broker, utf8Pwl.MarshalledValue); return new SafeDictionaryHandle(broker, handle); } }
public static SafeDictionaryHandle enchant_broker_request_pwl_dict(SafeBrokerHandle broker, string pwl) { using (Utf8Marshaller utf8Pwl = new Utf8Marshaller(pwl)) { IntPtr handle = enchant_broker_request_pwl_dict(broker, utf8Pwl.MarshalledValue); return(new SafeDictionaryHandle(broker, handle)); } }
public static void enchant_broker_set_ordering(SafeBrokerHandle broker, string tag, string ordering) { using ( Utf8Marshaller utf8Tag = new Utf8Marshaller(tag), utf8Ordering = new Utf8Marshaller(ordering)) { enchant_broker_set_ordering(broker, utf8Tag.MarshalledValue, utf8Ordering.MarshalledValue); } }
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); }
public Broker() { try { _handle = Bindings.enchant_broker_init(); _isLibEnchantAvailable = true; } catch (DllNotFoundException) { _isLibEnchantAvailable = false; } if (_isLibEnchantAvailable == true) { VerifyNoErrors(); if (_handle.IsInvalid) { throw new ApplicationException("Unable to initialize broker"); } } _dictionaryCache = new Dictionary <string, WeakReference>(); _pwlDictionaryCache = new Dictionary <string, WeakReference>(); }
public Broker() { try { _handle = Bindings.enchant_broker_init(); _isLibEnchantAvailable = true; } catch (DllNotFoundException) { _isLibEnchantAvailable = false; } if (_isLibEnchantAvailable == true) { VerifyNoErrors(); if (_handle.IsInvalid) { throw new ApplicationException("Unable to initialize broker"); } } _dictionaryCache = new Dictionary<string, WeakReference>(); _pwlDictionaryCache = new Dictionary<string, WeakReference>(); }
public static void enchant_broker_list_dicts(SafeBrokerHandle broker, EnchantDictDescribeDelegate describe) { enchant_broker_list_dicts(broker, delegate(IntPtr lang_tag, 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)); DictionaryInfo dictionary = new DictionaryInfo( Utf8Marshaller.MarshalFromUtf8(lang_tag), provider); describe(dictionary); }, IntPtr.Zero); }
public SafeDictionaryHandle(SafeBrokerHandle broker, IntPtr handle) : base(IntPtr.Zero, true) { _broker = broker; SetHandle(handle); }
private static extern void enchant_broker_set_ordering(SafeBrokerHandle broker, IntPtr tag, IntPtr ordering);
private static extern int enchant_broker_dict_exists(SafeBrokerHandle broker, IntPtr tag);
public static extern void enchant_broker_free_dict(SafeBrokerHandle broker, IntPtr dict);
private static extern IntPtr enchant_broker_request_pwl_dict( SafeBrokerHandle broker, IntPtr pwl);
private static extern void enchant_broker_list_dicts(SafeBrokerHandle broker, [MarshalAs(UnmanagedType.FunctionPtr)] EnchantDictDescribeFn enchantDictDescribeFn, IntPtr user_data);
public static extern string enchant_broker_get_error(SafeBrokerHandle broker);