private void UpdateEditStatus(DataGridViewCell cell)
        {
            var error_text = "";

            /* エラー判定 */
            switch ((ColumnId)cell.OwningColumn.Index)
            {
            case ColumnId.Expression:
            {
                var value_str = cell.Value as string;

                if ((value_str != null) &&
                    (value_str.Length > 0)
                    )
                {
                    if (PacketFilterController.Build(value_str) != null)
                    {
                        cell.Style.BackColor = COLOR_COMMAND_FORMAT_OK;
                    }
                    else
                    {
                        cell.Style.BackColor = COLOR_COMMAND_FORMAT_NG;
                    }
                }
            }
            break;

            default:
                break;
            }

            /* エラーテキストを設定 */
            cell.ErrorText = error_text;
        }
示例#2
0
 public void UpdateFilter()
 {
     if (Property.TargetFilterEnable.Value)
     {
         filter_obj_ = PacketFilterController.Build(Property.TargetFilterValue.Value);
     }
     else
     {
         filter_obj_ = null;
     }
 }
        internal void StartAsync()
        {
            Stop();

            /* 進捗初期化 */
            cancel_req_ = false;
            Success     = false;
            ProgressMax = 1;
            ProgressNow = 1;

            /* 送信ログファイル取得 */
            var info = FileManager.PacketLogOpen.GetReadControllerFromPath(FilePath);

            if ((info == null) || (info.Format == null))
            {
                return;
            }

            var reader = info.Format.CreateReader() as PacketLogReader;

            if (reader == null)
            {
                return;
            }

            if (!reader.Open(info.Option, info.FilePath))
            {
                return;
            }

            /* フィルターモジュール生成 */
            var filter_obj = PacketFilterController.Build(Filter);

            if (filter_obj == null)
            {
                return;
            }

            /* 送信先ゲート取得 */
            var gate_objs = GateManager.FindGateObjectFromWildcardAlias(GateAlias);

            if (gate_objs == null)
            {
                return;
            }

            /* 送信タスク開始 */
            ar_task_ = (new ExecTaskHandler(ExecTask)).BeginInvoke(
                gate_objs, filter_obj, reader, null, null);
        }
        private WatchObject LoadWatchObject(DataGridViewRow row_obj)
        {
            if ((row_obj == null) ||
                (row_obj.IsNewRow)
                )
            {
                return(null);
            }

            /* 現在のセル設定をWatchDataConfigに変換する */
            var config = LoadWatchDataConfig(row_obj);

            /* 変換できなかったり有効設定でない場合は監視しない */
            if ((config == null) ||
                (!config.Enable)
                )
            {
                return(null);
            }

            /* フィルターが有効でない場合は監視しない */
            var filter = PacketFilterController.Build(config.Expression);

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

            /* 監視オブジェクト更新 */
            var watch_obj = row_obj.Tag as WatchObject;

            if ((watch_obj == null) ||
                (watch_obj.Config.Expression != config.Expression)
                )
            {
                watch_obj = new WatchObject(config, filter);
            }
            else
            {
                watch_obj.Config.WatchTarget = config.WatchTarget;
                watch_obj.Config.NtfEvent    = config.NtfEvent;
                watch_obj.Config.NtfDialog   = config.NtfDialog;
                watch_obj.Config.NtfMail     = config.NtfMail;
            }

            return(watch_obj);
        }
        private void DGView_WatchList_EditCell_Command_TextChanged(object sender, EventArgs e)
        {
            var control = sender as DataGridViewTextBoxEditingControl;

            if (control == null)
            {
                return;
            }

            var value = control.Text;

            /* 表示更新 */
            if ((value != null) && (value.Length > 0))
            {
                control.BackColor = (PacketFilterController.Build(value) != null) ? (COLOR_COMMAND_FORMAT_OK) : (COLOR_COMMAND_FORMAT_NG);
            }
            else
            {
                control.BackColor = Color.White;
            }
        }
示例#6
0
        internal void StartAsync()
        {
            Stop();

            /* 進捗初期化 */
            DetectPacketCount = 0;

            /* フィルターモジュール生成 */
            filter_obj_ = PacketFilterController.Build(CaptureFilter);

            if (filter_obj_ == null)
            {
                return;
            }

            /* 監視イベント登録 */
            RegisterWatchEvent();

            /* 監視開始 */
            cancel_req_ = false;
            run_state_  = true;
        }
        private void UpdateView()
        {
            /* 表示中のフィルター式をコンパイル */
            filter_exp_new_ = CBox_Exp.Text;
            filter_obj_new_ = PacketFilterController.Build(filter_exp_new_);

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

            /* 変更状態確認 */
            CBox_Exp.ForeColor = (filter_exp_busy_ != filter_exp_new_)
                               ? (Color.Gray)
                               : (Color.Black);
        }
示例#8
0
 public static bool CheckFilter(string filter)
 {
     return(PacketFilterController.Build(filter) != null);
 }