コード例 #1
0
ファイル: Aspell.cs プロジェクト: dbremner/smokey
        private Aspell()
        {
            AspellConfigHandle config = AspellConfigHandle.Default;

            AspellCanHaveErrorHandle result = new AspellCanHaveErrorHandle(config);

            if (NativeMethods.aspell_error_number(result) != 0)
            {
                IntPtr ptr = NativeMethods.aspell_error_message(result);
                throw new AspellException(Marshal.PtrToStringAnsi(ptr));
            }

            m_speller = new AspellSpellerHandle(result);

            DoAdd("exe");
            DoAdd("mdb");
            DoAdd("stdout");
            DoAdd("xml");

            if (Settings.Has("ignoreList"))
            {
                Console.Error.WriteLine("the ignoreList setting is no longer supported: use dictionary instead");                       // TODO: remove this (eventually)
            }
            string path = Settings.Get("dictionary", string.Empty);

            string[] entries = path.Split(':');
            foreach (string s in entries)
            {
                DoAddDictFile(s);
            }
        }
コード例 #2
0
ファイル: AspellHandles.cs プロジェクト: dbremner/smokey
//		public AspellSpellerHandle() : base(IntPtr.Zero, true)
//		{
//		}

        public AspellSpellerHandle(AspellCanHaveErrorHandle err) : base(IntPtr.Zero, true)
        {
            handle = NativeMethods.to_aspell_speller(err);
            err.SetHandleAsInvalid();                                   // to_aspell_speller is a cast so we have to reset err to avoid a double delete...
        }
コード例 #3
0
ファイル: Aspell.cs プロジェクト: dbremner/smokey
		private Aspell()
		{
			AspellConfigHandle config = AspellConfigHandle.Default;
			
			AspellCanHaveErrorHandle result = new AspellCanHaveErrorHandle(config);
			if (NativeMethods.aspell_error_number(result) != 0)
			{
				IntPtr ptr = NativeMethods.aspell_error_message(result);
				throw new AspellException(Marshal.PtrToStringAnsi(ptr));
			}
			
			m_speller = new AspellSpellerHandle(result);
				
			DoAdd("exe");		
			DoAdd("mdb");
			DoAdd("stdout");
			DoAdd("xml");
			
			if (Settings.Has("ignoreList"))
				Console.Error.WriteLine("the ignoreList setting is no longer supported: use dictionary instead");	// TODO: remove this (eventually)
			
			string path = Settings.Get("dictionary", string.Empty);
			string[] entries = path.Split(':');
			foreach (string s in entries)
				DoAddDictFile(s);
		}
コード例 #4
0
ファイル: AspellHandles.cs プロジェクト: dbremner/smokey
//		public AspellSpellerHandle() : base(IntPtr.Zero, true)
//		{
//		}
				
		public AspellSpellerHandle(AspellCanHaveErrorHandle err) : base(IntPtr.Zero, true)
		{
			handle = NativeMethods.to_aspell_speller(err);
			err.SetHandleAsInvalid();			// to_aspell_speller is a cast so we have to reset err to avoid a double delete...
		}
コード例 #5
0
 public static extern IntPtr to_aspell_speller(AspellCanHaveErrorHandle ths);
コード例 #6
0
 public static extern IntPtr aspell_error_message(AspellCanHaveErrorHandle ths);
コード例 #7
0
 public static extern uint aspell_error_number(AspellCanHaveErrorHandle ths);
コード例 #8
0
 public static extern void delete_aspell_can_have_error(AspellCanHaveErrorHandle handle);
コード例 #9
0
ファイル: NativeAspell.cs プロジェクト: dbremner/smokey
		public static extern IntPtr to_aspell_speller(AspellCanHaveErrorHandle ths);
コード例 #10
0
ファイル: NativeAspell.cs プロジェクト: dbremner/smokey
		public static extern IntPtr aspell_error_message(AspellCanHaveErrorHandle ths);
コード例 #11
0
ファイル: NativeAspell.cs プロジェクト: dbremner/smokey
		public static extern uint aspell_error_number(AspellCanHaveErrorHandle ths);
コード例 #12
0
ファイル: NativeAspell.cs プロジェクト: dbremner/smokey
		public static extern void delete_aspell_can_have_error(AspellCanHaveErrorHandle handle);