Пример #1
0
        public override void 设置语法(string 语法)
        {
            var __语法参数 = "dtt = abnf, sub = asr";
            int __结果   = 0;
            var __语法长度 = Encoding.UTF8.GetBytes(语法).Length;
            var __编码   = Encoding.UTF8.GetBytes(语法 + '\0');
            var __指针   = Dll在线.MSPUploadData("", __编码, (uint)__语法长度, __语法参数, ref __结果);

            if (__结果 != 0)
            {
                Debug.WriteLine("语法加载失败, 错误码: " + __结果);
                throw new ApplicationException("语法加载失败, 错误码: " + __结果);
            }
            _语法id = Marshal.PtrToStringAnsi(__指针);
            //Debug.WriteLine("语法id: " + _语法id);
        }
Пример #2
0
        public override void 设置语法(List <string> 词典)
        {
            if (词典 == null || 词典.Count == 0)
            {
                return;
            }
            var __字符串  = 合成词典(词典);
            var __语法参数 = "sub = uup, dtt = userword";
            int __结果   = 0;
            var __语法长度 = Encoding.UTF8.GetBytes(__字符串).Length;
            var __编码   = Encoding.UTF8.GetBytes(__字符串 + '\0');

            Dll在线.MSPUploadData("", __编码, (uint)__语法长度, __语法参数, ref __结果);
            if (__结果 != 0)
            {
                Debug.WriteLine("语法加载失败, 错误码: " + __结果);
                throw new ApplicationException("语法加载失败, 错误码: " + __结果);
            }
        }