Esempio n. 1
0
 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));
     }
 }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
		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);
			}
		}
Esempio n. 4
0
 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));
     }
 }
Esempio n. 5
0
 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);
     }
 }
Esempio n. 6
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);
 }
Esempio n. 7
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);
        }
Esempio n. 8
0
 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>();
 }
Esempio n. 9
0
		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>();
		}
Esempio n. 10
0
 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);
 }
Esempio n. 11
0
 public SafeDictionaryHandle(SafeBrokerHandle broker, IntPtr handle)
     : base(IntPtr.Zero, true)
 {
     _broker = broker;
     SetHandle(handle);
 }
Esempio n. 12
0
 private static extern void enchant_broker_set_ordering(SafeBrokerHandle broker,
                                                        IntPtr tag,
                                                        IntPtr ordering);
Esempio n. 13
0
        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);
        }
Esempio n. 14
0
 private static extern int enchant_broker_dict_exists(SafeBrokerHandle broker, IntPtr tag);
Esempio n. 15
0
 public static extern void enchant_broker_free_dict(SafeBrokerHandle broker, IntPtr dict);
Esempio n. 16
0
        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);
            }
        }
Esempio n. 17
0
 private static extern IntPtr enchant_broker_request_pwl_dict(
     SafeBrokerHandle broker, IntPtr pwl);
Esempio n. 18
0
 private static extern void enchant_broker_list_dicts(SafeBrokerHandle broker,
                                                      [MarshalAs(UnmanagedType.FunctionPtr)] EnchantDictDescribeFn
                                                      enchantDictDescribeFn,
                                                      IntPtr user_data);
Esempio n. 19
0
 private static extern int enchant_broker_dict_exists(SafeBrokerHandle broker, IntPtr tag);
Esempio n. 20
0
        private static extern void enchant_broker_list_dicts(SafeBrokerHandle broker,
																												 [MarshalAs(UnmanagedType.FunctionPtr)] EnchantDictDescribeFn
																													 enchantDictDescribeFn,
																												 IntPtr user_data);
Esempio n. 21
0
 public static extern string enchant_broker_get_error(SafeBrokerHandle broker);
Esempio n. 22
0
 public static extern void enchant_broker_free_dict(SafeBrokerHandle broker, IntPtr dict);
Esempio n. 23
0
        private static extern IntPtr enchant_broker_request_pwl_dict(
			SafeBrokerHandle broker, IntPtr pwl);
Esempio n. 24
0
        private static extern void enchant_broker_set_ordering(SafeBrokerHandle broker,
																													 IntPtr tag,
																													 IntPtr ordering);
Esempio n. 25
0
 public SafeDictionaryHandle(SafeBrokerHandle broker, IntPtr handle)
     : base(IntPtr.Zero, true)
 {
     _broker = broker;
     SetHandle(handle);
 }
Esempio n. 26
0
 public static extern string enchant_broker_get_error(SafeBrokerHandle broker);