Ejemplo n.º 1
0
            public int Compare(TreeTableNode x, TreeTableNode y)
            {
                VariableDetails varx = (VariableDetails)x.Tag;
                VariableDetails vary = (VariableDetails)y.Tag;

                int orderx, ordery;

                m_typeOrder.TryGetValue(varx.Key.Type, out orderx);
                m_typeOrder.TryGetValue(vary.Key.Type, out ordery);

                if (varx.Key.Type == LuaValueType.NUMBER && vary.Key.Type == LuaValueType.NUMBER)
                {
                    return(Math.Sign(varx.Key.AsNumber() - vary.Key.AsNumber()));
                }
                else if (orderx == ordery)
                {
                    string keyx = mDebugger.GetValueString(varx.Key);
                    string keyy = mDebugger.GetValueString(vary.Key);
                    return(String.Compare(keyx, keyy));
                }
                else
                {
                    return(ordery - orderx);
                }
            }
Ejemplo n.º 2
0
        private void AutocompleteOption_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem item  = (ToolStripMenuItem)sender;
            LuaValue          value = (LuaValue)item.Tag;

            string str = m_debugger.GetValueString(value);

            string text;

            if (value.Type == LuaValueType.NUMBER)
            {
                text = String.Format("[{0}]", str);
            }
            else if (m_wordRegex.IsMatch(str))
            {
                text = String.Format(".{0}", str);
            }
            else
            {
                text = String.Format("[\"{0}\"]", str);
            }

            inputBox.SetSelection(inputBox.CurrentPos - 1, inputBox.CurrentPos);
            inputBox.ReplaceSelection(text);
        }
Ejemplo n.º 3
0
        private string QuoteValueString(LuaValue value)
        {
            string result = mDebugger.GetValueString(value);

            if (value.Type == LuaValueType.STRING)
            {
                result = "\"" + result + "\"";
            }
            return(result);
        }
Ejemplo n.º 4
0
        public void SetOptions(AutocompleteResult [] values)
        {
            waitingPanel.Visible = false;
            mainPanel.Visible    = true;
            errorPanel.Visible   = false;

            m_options.Clear();
            foreach (AutocompleteResult value in values)
            {
                string       label = m_debugger.GetValueString(value.m_key);
                ListViewItem item  = new ListViewItem(label);
                item.SubItems.Add(value.m_valueType.ToString().Substring(0, 2));
                item.Tag = value;
                m_options.Add(item);
            }

            FilterOptions();

            optionsListView.Focus();
        }