private PatternMatchObject[] CreateMatchObjects(string pattern)
        {
            /* パターンコードからパターン一覧を作成 */
            var patterns = HexTextEncoder.ToByteArrayMap(pattern);

            if (patterns == null)
            {
                return(null);
            }

            /* マッチオブジェクトに変換 */
            var match_objs = new List <PatternMatchObject>();

            foreach (var pattern_data in patterns)
            {
                match_objs.Add(new PatternMatchObject(pattern_data));
            }

            return(match_objs.ToArray());
        }
示例#2
0
        private void UpdateView()
        {
            /* 表示中の変換式をコンパイル */
            target_codes_exp_new_ = TBox_Target.Text;
            target_codes_obj_new_ = HexTextEncoder.ToByteArrayMap(target_codes_exp_new_);

            replace_code_exp_new_ = TBox_Replace.Text;
            replace_code_obj_new_ = HexTextEncoder.ToByteArray(replace_code_exp_new_);

            /* 表示更新 */
            if (target_codes_exp_new_.Length > 0)
            {
                TBox_Target.BackColor = (target_codes_obj_new_ != null)
                                      ? (Ratatoskr.Resource.AppColors.Ok)
                                      : (Ratatoskr.Resource.AppColors.Ng);
            }
            else
            {
                TBox_Target.BackColor = Color.White;
            }

            if (replace_code_exp_new_.Length > 0)
            {
                TBox_Replace.BackColor = (replace_code_obj_new_ != null)
                                       ? (Ratatoskr.Resource.AppColors.Ok)
                                       : (Ratatoskr.Resource.AppColors.Ng);
            }
            else
            {
                TBox_Replace.BackColor = Color.White;
            }

            /* 変更状態確認 */
            TBox_Target.ForeColor  = (target_codes_exp_busy_ != target_codes_exp_new_) ? (Color.Gray) : (Color.Black);
            TBox_Replace.ForeColor = (replace_code_exp_busy_ != replace_code_exp_new_) ? (Color.Gray) : (Color.Black);
        }