示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Hunspell"/> class.
        /// </summary>
        /// <param name="affixData">
        /// The affix data. (aff file data)
        /// </param>
        /// <param name="dictionaryData">
        /// The dictionary data. (dic file Data)
        /// </param>
        /// <param name="key">
        /// The key for encrypted dictionaries.
        /// </param>
        private void HunspellInit(byte[] affixData, byte[] dictionaryData, string key)
        {
            if (this.unmanagedHandle != IntPtr.Zero)
            {
                throw new InvalidOperationException("Dictionary is already loaded");
            }

            MarshalHunspellDll.ReferenceNativeHunspellDll();
            this.nativeDllIsReferenced = true;
            this.unmanagedHandle       = MarshalHunspellDll.HunspellInit(affixData, new IntPtr(affixData.Length), dictionaryData, new IntPtr(dictionaryData.Length), key);
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Hunspell"/> class.
 /// </summary>
 /// <param name="affixData">
 /// The affix data. (aff file data)
 /// </param>
 /// <param name="dictionaryData">
 /// The dictionary data. (dic file Data)
 /// </param>
 /// <param name="key">
 /// The key for encrypted dictionaries.
 /// </param>
 private void HunspellInit(byte[] affixData, byte[] dictionaryData, string key)
 {
     MarshalHunspellDll.LoadNativeHunspellDll();
     this.unmanagedHandle = MarshalHunspellDll.HunspellInit(
         affixData, new IntPtr(affixData.Length), dictionaryData, new IntPtr(dictionaryData.Length), key);
 }