Esempio n. 1
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            var next = dataGridView1.Rows[e.RowIndex].Cells[0].Value as ConversationError <ConversationNode>;

            if (next != null)
            {
                if (next != m_current)
                {
                    m_current = next;
                    m_node    = m_current.Nodes.GetEnumerator();
                }

                if (m_node.MoveNext())
                {
                    HightlightNode.Execute(m_node.Current);
                }
                else
                {
                    m_node = m_current.Nodes.GetEnumerator();
                    if (m_node.MoveNext())
                    {
                        HightlightNode.Execute(m_node.Current);
                    }
                }
            }
        }
Esempio n. 2
0
        void drawWindow1_MouseClick(MouseEventArgs e)
        {
            var oldSelected = m_selectedItem;

            m_selectedItem = null;
            float y = -greyScrollBar1.Value;

            foreach (var item in m_items)
            {
                if (e.Y >= y && e.Y <= y + item.Height)
                {
                    m_selectedItem = item;
                    break;
                }
                y += item.Height;
            }
            drawWindow1.Invalidate(true);

            if (m_selectedItem != oldSelected)
            {
                if (m_selectedItem != null)
                {
                    m_nodeIterator = m_selectedItem.Error.MakeEnumerator();
                    if (m_nodeIterator != null)
                    {
                        m_nodeIterator.MoveNext();
                    }
                }
                else
                {
                    m_nodeIterator = null;
                }
            }
            else if (m_nodeIterator != null)
            {
                m_nodeIterator.MoveNext();
            }

            if (m_nodeIterator != null && m_nodeIterator.Current != null)
            {
                BoolRef success = true;
                HightlightNode.Execute(m_nodeIterator.Current.Item1, m_nodeIterator.Current.Item2, success);
            }
        }