static public bool CheckFilter(Log item, LogViewerControl lvControl)
        {
            bool result =
                (string.IsNullOrWhiteSpace(lvControl.pidTextBox.Text) ? true : Array.Exists(lvControl.pidTextBox.Text.Split(delimeter), element => item.Pid.Equals(element))) &&
                (string.IsNullOrWhiteSpace(lvControl.tagTextBox.Text) ? true : Array.Exists(lvControl.tagTextBox.Text.Split(delimeter), element => item.Tag.Equals(element))) &&
                (string.IsNullOrWhiteSpace(lvControl.msgTextBox.Text) ? true : item.Msg.Contains(lvControl.msgTextBox.Text));

            return(result);
        }
        static public bool CheckLevel(char level, LogViewerControl lvControl)
        {
            bool result =
                (lvControl.verboseCheck.IsChecked == true && level == 'V') ||
                (lvControl.debugCheck.IsChecked == true && level == 'D') ||
                (lvControl.infoCheck.IsChecked == true && level == 'I') ||
                (lvControl.warningCheck.IsChecked == true && level == 'W') ||
                (lvControl.errorCheck.IsChecked == true && level == 'E') ||
                (lvControl.fatalCheck.IsChecked == true && level == 'F');

            return(result);
        }
Example #3
0
        public LogTab(SDBDeviceInfo device, LogViewerControl parent)
        {
            this.parentControl = parent;

            logDataGrid             = CreateLogDataGrid();
            logDataGrid.LoadingRow += LogDataGrid_LoadingRow;

            ConnectLogObserver();

            ExcuteLogProcess(device?.Serial);

            viewSource.Filter += ViewSource_Filter;

            this.AddChild(logDataGrid);
            this.Loaded   += LogTab_Loaded;
            this.Unloaded += LogTab_Unloaded;

            SetViewFont(logDataGrid);
            SetDataGridUpdateTimer();
        }
Example #4
0
        public LogViewerControl()
        {
            this.InitializeComponent();
            this.DataContext = LVM;

            LogTabControl          = this.logTabControl;
            staticLogViewerControl = this;

            Resource.InitEnvColor();
            //Resource.initLeveColorlDic();

            DeviceManager.SubscribeDeviceList(this as ISDBDeviceChangeListener);
            DeviceManager.SubscribeSelectedDevice(SelctedDeviceChanged);

            this.Loaded += LogViewerControl_Loaded;

            Microsoft.VisualStudio.PlatformUI.VSColorTheme.ThemeChanged += delegate
            {
                Resource.InitEnvColor();
                //Resource.initLeveColorlDic();
                CreateLogTabDispatcher(DeviceManager.SelectedDevice);
            };
        }