summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2017-02-09 12:12:28 +0000
committerReuben Thomas <rrt@sc3d.org>2017-02-09 12:12:28 +0000
commit66b215a27c6f017c8db1110c974330773ee420c0 (patch)
treee669118f97d88ab11a5b0da8b2445b3bf75a4dcd
parentc03191c49a68fe0304e1a28c7ed38d94c59a826f (diff)
downloadenchant-66b215a27c6f017c8db1110c974330773ee420c0.tar.gz
Remove .NET bindings and tests (issue #71)
They are now in their own GitHub project, AbiWord/enchantdotnet
-rw-r--r--src/bindings/Enchant.Net/App.config4
-rw-r--r--src/bindings/Enchant.Net/Bindings.cs374
-rw-r--r--src/bindings/Enchant.Net/Broker.cs361
-rw-r--r--src/bindings/Enchant.Net/Dictionary.cs217
-rw-r--r--src/bindings/Enchant.Net/DictionaryInfo.cs55
-rw-r--r--src/bindings/Enchant.Net/Enchant.Net.csproj62
-rw-r--r--src/bindings/Enchant.Net/Properties/AssemblyInfo.cs.in34
-rw-r--r--src/bindings/Enchant.Net/ProviderInfo.cs52
-rw-r--r--src/bindings/Enchant.Net/SafeBrokerHandle.cs59
-rw-r--r--src/bindings/Enchant.Net/SafeDictionaryHandle.cs70
-rw-r--r--src/bindings/Enchant.Net/Utf8Marshaller.cs121
-rw-r--r--unittests/Enchant.Net.Tests/BrokerTests.cs363
-rw-r--r--unittests/Enchant.Net.Tests/DictionaryTests.cs219
-rw-r--r--unittests/Enchant.Net.Tests/Enchant.Net.Tests.csproj59
-rw-r--r--unittests/Enchant.Net.Tests/Properties/AssemblyInfo.cs34
15 files changed, 0 insertions, 2084 deletions
diff --git a/src/bindings/Enchant.Net/App.config b/src/bindings/Enchant.Net/App.config
deleted file mode 100644
index 4fd10ad..0000000
--- a/src/bindings/Enchant.Net/App.config
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<configuration>
- <dllmap dll="libenchant.dll" target="libenchant.so.1"/>
-</configuration> \ No newline at end of file
diff --git a/src/bindings/Enchant.Net/Bindings.cs b/src/bindings/Enchant.Net/Bindings.cs
deleted file mode 100644
index acc150b..0000000
--- a/src/bindings/Enchant.Net/Bindings.cs
+++ /dev/null
@@ -1,374 +0,0 @@
-/* Copyright (c) 2007 Eric Scott Albright
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Runtime.InteropServices;
-
-namespace Enchant
-{
- internal static class Bindings
- {
- #region Delegates
-
- public delegate void EnchantBrokerDescribeDelegate(ProviderInfo provider_info);
-
- public delegate void EnchantDictDescribeDelegate(DictionaryInfo dictionary_info);
-
- #endregion
-
- private const string ENCHANT_LIBRARY = "libenchant.dll";
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- public static extern SafeBrokerHandle enchant_broker_init();
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- public static extern void enchant_broker_free(IntPtr broker);
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern IntPtr enchant_broker_request_dict(SafeBrokerHandle broker, IntPtr tag);
-
- public static SafeDictionaryHandle enchant_broker_request_dict(SafeBrokerHandle broker,
- string tag)
- {
- using (Utf8Marshaller utf8Tag = new Utf8Marshaller(tag))
- {
- IntPtr handle = enchant_broker_request_dict(broker, utf8Tag.MarshalledValue);
- return new SafeDictionaryHandle(broker, handle);
- }
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern IntPtr enchant_broker_request_pwl_dict(
- SafeBrokerHandle broker, IntPtr pwl);
-
- 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);
- }
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- public static extern void enchant_broker_free_dict(SafeBrokerHandle broker, IntPtr dict);
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern int enchant_broker_dict_exists(SafeBrokerHandle broker, IntPtr tag);
-
- 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);
- }
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern void enchant_broker_set_ordering(SafeBrokerHandle broker,
- IntPtr tag,
- IntPtr ordering);
-
- 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);
- }
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- public static extern string enchant_broker_get_error(SafeBrokerHandle broker);
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern void enchant_broker_describe(SafeBrokerHandle broker,
- [MarshalAs(UnmanagedType.FunctionPtr)] EnchantBrokerDescribeFn
- enchantBrokerDescribeFn,
- IntPtr user_data);
-
- 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);
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern void enchant_broker_list_dicts(SafeBrokerHandle broker,
- [MarshalAs(UnmanagedType.FunctionPtr)] EnchantDictDescribeFn
- enchantDictDescribeFn,
- IntPtr user_data);
-
- 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);
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern void enchant_dict_describe(SafeDictionaryHandle dict,
- [MarshalAs(UnmanagedType.FunctionPtr)] EnchantDictDescribeFn
- enchantDictDescribeFn,
- IntPtr user_data);
-
- 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);
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern int enchant_dict_check(SafeDictionaryHandle dict, IntPtr word, int len);
-
- 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);
- }
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern IntPtr enchant_dict_suggest(SafeDictionaryHandle dict,
- IntPtr word,
- int len,
- [MarshalAs(UnmanagedType.U4)] out int
- out_n_suggs);
-
- 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;
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern void enchant_dict_free_string_list(SafeDictionaryHandle dict,
- IntPtr string_list);
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern void enchant_dict_add(SafeDictionaryHandle dict, IntPtr word, int len);
-
- public static void enchant_dict_add(SafeDictionaryHandle dict, string word)
- {
- using (Utf8Marshaller utf8Word = new Utf8Marshaller(word))
- {
- enchant_dict_add(dict, utf8Word.MarshalledValue, utf8Word.MarshalledSize);
- }
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern void enchant_dict_add_to_session(SafeDictionaryHandle dict,
- IntPtr word,
- int len);
-
- public static void enchant_dict_add_to_session(SafeDictionaryHandle dict, string word)
- {
- using (Utf8Marshaller utf8Word = new Utf8Marshaller(word))
- {
- enchant_dict_add_to_session(dict, utf8Word.MarshalledValue, utf8Word.MarshalledSize);
- }
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern void enchant_dict_remove(SafeDictionaryHandle dict,
- IntPtr word,
- int len);
-
- public static void enchant_dict_remove(SafeDictionaryHandle dict, string word)
- {
- using (Utf8Marshaller utf8Word = new Utf8Marshaller(word))
- {
- enchant_dict_remove(dict, utf8Word.MarshalledValue, utf8Word.MarshalledSize);
- }
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern void enchant_dict_remove_from_session(SafeDictionaryHandle dict,
- IntPtr word,
- int len);
-
- 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);
- }
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern int enchant_dict_is_added(SafeDictionaryHandle dict,
- IntPtr word,
- int len);
-
- public static int enchant_dict_is_added(SafeDictionaryHandle dict, string word)
- {
- using (Utf8Marshaller utf8Word = new Utf8Marshaller(word))
- {
- return
- enchant_dict_is_added(dict,
- utf8Word.MarshalledValue,
- utf8Word.MarshalledSize);
- }
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern int enchant_dict_is_removed(SafeDictionaryHandle dict,
- IntPtr word,
- int len);
-
- 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);
- }
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
- private static extern void enchant_dict_store_replacement(SafeDictionaryHandle dict,
- IntPtr mis,
- int mis_len,
- IntPtr cor,
- int cor_len);
-
- 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);
- }
- }
-
- [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl,
- EntryPoint = "enchant_dict_get_error")]
- private static extern IntPtr enchant_dict_get_error_(SafeDictionaryHandle dict);
-
- public static string enchant_dict_get_error(SafeDictionaryHandle dict)
- {
- IntPtr message = enchant_dict_get_error_(dict);
- return Utf8Marshaller.MarshalFromUtf8(message);
- }
-
- #region Nested type: EnchantBrokerDescribeFn
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- private delegate void EnchantBrokerDescribeFn(
- IntPtr provider_name,
- IntPtr provider_desc,
- IntPtr provider_dll_file,
- IntPtr user_data);
-
- #endregion
-
- #region Nested type: EnchantDictDescribeFn
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- private delegate void EnchantDictDescribeFn(
- IntPtr lang_tag,
- IntPtr provider_name,
- IntPtr provider_desc,
- IntPtr provider_file,
- IntPtr user_data);
-
- #endregion
- }
-} \ No newline at end of file
diff --git a/src/bindings/Enchant.Net/Broker.cs b/src/bindings/Enchant.Net/Broker.cs
deleted file mode 100644
index c944777..0000000
--- a/src/bindings/Enchant.Net/Broker.cs
+++ /dev/null
@@ -1,361 +0,0 @@
-/* Copyright (c) 2007 Eric Scott Albright
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-using System;
-using System.Collections.Generic;
-
-namespace Enchant
-{
- public sealed class Broker : IDisposable
- {
- private readonly SafeBrokerHandle _handle;
- private IList<DictionaryInfo> _dictionaries;
- private bool _disposed = false;
- private IList<ProviderInfo> _providers;
- private readonly Dictionary<string, WeakReference> _dictionaryCache;
- private readonly Dictionary<string, WeakReference> _pwlDictionaryCache;
- private bool _cacheDictionaries = true;
- private static Nullable<bool> _isLibEnchantAvailable;
-
- private static Broker _defaultBroker;
- /// <summary>
- /// Singleton for apps that want to use that pattern
- /// </summary>
- public static Broker Default
- {
- get
- {
- if(_defaultBroker == null || _defaultBroker._disposed)
- {
- _defaultBroker = new Broker();
- }
- return _defaultBroker;
- }
- }
-
- public static bool IsLibEnchantAvailable
- {
- get
- {
- if (_isLibEnchantAvailable == null)
- {
- // force a broker to be created and thus trying to
- // us libenchant and setting our status
- Broker broker = Default;
- }
- return _isLibEnchantAvailable??false;
- }
- }
-
-
- 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 IEnumerable<ProviderInfo> Providers
- {
- get
- {
- VerifyNotDisposed();
- if (_providers == null)
- {
- InitializeProviderList();
- }
- return _providers;
- }
- }
-
- private void InitializeProviderList()
- {
- _providers = new List<ProviderInfo>();
- if (_isLibEnchantAvailable == true)
- {
- Bindings.enchant_broker_describe(_handle,
- delegate(ProviderInfo provider)
- { _providers.Add(provider); });
- VerifyNoErrors();
- }
- }
-
- public IEnumerable<DictionaryInfo> Dictionaries
- {
- get
- {
- VerifyNotDisposed();
- if (_dictionaries == null)
- {
- InitializeDictionaryList();
- }
- return _dictionaries;
- }
- }
-
- public bool CacheDictionaries
- {
- get { return this._cacheDictionaries; }
- set { this._cacheDictionaries = value; }
- }
-
- private void InitializeDictionaryList()
- {
- _dictionaries = new List<DictionaryInfo>();
- if (_isLibEnchantAvailable == true)
- {
- Bindings.enchant_broker_list_dicts(_handle,
- delegate(DictionaryInfo dictionary)
- { _dictionaries.Add(dictionary); });
- VerifyNoErrors();
- }
- }
-
- #region IDisposable Members
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- #endregion
-
- private void Dispose(bool disposing)
- {
- if (!_disposed)
- {
- if (disposing)
- {
- // dispose-only, i.e. non-finalizable logic
- if(_handle != null)
- {
- _handle.Dispose();
- }
- DisposeAllDictionariesFromCache(_dictionaryCache);
- DisposeAllDictionariesFromCache(_pwlDictionaryCache);
- }
-
- // shared (dispose and finalizable) cleanup logic
- _disposed = true;
- }
- }
-
- private static void DisposeAllDictionariesFromCache(ICollection<KeyValuePair<string, WeakReference>> cache) {
- List<Dictionary> dictionariesToDispose = new List<Dictionary>();
- foreach (KeyValuePair<string, WeakReference> pair in cache)
- {
- if(pair.Value.IsAlive)
- {
- dictionariesToDispose.Add((Dictionary) pair.Value.Target);
- }
- }
- cache.Clear();
- foreach (Dictionary dictionary in dictionariesToDispose)
- {
- dictionary.Dispose();
- }
- }
-
- private void VerifyNotDisposed()
- {
- if (_disposed)
- {
- throw new ObjectDisposedException("Dictionary");
- }
- }
-
- public Dictionary RequestDictionary(string language_tag)
- {
- VerifyNotDisposed();
- if (language_tag == null)
- {
- throw new ArgumentNullException("language_tag");
- }
- if(_isLibEnchantAvailable != true)
- {
- throw new InvalidOperationException("LibEnchant is not available");
- }
-
- Dictionary dictionary = GetDictionaryFromCache(this._dictionaryCache, language_tag);
- if(dictionary != null)
- {
- return dictionary;
- }
- return CreateDictionary(language_tag);
- }
-
- private Dictionary CreateDictionary(string language_tag) {
- SafeDictionaryHandle handle = Bindings.enchant_broker_request_dict(this._handle, language_tag);
- VerifyNoErrors();
- if (handle.IsInvalid)
- {
- throw new ApplicationException("There is no provider that supplies a dictionary for " + language_tag);
- }
-
- return CreateAndRegisterDictionary(handle, this._dictionaryCache, language_tag);
- }
-
- private Dictionary GetDictionaryFromCache(IDictionary<string, WeakReference> cache, string language_tag) {
- if(CacheDictionaries)
- {
- WeakReference dictionaryReference;
- if (cache.TryGetValue(language_tag, out dictionaryReference))
- {
- if (dictionaryReference.IsAlive)
- {
- return (Dictionary) dictionaryReference.Target;
- }
- }
- }
- return null;
- }
-
- private Dictionary CreateAndRegisterDictionary(SafeDictionaryHandle handle, IDictionary<string, WeakReference> cache, string language_tag) {
- Dictionary dictionary;
- dictionary = new Dictionary(handle);
- dictionary.Disposed += OnDictionaryDisposed;
- // always store the dictionaries we have created
- // so that we can dispose of them cleanly and give a
- // better error message (ObjectDisposed) instead of a crash
- // if someone tries to use a dictionary after the broker
- // that created it has been disposed.
- cache[language_tag] = new WeakReference(dictionary);
- return dictionary;
- }
-
- private void OnDictionaryDisposed(object sender, EventArgs e)
- {
- Dictionary dictionary = (Dictionary) sender;
-
- // try to remove from _dictionaryCache
- if (!RemoveDictionaryFromCache(this._dictionaryCache, dictionary))
- {
- // try to remove from _pwlDictionaryCache
- RemoveDictionaryFromCache(this._pwlDictionaryCache, dictionary);
- }
- }
-
- private static bool RemoveDictionaryFromCache(IDictionary<string, WeakReference> cache, Dictionary dictionary) {
- foreach (KeyValuePair<string, WeakReference> pair in cache)
- {
- if (pair.Value.IsAlive
- && pair.Value.Target == dictionary)
- {
- cache.Remove(pair.Key);
- return true;
- }
- }
- return false;
- }
-
- public bool DictionaryExists(string language_tag)
- {
- VerifyNotDisposed();
- if (language_tag == null)
- {
- throw new ArgumentNullException("language_tag");
- }
- if (_isLibEnchantAvailable != true)
- {
- return false;
- }
-
- int result = Bindings.enchant_broker_dict_exists(_handle, language_tag);
- VerifyNoErrors();
- if (result != 0 && result != 1)
- {
- throw new NotImplementedException(
- "enchant_broker_dict_exists returned unexpected value that is currently unhandled.");
- }
- return result == 1;
- }
-
- public Dictionary RequestPwlDictionary(string pwlFile)
- {
- VerifyNotDisposed();
- if (pwlFile == null)
- {
- throw new ArgumentNullException("pwlFile");
- }
- if (_isLibEnchantAvailable != true)
- {
- throw new InvalidOperationException("LibEnchant is not available");
- }
- Dictionary dictionary = GetDictionaryFromCache(this._pwlDictionaryCache, pwlFile);
- if (dictionary != null)
- {
- return dictionary;
- }
-
- return CreatePwlDictionary(pwlFile);
- }
-
- private Dictionary CreatePwlDictionary(string pwlFile) {
- SafeDictionaryHandle handle = Bindings.enchant_broker_request_pwl_dict(this._handle, pwlFile);
- VerifyNoErrors();
- if (handle.IsInvalid)
- {
- throw new ApplicationException("Unable to create pwl file " + pwlFile);
- }
- return CreateAndRegisterDictionary(handle, this._pwlDictionaryCache, pwlFile);
- }
-
- public void SetOrdering(string language_tag, string ordering)
- {
- VerifyNotDisposed();
- if (_isLibEnchantAvailable == true)
- {
- Bindings.enchant_broker_set_ordering(_handle, language_tag, ordering);
- }
- VerifyNoErrors();
- }
-
- private void VerifyNoErrors()
- {
- if (_isLibEnchantAvailable == true)
- {
- string message = Bindings.enchant_broker_get_error(_handle);
- if (!string.IsNullOrEmpty(message))
- {
- throw new ApplicationException(message);
- }
- }
- }
- }
-}
diff --git a/src/bindings/Enchant.Net/Dictionary.cs b/src/bindings/Enchant.Net/Dictionary.cs
deleted file mode 100644
index e219210..0000000
--- a/src/bindings/Enchant.Net/Dictionary.cs
+++ /dev/null
@@ -1,217 +0,0 @@
-/* Copyright (c) 2007 Eric Scott Albright
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-using System;
-using System.Collections.Generic;
-
-namespace Enchant
-{
- public sealed class Dictionary : IDisposable
- {
- private readonly SafeDictionaryHandle _handle;
- private bool _disposed = false;
- private DictionaryInfo _info;
-
- internal Dictionary(SafeDictionaryHandle handle)
- {
- if (handle == null)
- {
- throw new ArgumentNullException("handle");
- }
- if (handle.IsInvalid)
- {
- throw new ArgumentException("handle is invalid");
- }
- _handle = handle;
- }
-
- public DictionaryInfo Information
- {
- get
- {
- VerifyNotDisposed();
- if (_info == null)
- {
- InitializeDictionaryInformation();
- }
- return _info;
- }
- }
-
- private void InitializeDictionaryInformation()
- {
- Bindings.enchant_dict_describe(_handle,
- delegate(DictionaryInfo dictionary)
- {
- _info = dictionary;
- });
- }
-
- #region IDisposable Members
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- #endregion
-
- private void Dispose(bool disposing)
- {
- if (!_disposed)
- {
- if (disposing)
- {
- // dispose-only, i.e. non-finalizable logic
- _handle.Dispose();
- }
-
- // shared (dispose and finalizable) cleanup logic
- _disposed = true;
- if (disposing)
- {
- OnDisposed(); // call it here so will throw if someone uses
- // it because _disposed has been set to true;
- }
- }
- }
-
- private void VerifyNotDisposed()
- {
- if (_disposed)
- {
- throw new ObjectDisposedException("Dictionary");
- }
- }
-
- public bool Check(string word)
- {
- VerifyNotDisposed();
- if (word == null)
- {
- throw new ArgumentNullException("word");
- }
- // result is 0 if correctly spelled, positive if not, negative if error
- int result = Bindings.enchant_dict_check(_handle, word);
- if (result < 0)
- {
- string message = Bindings.enchant_dict_get_error(_handle);
- throw new ApplicationException(message);
- }
- return result == 0;
- }
-
- public ICollection<string> Suggest(string word)
- {
- VerifyNotDisposed();
- if (word == null)
- {
- throw new ArgumentNullException("word");
- }
- return Bindings.enchant_dict_suggest(_handle, word);
- }
-
- public void Add(string word)
- {
- VerifyNotDisposed();
- if (word == null)
- {
- throw new ArgumentNullException("word");
- }
- Bindings.enchant_dict_add(_handle, word);
- }
-
- public void AddToSession(string word)
- {
- VerifyNotDisposed();
- if (word == null)
- {
- throw new ArgumentNullException("word");
- }
- Bindings.enchant_dict_add_to_session(_handle, word);
- }
-
- public bool IsAdded(string word)
- {
- VerifyNotDisposed();
- if (word == null)
- {
- throw new ArgumentNullException("word");
- }
- return Bindings.enchant_dict_is_added(_handle, word) == 1;
- }
-
- public void Remove(string word)
- {
- VerifyNotDisposed();
- if (word == null)
- {
- throw new ArgumentNullException("word");
- }
- Bindings.enchant_dict_remove(_handle, word);
- }
-
- public void RemoveFromSession(string word)
- {
- VerifyNotDisposed();
- if (word == null)
- {
- throw new ArgumentNullException("word");
- }
- Bindings.enchant_dict_remove_from_session(_handle, word);
- }
-
- public bool IsRemoved(string word)
- {
- VerifyNotDisposed();
- if (word == null)
- {
- throw new ArgumentNullException("word");
- }
- return Bindings.enchant_dict_is_removed(_handle, word) == 1;
- }
-
- public void StoreReplacement(string misspelling, string correction)
- {
- VerifyNotDisposed();
- if (misspelling == null)
- {
- throw new ArgumentNullException("misspelling");
- }
- if (correction == null)
- {
- throw new ArgumentNullException("correction");
- }
- Bindings.enchant_dict_store_replacement(_handle, misspelling, correction);
- }
-
- /// <summary>
- /// Occurs when a dictionary is disposed by a call to the Dispose method
- /// </summary>
- public event EventHandler Disposed = delegate { };
-
- private void OnDisposed()
- {
- Disposed.Invoke(this, new EventArgs());
- }
- }
-} \ No newline at end of file
diff --git a/src/bindings/Enchant.Net/DictionaryInfo.cs b/src/bindings/Enchant.Net/DictionaryInfo.cs
deleted file mode 100644
index c3dc902..0000000
--- a/src/bindings/Enchant.Net/DictionaryInfo.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright (c) 2007 Eric Scott Albright
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-using System;
-
-namespace Enchant
-{
- public class DictionaryInfo
- {
- private readonly string _language_tag;
- private readonly ProviderInfo _provider_info;
-
- internal DictionaryInfo(string language_tag, ProviderInfo provider_info)
- {
- if (language_tag == null)
- {
- throw new ArgumentNullException("language_tag");
- }
- if (provider_info == null)
- {
- throw new ArgumentNullException("provider_info");
- }
- _language_tag = language_tag;
- _provider_info = provider_info;
- }
-
- public string Language
- {
- get { return _language_tag; }
- }
-
- public ProviderInfo Provider
- {
- get { return _provider_info; }
- }
- }
-} \ No newline at end of file
diff --git a/src/bindings/Enchant.Net/Enchant.Net.csproj b/src/bindings/Enchant.Net/Enchant.Net.csproj
deleted file mode 100644
index 4ea0099..0000000
--- a/src/bindings/Enchant.Net/Enchant.Net.csproj
+++ /dev/null
@@ -1,62 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{249A514E-7212-485B-86D0-E0ACB8967A4C}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Enchant</RootNamespace>
- <AssemblyName>Enchant.Net</AssemblyName>
- <RunPostBuildEvent>Always</RunPostBuildEvent>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\..\..\bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\..\..\bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Broker.cs" />
- <Compile Include="Dictionary.cs" />
- <Compile Include="Bindings.cs" />
- <Compile Include="DictionaryInfo.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="ProviderInfo.cs" />
- <Compile Include="SafeBrokerHandle.cs" />
- <Compile Include="SafeDictionaryHandle.cs" />
- <Compile Include="Utf8Marshaller.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="App.config" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
- <PropertyGroup>
- <PostBuildEvent>
- </PostBuildEvent>
- <PreBuildEvent>
- </PreBuildEvent>
- </PropertyGroup>
-</Project> \ No newline at end of file
diff --git a/src/bindings/Enchant.Net/Properties/AssemblyInfo.cs.in b/src/bindings/Enchant.Net/Properties/AssemblyInfo.cs.in
deleted file mode 100644
index 43c60bd..0000000
--- a/src/bindings/Enchant.Net/Properties/AssemblyInfo.cs.in
+++ /dev/null
@@ -1,34 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Enchant.Net")]
-[assembly: AssemblyDescription("A library that wraps other spell checking backends.")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Enchant.Net")]
-[assembly: AssemblyCopyright("Copyright © 2007-2008 Eric Scott Albright")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("770fdaf9-6948-4d9d-bcb1-176a9630d99b")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("@ENCHANT_MAJOR_VERSION@.@ENCHANT_MINOR_VERSION@.@ENCHANT_MICRO_VERSION@.0")]
-[assembly: AssemblyFileVersion("@ENCHANT_MAJOR_VERSION@.@ENCHANT_MINOR_VERSION@.@ENCHANT_MICRO_VERSION@.*")]
diff --git a/src/bindings/Enchant.Net/ProviderInfo.cs b/src/bindings/Enchant.Net/ProviderInfo.cs
deleted file mode 100644
index 183bf08..0000000
--- a/src/bindings/Enchant.Net/ProviderInfo.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright (c) 2007 Eric Scott Albright
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-namespace Enchant
-{
- public class ProviderInfo
- {
- private readonly string _description;
- private readonly string _file;
- private readonly string _name;
-
- internal ProviderInfo(string name, string description, string file)
- {
- _name = name;
- _description = description;
- _file = file;
- }
-
- public string Description
- {
- get { return _description; }
- }
-
- public string File
- {
- get { return _file; }
- }
-
- public string Name
- {
- get { return _name; }
- }
- }
-} \ No newline at end of file
diff --git a/src/bindings/Enchant.Net/SafeBrokerHandle.cs b/src/bindings/Enchant.Net/SafeBrokerHandle.cs
deleted file mode 100644
index b07cb9f..0000000
--- a/src/bindings/Enchant.Net/SafeBrokerHandle.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright (c) 2007 Eric Scott Albright
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-using System;
-using System.Runtime.ConstrainedExecution;
-using System.Runtime.InteropServices;
-
-namespace Enchant
-{
- internal sealed class SafeBrokerHandle : SafeHandle
- {
- public SafeBrokerHandle()
- : base(IntPtr.Zero, true)
- {
- }
-
- ///<summary>
- ///When overridden in a derived class, gets a value indicating whether the handle value is invalid.
- ///</summary>
- ///<returns>
- ///true if the handle is valid; otherwise, false.
- ///</returns>
- public override bool IsInvalid
- {
- get { return (handle == IntPtr.Zero); }
- }
-
- ///<summary>
- ///When overridden in a derived class, executes the code required to free the handle.
- ///</summary>
- ///<returns>
- ///true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false. In this case, it generates a ReleaseHandleFailed Managed Debugging Assistant.
- ///</returns>
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
- protected override bool ReleaseHandle()
- {
- Bindings.enchant_broker_free(handle);
- return true;
- }
- }
-} \ No newline at end of file
diff --git a/src/bindings/Enchant.Net/SafeDictionaryHandle.cs b/src/bindings/Enchant.Net/SafeDictionaryHandle.cs
deleted file mode 100644
index cf80857..0000000
--- a/src/bindings/Enchant.Net/SafeDictionaryHandle.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright (c) 2007 Eric Scott Albright
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-using System;
-using System.Runtime.ConstrainedExecution;
-using System.Runtime.InteropServices;
-
-namespace Enchant
-{
- internal sealed class SafeDictionaryHandle : SafeHandle
- {
- private readonly SafeBrokerHandle _broker;
-
- public SafeDictionaryHandle(SafeBrokerHandle broker, IntPtr handle)
- : base(IntPtr.Zero, true)
- {
- _broker = broker;
- SetHandle(handle);
- }
-
-
- ///<summary>
- ///When overridden in a derived class, gets a value indicating whether the handle value is invalid.
- ///</summary>
- ///<returns>
- ///true if the handle is valid; otherwise, false.
- ///</returns>
- public override bool IsInvalid
- {
- get { return (handle == IntPtr.Zero); }
- }
-
- ///<summary>
- ///When overridden in a derived class, executes the code required to free the handle.
- ///</summary>
- ///<returns>
- ///true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false. In this case, it generates a ReleaseHandleFailed Managed Debugging Assistant.
- ///</returns>
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
- protected override bool ReleaseHandle()
- {
- // The finalizer may finalize the broker and the dictionaries in any order
- // leading to a case where the broker may have already been released and thus
- // already cleaned up all its owned dictionaries. If that is the case, we don't
- // need to clean up.
- if (_broker.IsClosed)
- return true;
- Bindings.enchant_broker_free_dict(_broker, handle);
- return true;
- }
- }
-} \ No newline at end of file
diff --git a/src/bindings/Enchant.Net/Utf8Marshaller.cs b/src/bindings/Enchant.Net/Utf8Marshaller.cs
deleted file mode 100644
index fc2f583..0000000
--- a/src/bindings/Enchant.Net/Utf8Marshaller.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Copyright (c) 2007 Christopher Wilks and Eric Scott Albright
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace Enchant
-{
- internal sealed class Utf8Marshaller : IDisposable
- {
- private readonly int _byteCount;
- private readonly IntPtr _unmanagedPrt;
- private bool _isDisposed;
-
- public Utf8Marshaller(string value)
- {
- _byteCount = Encoding.UTF8.GetByteCount(value);
- byte[] bytes = new byte[_byteCount + 1];
- int bytesWritten = Encoding.UTF8.GetBytes(value, 0, value.Length, bytes, 0);
- bytes[bytesWritten] = 0; // null terminate it
- ++bytesWritten;
- _unmanagedPrt = Marshal.AllocHGlobal(bytesWritten);
- for (int i = 0; i < bytes.Length; i++)
- {
- Marshal.WriteByte(MarshalledValue, i, bytes[i]);
- }
- }
-
- public IntPtr MarshalledValue
- {
- get { return _unmanagedPrt; }
- }
-
- public int MarshalledSize
- {
- get { return _byteCount; }
- }
-
- #region IDisposable Members
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- #endregion
-
- private void Dispose(bool disposing)
- {
- if (_isDisposed)
- {
- return;
- }
- _isDisposed = true;
- if (disposing)
- {
- //dump managed resources
- }
-
- Marshal.FreeHGlobal(MarshalledValue);
- }
-
- public static List<string> MarshalFromUtf8Array(IntPtr listAddress, int count)
- {
- List<string> strings = new List<string>();
-
- for (int i = 0; i < count; i++)
- {
- IntPtr stringAddress = Marshal.ReadIntPtr(listAddress, i*IntPtr.Size);
- string s = MarshalFromUtf8(stringAddress);
- strings.Add(s);
- }
- return strings;
- }
-
- public static string MarshalFromUtf8(IntPtr intPtr)
- {
- if (intPtr.ToInt64() == 0)
- {
- return null;
- }
- List<byte> bytes = new List<byte>();
- for (int i = 0; true; i++)
- {
- byte b = Marshal.ReadByte(intPtr, i);
- if (b == 0)
- {
- break;
- }
- bytes.Add(b);
- }
- return Encoding.UTF8.GetString(bytes.ToArray());
- }
-
- ~Utf8Marshaller()
- {
- Dispose(false);
- }
- }
-} \ No newline at end of file
diff --git a/unittests/Enchant.Net.Tests/BrokerTests.cs b/unittests/Enchant.Net.Tests/BrokerTests.cs
deleted file mode 100644
index a53afd0..0000000
--- a/unittests/Enchant.Net.Tests/BrokerTests.cs
+++ /dev/null
@@ -1,363 +0,0 @@
-/* Copyright (c) 2007 Eric Scott Albright
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using Microsoft.Win32;
-using NUnit.Framework;
-
-namespace Enchant.Tests
-{
- [TestFixture]
- public class BrokerTests
- {
- #region Setup/Teardown
-
- [SetUp]
- public void Setup()
- {
- oldRegistryValue = (string)
- Registry.GetValue(@"HKEY_CURRENT_USER\Software\Enchant\Config", "Data_Dir", null);
- tempdir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
-
- Registry.SetValue(@"HKEY_CURRENT_USER\Software\Enchant\Config", "Data_Dir", tempdir, RegistryValueKind.String);
- }
-
- [TearDown]
- public void Teardown()
- {
- if (oldRegistryValue == null)
- {
- Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Enchant").OpenSubKey("Config", true).DeleteValue(
- "Data_Dir");
- }
- else
- {
- Registry.SetValue(@"HKEY_CURRENT_USER\Software\Enchant\Config",
- "Data_Dir",
- oldRegistryValue,
- RegistryValueKind.String);
- }
- while (Directory.Exists(tempdir))
- {
- Directory.Delete(tempdir, true);
- }
- }
-
- #endregion
-
- private string tempdir;
- private string oldRegistryValue;
-
- [TestFixtureSetUp]
- public void FixtureSetup()
- {
- string providerDir = Path.Combine(Path.Combine(
- Directory.GetCurrentDirectory(), "lib"), "enchant");
- if (!Directory.Exists(providerDir))
- {
- Directory.CreateDirectory(providerDir);
- }
- File.Copy("libenchant_ispell.dll",
- Path.Combine(providerDir, "libenchant_ispell.dll"), true);
- File.Copy("libenchant_myspell.dll",
- Path.Combine(providerDir, "libenchant_myspell.dll"), true);
- InstallDictionary("myspell", new string[] { "en_US.aff", "en_US.dic" });
- }
-
- static private void InstallDictionary(string provider, IEnumerable<string> files)
- {
- string dictionarySourceDir =
- Path.Combine(Path.Combine(Path.Combine(Path.Combine(Path.Combine(Path.Combine(
- Directory.GetCurrentDirectory(), ".."), ".."),
- "lib"), "share"),
- "enchant"), provider);
-
- string dictionaryDestDir = Path.Combine(Path.Combine(Path.Combine(
- Directory.GetCurrentDirectory(), "share"), "enchant"),
- provider);
-
- if (!Directory.Exists(dictionaryDestDir))
- {
- Directory.CreateDirectory(dictionaryDestDir);
- }
-
- foreach (string file in files)
- {
- File.Copy(Path.Combine(dictionarySourceDir, file),
- Path.Combine(dictionaryDestDir, file), true);
-
- }
- }
-
- [TestFixtureTearDown]
- public void FixtureTearDown()
- {
- Directory.Delete(Path.Combine(Directory.GetCurrentDirectory(), "lib"), true);
- Directory.Delete(Path.Combine(Directory.GetCurrentDirectory(), "share"), true);
- }
-
- [Test]
- public void Construct()
- {
- Assert.IsNotNull(new Broker());
- }
-
- [Test]
- // this test may fail because it picks up dictionaries from the
- // open office installation present on the machine
- public void Dictionaries()
- {
- using (Broker broker = new Broker())
- {
- IEnumerable<DictionaryInfo> dictionaries = broker.Dictionaries;
- Assert.IsNotNull(dictionaries);
- int count = 0;
- foreach (DictionaryInfo info in dictionaries)
- {
- Console.WriteLine("Language:{0}\tName:{1}\tDescription:{2}\tFile:{3}",
- info.Language,
- info.Provider.Name,
- info.Provider.Description,
- info.Provider.File);
- Assert.IsNotEmpty(info.Language);
- Assert.IsNotEmpty(info.Provider.Name);
- Assert.IsNotEmpty(info.Provider.Description);
- Assert.IsNotEmpty(info.Provider.File);
- ++count;
- }
- Assert.AreEqual(1, count);
- }
- }
-
- [Test]
- public void DictionaryExists()
- {
- using (Broker broker = new Broker())
- {
- Assert.IsFalse(broker.DictionaryExists("qaa"));
- Assert.IsTrue(broker.DictionaryExists("en_US"));
- }
- }
-
- [Test]
- public void Providers()
- {
- using (Broker broker = new Broker())
- {
- IEnumerable<ProviderInfo> providers = broker.Providers;
- Assert.IsNotNull(providers);
- int count = 0;
- foreach (ProviderInfo info in providers)
- {
- Console.WriteLine("Name:{0}\tDescription:{1}\tFile:{2}",
- info.Name,
- info.Description,
- info.File);
- Assert.IsNotEmpty(info.Name);
- Assert.IsNotEmpty(info.Description);
- Assert.IsNotEmpty(info.File);
- ++count;
- }
- Assert.AreEqual(2, count);
- }
- }
-
- [Test]
- public void RequestDictionary()
- {
- using (Broker broker = new Broker())
- {
- Dictionary dictionary = broker.RequestDictionary("en_US");
- Assert.IsNotNull(dictionary);
- }
- }
-
- [Test]
- public void RequestDictionary_CachingEnabled_DictionaryReRequested_SameReference()
- {
- using (Broker broker = new Broker())
- {
- broker.CacheDictionaries = true;
- Dictionary dictionaryFirstRequest = broker.RequestDictionary("en_US");
- Dictionary dictionarySecondRequest = broker.RequestDictionary("en_US");
-
- Assert.AreSame(dictionaryFirstRequest, dictionarySecondRequest);
- }
- }
-
- [Test]
- public void RequestDictionary_CachingEnabled_DictionaryDisposedThenReRequested_DifferentReference()
- {
- using (Broker broker = new Broker())
- {
- broker.CacheDictionaries = true;
- Dictionary dictionaryFirstRequest;
- using (dictionaryFirstRequest = broker.RequestDictionary("en_US")) {}
- Dictionary dictionarySecondRequest = broker.RequestDictionary("en_US");
-
- Assert.AreNotSame(dictionaryFirstRequest, dictionarySecondRequest);
- }
- }
-
- [Test]
- public void RequestDictionary_CachingDisabled_DictionaryReRequested_DifferentReference()
- {
- using (Broker broker = new Broker())
- {
- broker.CacheDictionaries = false;
- Dictionary dictionaryFirstRequest = broker.RequestDictionary("en_US");
- Dictionary dictionarySecondRequest = broker.RequestDictionary("en_US");
-
- Assert.AreNotSame(dictionaryFirstRequest, dictionarySecondRequest);
- }
- }
-
- [Test]
- public void RequestDictionary_CachingDisabled_DictionaryDisposedThenReRequested_DifferentReference()
- {
- using (Broker broker = new Broker())
- {
- broker.CacheDictionaries = false;
- Dictionary dictionaryFirstRequest;
- using (dictionaryFirstRequest = broker.RequestDictionary("en_US"))
- {
- }
- Dictionary dictionarySecondRequest = broker.RequestDictionary("en_US");
-
- Assert.AreNotSame(dictionaryFirstRequest, dictionarySecondRequest);
- }
- }
-
- [Test]
- [ExpectedException(typeof(ObjectDisposedException))]
- public void Dispose_UseDictionaryAfterBrokerDisposed_Throws()
- {
- Dictionary dictionary;
- using (Broker broker = new Broker())
- {
- dictionary = broker.RequestDictionary("en_US");
- }
- DictionaryInfo info = dictionary.Information;
- }
-
- [Test]
- [ExpectedException(typeof (ApplicationException))]
- public void RequestDictionary_DictionaryDoesNotExist_Throws()
- {
- using (Broker broker = new Broker())
- {
- broker.RequestDictionary("qaa");
- }
- }
-
- [Test]
- public void RequestPwlDictionary()
- {
- string filename = Path.GetTempFileName();
- using (Broker broker = new Broker())
- {
- using (Dictionary dictionary = broker.RequestPwlDictionary(filename))
- {
- Assert.IsNotNull(dictionary);
- File.Delete(filename);
- }
- }
- }
-
- [Test]
- public void SetOrdering()
- {
- using (Broker broker = new Broker())
- {
- broker.SetOrdering("en_US", "aspell, myspell, ispell");
- }
- }
-
- [Test]
- public void DictionaryKeepsBrokerAlive()
- {
- WeakReference brokerReference;
- Dictionary dictionary = GetDictionaryAllowingBrokerToGoOutOfScope(out brokerReference);
- GC.Collect();
- GC.WaitForPendingFinalizers();
- Assert.IsTrue(brokerReference.IsAlive);
- GC.KeepAlive(dictionary);
- }
-
- private static Dictionary GetDictionaryAllowingBrokerToGoOutOfScope(out WeakReference brokerReference)
- {
- Broker broker = new Broker();
- brokerReference = new WeakReference(broker);
- return broker.RequestDictionary("en_US");
- }
-
- [Test]
- public void Finalize_DictionaryGoesOutOfScope_Finalized()
- {
- using (Broker broker = new Broker())
- {
- broker.CacheDictionaries = true;
- WeakReference dictionaryReference = GetDictionaryReference(broker);
- GC.Collect();
- GC.WaitForPendingFinalizers();
- Assert.IsFalse(dictionaryReference.IsAlive);
- }
- }
-
- //this will allow the dictionary object to go out of scope
- private static WeakReference GetDictionaryReference(Broker broker)
- {
- Dictionary dictionary = broker.RequestDictionary("en_US");
- return new WeakReference(dictionary);
- }
-
- [Test]
- public void Default_ReturnsNonNull()
- {
- Assert.IsNotNull(Broker.Default);
- }
-
- [Test]
- public void Default_CalledTwice_ReturnsSame()
- {
- Assert.AreSame(Broker.Default, Broker.Default);
- }
-
- [Test]
- public void Default_Disposed_ReturnsNonNull()
- {
- Broker.Default.Dispose();
- Assert.IsNotNull(Broker.Default);
- }
-
- [Test]
- public void Default_Disposed_ReturnsNewObject()
- {
- Broker originalBroker = Broker.Default;
- originalBroker.Dispose();
-
- Assert.AreNotSame(originalBroker, Broker.Default);
- }
-
- }
-}
diff --git a/unittests/Enchant.Net.Tests/DictionaryTests.cs b/unittests/Enchant.Net.Tests/DictionaryTests.cs
deleted file mode 100644
index 9f7bc39..0000000
--- a/unittests/Enchant.Net.Tests/DictionaryTests.cs
+++ /dev/null
@@ -1,219 +0,0 @@
-/* Copyright (c) 2007 Eric Scott Albright
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-using Microsoft.Win32;
-using NUnit.Framework;
-
-namespace Enchant.Tests
-{
- [TestFixture]
- public class DictionaryTests
- {
- #region Setup/Teardown
-
- [SetUp]
- public void Setup()
- {
- oldRegistryValue = (string) Registry.GetValue(@"HKEY_CURRENT_USER\Software\Enchant\Config", "Data_Dir", null);
- tempdir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
-
- Registry.SetValue(@"HKEY_CURRENT_USER\Software\Enchant\Config", "Data_Dir", tempdir, RegistryValueKind.String);
- broker = new Broker();
- dictionary = broker.RequestDictionary("en_US");
- }
-
- [TearDown]
- public void Teardown()
- {
- if (oldRegistryValue == null)
- {
- Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Enchant").OpenSubKey("Config", true).DeleteValue(
- "Data_Dir");
- }
- else
- {
- Registry.SetValue(@"HKEY_CURRENT_USER\Software\Enchant\Config",
- "Data_Dir",
- oldRegistryValue,
- RegistryValueKind.String);
- }
-
- dictionary.Dispose();
- broker.Dispose();
- while (Directory.Exists(tempdir))
- {
- Directory.Delete(tempdir, true);
- }
- }
-
- #endregion
-
- private Broker broker;
- private Dictionary dictionary;
- private string tempdir;
- private string oldRegistryValue;
-
- [TestFixtureSetUp]
- public void FixtureSetup()
- {
- string providerDir = Path.Combine(Path.Combine(
- Directory.GetCurrentDirectory(), "lib"), "enchant");
- if (!Directory.Exists(providerDir))
- {
- Directory.CreateDirectory(providerDir);
- }
- File.Copy("libenchant_ispell.dll",
- Path.Combine(providerDir, "libenchant_ispell.dll"), true);
- File.Copy("libenchant_myspell.dll",
- Path.Combine(providerDir, "libenchant_myspell.dll"), true);
- InstallDictionary("myspell", new string[]{"en_US.aff", "en_US.dic"});
- }
-
- static private void InstallDictionary(string provider, IEnumerable<string> files)
- {
- string dictionarySourceDir =
- Path.Combine(Path.Combine(Path.Combine(Path.Combine(Path.Combine(Path.Combine(
- Directory.GetCurrentDirectory(), ".."), ".."),
- "lib"), "share"),
- "enchant"), provider);
-
- string dictionaryDestDir = Path.Combine(Path.Combine(Path.Combine(
- Directory.GetCurrentDirectory(), "share"), "enchant"),
- provider);
-
- if (!Directory.Exists(dictionaryDestDir))
- {
- Directory.CreateDirectory(dictionaryDestDir);
- }
-
- foreach (string file in files)
- {
- File.Copy(Path.Combine(dictionarySourceDir, file),
- Path.Combine(dictionaryDestDir, file), true);
-
- }
- }
-
- [TestFixtureTearDown]
- public void FixtureTearDown()
- {
- Directory.Delete(Path.Combine(Directory.GetCurrentDirectory(), "lib"), true);
- Directory.Delete(Path.Combine(Directory.GetCurrentDirectory(), "share"), true);
- }
-
- [Test]
- public void Add()
- {
- Assert.IsFalse(dictionary.Check("Googled"));
- dictionary.Add("Googled");
- Assert.IsTrue(dictionary.Check("Googled"));
- }
-
- [Test]
- public void AddToSession(string word)
- {
- Assert.IsFalse(dictionary.Check("list"));
- dictionary.AddToSession("list");
- Assert.IsTrue(dictionary.Check("list"));
- }
-
- [Test]
- public void Check()
- {
- Assert.IsTrue(dictionary.Check("hello"));
- Assert.IsFalse(dictionary.Check("helo"));
- }
-
- [Test]
- public void Information()
- {
- DictionaryInfo info = dictionary.Information;
- Console.WriteLine("Language:{0}\tName:{1}\tDescription:{2}\tFile:{3}",
- info.Language,
- info.Provider.Name,
- info.Provider.Description,
- info.Provider.File);
- Assert.AreEqual("en_US", info.Language);
- Assert.IsNotEmpty(info.Provider.Name);
- Assert.IsNotEmpty(info.Provider.Description);
- Assert.IsNotEmpty(info.Provider.File);
- }
-
- [Test]
- public void IsAdded()
- {
- Assert.IsFalse(dictionary.IsAdded("list"));
- dictionary.AddToSession("list");
- Assert.IsTrue(dictionary.IsAdded("list"));
- }
-
- [Test]
- public void IsRemoved()
- {
- Assert.IsFalse(dictionary.IsRemoved("list"));
- dictionary.RemoveFromSession("list");
- Assert.IsTrue(dictionary.IsRemoved("list"));
- }
-
- [Test]
- public void Remove()
- {
- Assert.IsTrue(dictionary.Check("world"));
- dictionary.Remove("world");
- Assert.IsFalse(dictionary.Check("world"));
- }
-
- [Test]
- public void RemoveFromSession()
- {
- Assert.IsTrue(dictionary.Check("hello"));
- dictionary.RemoveFromSession("hello");
- Assert.IsFalse(dictionary.Check("hello"));
- }
-
- [Test]
- public void StoreReplacement()
- {
- dictionary.StoreReplacement("theirs", "their's");
- }
-
- [Test]
- public void Suggest()
- {
- List<string> suggestions = new List<string>(dictionary.Suggest("helo"));
- Assert.Contains("hello", suggestions);
- }
-
- [Test]
- public void Dispose_Called_SendsDisposedEvent()
- {
- bool disposedEventCalled = false;
- dictionary.Disposed += delegate
- { disposedEventCalled = true; };
- dictionary.Dispose();
- Assert.IsTrue(disposedEventCalled);
- }
- }
-} \ No newline at end of file
diff --git a/unittests/Enchant.Net.Tests/Enchant.Net.Tests.csproj b/unittests/Enchant.Net.Tests/Enchant.Net.Tests.csproj
deleted file mode 100644
index cbe87c8..0000000
--- a/unittests/Enchant.Net.Tests/Enchant.Net.Tests.csproj
+++ /dev/null
@@ -1,59 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{518F02B2-A542-44B3-A10D-CA8144268077}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Enchant.Tests</RootNamespace>
- <AssemblyName>Enchant.Net.Tests</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\..\bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\..\bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="nunit.framework, Version=2.4.1.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- </Reference>
- <Reference Include="System" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="BrokerTests.cs" />
- <Compile Include="DictionaryTests.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\src\bindings\Enchant.Net\Enchant.Net.csproj">
- <Project>{249A514E-7212-485B-86D0-E0ACB8967A4C}</Project>
- <Name>Enchant.Net</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
- <PropertyGroup>
- <PreBuildEvent>
- </PreBuildEvent>
- </PropertyGroup>
-</Project> \ No newline at end of file
diff --git a/unittests/Enchant.Net.Tests/Properties/AssemblyInfo.cs b/unittests/Enchant.Net.Tests/Properties/AssemblyInfo.cs
deleted file mode 100644
index 10452a6..0000000
--- a/unittests/Enchant.Net.Tests/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Enchant.Net.Tests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Enchant.Net.Tests")]
-[assembly: AssemblyCopyright("Copyright © 2007 Eric Scott Albright")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("d3f8e92e-e8be-4be3-94ef-2205d88abad5")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]