private void FilterTemplate_Clicked(object sender, RoutedEventArgs e)
        {
            CheckBox      chk_box     = sender as CheckBox;
            LogFilterData filter_data = chk_box.DataContext as LogFilterData;

            if (chk_box.IsChecked == true)
            {
                filter_data.RetrievePackagePid(adb);
                LogcatList.Items.Filter += filter_data.IsFilterSelected;
            }
            else
            {
                LogcatList.Items.Filter -= filter_data.IsFilterSelected;
            }
        }
Esempio n. 2
0
        public void InitData(CheckBox chk_box)
        {
            LogFilterData filter_data = chk_box.DataContext as LogFilterData;

            if (filter_data == null)
            {
                return;
            }
            checkBox                         = chk_box;
            FilterNameText.Text              = chk_box.Name;
            FilterNameText.IsReadOnly        = true;
            FilterByTagText.Text             = filter_data.TokenByTag;
            FilterByPidText.Text             = filter_data.TokenByPid.ToString();
            FilterByMsgText.Text             = filter_data.TokenByText;
            FilterByLevelCombo.SelectedIndex = (int)filter_data.TokenByLevel;
            FilterByPackageText.Text         = filter_data.TokenByPackage;
            IsNew = false;
        }
        void ExecuteEditFilterCommand(object sender, ExecutedRoutedEventArgs ev)
        {
            ListBoxItem it      = ev.OriginalSource as ListBoxItem;
            CheckBox    chk_box = it.Content as CheckBox;

            if (chk_box == null)
            {
                return;
            }
            LogFilterData filter_data = chk_box.DataContext as LogFilterData;

            if (filter_data == null)
            {
                return;
            }
            EditFilterDialog dlg = new EditFilterDialog(this);

            dlg.InitData(chk_box);
            dlg.ShowModal();
        }