Esempio n. 1
0
        /// <summary>
        ///  获取替换词
        /// </summary>
        public string GetReplaceWord(ReplaceWordRequestInfo info)
        {
            ReplaceWordResponseResult result = new ReplaceWordResponseResult();

            if (IsUserLogin())
            {
                try
                {
                    var listReplaceWord = CheckWordHelper.GetReplaceWordInfos(info.Text).ToList();
                    result.Result            = true;
                    result.ReplaceWordModels = listReplaceWord;
                }
                catch (Exception ex)
                {
                    WPFClientCheckWordUtil.Log.TextLog.SaveError(ex.Message);
                    result.Message = ex.Message;
                }
            }
            else
            {
                result.Message = "LoginOut";
            }
            return(JsonConvert.SerializeObject(result));
        }
Esempio n. 2
0
        public void InitData(string name)
        {
            ObservableCollection <ReplaceWordInfo> replaceWordInfos = new ObservableCollection <ReplaceWordInfo>(CheckWordHelper.GetReplaceWordInfos(name));

            for (int i = 0; i < replaceWordInfos.Count; i++)
            {
                replaceWordInfos[i].Index = i + 1;
            }
            ReplaceWordLists = replaceWordInfos;
        }