示例#1
0
        public void Free()
        {
            this.releaseDelegate?.Invoke(this.kanji2KoeHandle);
            this.kanji2KoeHandle = IntPtr.Zero;

            this.createDelegate   = null;
            this.releaseDelegate  = null;
            this.convertDelegate  = null;
            this.convertWDelegate = null;
        }
示例#2
0
        public void Free()
        {
            if (this.kanji2KoeLib != null)
            {
                // ハンドルを開放する
                if (this.kanji2KoeHandle != IntPtr.Zero)
                {
                    this.releaseDelegate?.Invoke(this.kanji2KoeHandle);
                    this.kanji2KoeHandle = IntPtr.Zero;
                }

                this.createDelegate  = null;
                this.releaseDelegate = null;
                this.convertDelegate = null;

                this.kanji2KoeLib.Dispose();
                this.kanji2KoeLib = null;
            }
        }
示例#3
0
        public void Load()
        {
            if (this.kanji2KoeLib == null)
            {
                this.kanji2KoeLib = new UnmanagedLibrary(this.Kanji2KoeDllName);
            }

            if (this.kanji2KoeLib == null)
            {
                return;
            }

            if (this.createDelegate == null)
            {
                this.createDelegate =
                    this.kanji2KoeLib.GetUnmanagedFunction <AqKanji2Koe_Create>(nameof(AqKanji2Koe_Create));

                // 言語処理モジュールのインスタンスを生成しそのハンドルを取得する
                int err = 0;
                this.kanji2KoeHandle = this.createDelegate.Invoke(
                    this.Kanji2KoeDictionaryName,
                    ref err);
            }

            if (this.releaseDelegate == null)
            {
                this.releaseDelegate =
                    this.kanji2KoeLib.GetUnmanagedFunction <AqKanji2Koe_Release>(nameof(AqKanji2Koe_Release));
            }

            if (this.convertDelegate == null)
            {
                this.convertDelegate =
                    this.kanji2KoeLib.GetUnmanagedFunction <AqKanji2Koe_Convert>(nameof(AqKanji2Koe_Convert));
            }

            if (this.convertWDelegate == null)
            {
                this.convertWDelegate =
                    this.kanji2KoeLib.GetUnmanagedFunction <AqKanji2Koe_ConvertW>(nameof(AqKanji2Koe_ConvertW));
            }
        }