public void TagSelected(object userData, string[] options, int selectedIndex)
        {
            if (selectedIndex == (int)AndroidLogcatTagType.AllTags)
            {
                // Deselect *No Filter* and select all others.
                UpdateTagFilterBasedOnNoFilterOption(false);
            }
            else if (selectedIndex == (int)AndroidLogcatTagType.NoFilter)
            {
                if (!m_Entries[(int)AndroidLogcatTagType.NoFilter].Selected)
                {
                    // Select *No Filter*, deselect all others.
                    UpdateTagFilterBasedOnNoFilterOption(true);
                }
                else
                {
                    // Deselect *No Filter*, select all others.
                    UpdateTagFilterBasedOnNoFilterOption(false);
                }
            }
            else if (selectedIndex == (int)AndroidLogcatTagType.TagControl)
            {
                PopupWindow.Show(new Rect(m_TagButtonRect.x + 2, m_TagButtonRect.y + m_TagButtonRect.height * 2, 0, 0), new AndroidLogcatTagListPopup(this));
                return;
            }
            else
            {
                m_Entries[selectedIndex].Selected = !m_Entries[selectedIndex].Selected;
                m_Entries[(int)AndroidLogcatTagType.NoFilter].Selected = !(GetSelectedTags(true).Length > 0);
            }

            TagSelectionChanged?.Invoke();
        }
Esempio n. 2
0
        public void TagSelected(object userData, string[] options, int selectedIndex)
        {
            bool tagWindowSelected = false;

            if (selectedIndex == (int)AndroidLogcatTagType.AllTags)
            {
                // Deselect *No Filter* and select all others.
                UpdateTagFilterBasedOnNoFilterOption(false);
            }
            else if (selectedIndex == (int)AndroidLogcatTagType.NoFilter)
            {
                if (!m_SelectedTags[(int)AndroidLogcatTagType.NoFilter])
                {
                    // Select *No Filter*, deselect all others.
                    UpdateTagFilterBasedOnNoFilterOption(true);
                }
                else
                {
                    // Deselect *No Filter*, select all others.
                    UpdateTagFilterBasedOnNoFilterOption(false);
                }
            }
            else if (selectedIndex == (int)AndroidLogcatTagType.TagControl)
            {
                tagWindowSelected = true;
                m_TagWindow       = AndroidLogcatTagWindow.Show(this);
            }
            else
            {
                m_SelectedTags[selectedIndex] = !m_SelectedTags[selectedIndex];
                m_SelectedTags[(int)AndroidLogcatTagType.NoFilter] = !(GetSelectedTags(true).Length > 0);
            }

            if (tagWindowSelected)
            {
                return;
            }

            if (m_TagWindow != null)
            {
                m_TagWindow.Repaint();
            }

            if (TagSelectionChanged != null)
            {
                TagSelectionChanged.Invoke();
            }
        }
Esempio n. 3
0
        private void View_SelectionChanged(object sender, EventArgs e)
        {
            DataGridView view = sender as DataGridView;

            if (view.SelectedRows.Count == 0)
            {
                return;
            }

            int checkIndex = GetCheckBoxCellIndex();

            if (m_options.ShowCheckBoxes && checkIndex != -1 && view.SelectedRows[0].Cells[checkIndex] is DataGridViewCheckBoxCell checkBoxCell &&
                checkBoxCell.Value != null)
            {
                bool set = !(bool)checkBoxCell.Value;
                checkBoxCell.Value = set;

                if (set)
                {
                    m_checkedTags.Add(view.SelectedRows[0].DataBoundItem as ITagData);
                }
                else
                {
                    m_checkedTags.Remove(view.SelectedRows[0].DataBoundItem as ITagData);
                }
            }

            if (dgvTags.SelectedRows[0].DataBoundItem is StaticTagData staticTag)
            {
                StaticSelectionChanged?.Invoke(this, staticTag.Name);
            }
            else
            {
                TagSelectionChanged?.Invoke(this, view.SelectedRows[0].DataBoundItem as ITagData);
            }

            if (!m_options.AllowRowSelect)
            {
                view.ClearSelection();
            }
        }