Exemple #1
0
 public static int enchant_dict_check(SafeDictionaryHandle dict, string word)
 {
     using (Utf8Marshaller utf8Word = new Utf8Marshaller(word))
     {
         return(enchant_dict_check(dict, utf8Word.MarshalledValue, utf8Word.MarshalledSize));
     }
 }
Exemple #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);
			}
		}
Exemple #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);
			}
		}
Exemple #4
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);
 }
Exemple #5
0
 public static void enchant_dict_describe(SafeDictionaryHandle dict,
                                          EnchantDictDescribeDelegate describe)
 {
     enchant_dict_describe(dict,
                           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);
 }
Exemple #6
0
 public static List<string> enchant_dict_suggest(SafeDictionaryHandle dict, string word)
 {
     int suggsCount;
     IntPtr suggs;
     using (Utf8Marshaller utf8Word = new Utf8Marshaller(word))
     {
         suggs =
             enchant_dict_suggest(dict,
                                                      utf8Word.MarshalledValue,
                                                      utf8Word.MarshalledSize,
                                                      out suggsCount);
     }
     List<string> result = Utf8Marshaller.MarshalFromUtf8Array(suggs, suggsCount);
     enchant_dict_free_string_list(dict, suggs);
     return result;
 }
Exemple #7
0
        public static void enchant_dict_store_replacement(SafeDictionaryHandle dict,
																											string mis,
																											string cor)
        {
            using (
                Utf8Marshaller utf8Mis = new Utf8Marshaller(mis),
                                             utf8Cor = new Utf8Marshaller(cor))
            {
                enchant_dict_store_replacement(dict,
                                                                             utf8Mis.MarshalledValue,
                                                                             utf8Mis.MarshalledSize,
                                                                             utf8Cor.MarshalledValue,
                                                                             utf8Cor.MarshalledSize);
            }
        }
Exemple #8
0
 public static void enchant_dict_remove_from_session(SafeDictionaryHandle dict, string word)
 {
     using (Utf8Marshaller utf8Word = new Utf8Marshaller(word))
     {
         enchant_dict_remove_from_session(dict,
                                                                          utf8Word.MarshalledValue,
                                                                          utf8Word.MarshalledSize);
     }
 }
Exemple #9
0
 public static int enchant_dict_is_removed(SafeDictionaryHandle dict, string word)
 {
     using (Utf8Marshaller utf8Word = new Utf8Marshaller(word))
     {
         return
             enchant_dict_is_removed(dict,
                                                             utf8Word.MarshalledValue,
                                                             utf8Word.MarshalledSize);
     }
 }
Exemple #10
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);
            }
        }