示例#1
0
        private void Fctb_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e)
        {
            try
            {
                if (filter != null && fctb.Text.Length > 0)
                {
                    //string[] lines = luaparser.SplitScringLines(fctb.Text);
                    //List<string> StringList = luaparser.formatfile(lines, ref luaparser.defs);
                    //filter.code = luaparser.ConvertStringArrayToString(StringList.ToArray());


                    filter.code = fctb.Text;
                    Modelhandlers handler = obj.handlers.Find(h => h.key == filter.Key && h.filter.slotKey == filter.SlotKey);
                    handler.code = filter.code;
                    if (Int32.TryParse(filter.Key, out int x))
                    {
                        //Modelhandlers handler = obj.handlers.Find(h => h.key == filter.Key);
                        Console.WriteLine("Key:" + filter.Key + "Fctb_TextChanged");
                    }
                }
                Range range = e.ChangedRange;
                HighlightRange(range);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
示例#2
0
        private void MnuStart_Click(object sender, EventArgs e)
        {
            Modelhandlers handler = obj.handlers.Find(h => h.key == filter.Key && h.filter.slotKey == filter.SlotKey);

            handler.filter.signature = filter.SignatureText = "start()";
            if (Int32.TryParse(handler.key, out int x))
            {
            }
        }
示例#3
0
        private void FilterClick(object sender)
        {
            if (sender is Filter)
            {
                filter       = sender as Filter;
                fctb.Text    = filter.code;
                fctb.Enabled = true;

                Modelhandlers handler = obj.handlers.Find(h => h.key == filter.Key && h.filter.slotKey == filter.SlotKey);
                if (Int32.TryParse(handler.key, out int x))
                {
                }
            }
        }
示例#4
0
        private void RemoveFilter_Click(object sender, EventArgs e)
        {
            Filter filter;

            if (sender is Filter)
            {
                filter = sender as Filter;
                filter.CloseButtonClick -= new System.EventHandler(this.RemoveFilter_Click);
                Modelhandlers handler = obj.handlers.Find(x => x.key == filter.Key);
                if (handler != null)
                {
                    obj.handlers.Remove(handler);
                }
                this.Filters.Controls.Remove(filter);
            }
        }
示例#5
0
        private void AddFilterControl(Modelhandlers handler)
        {
            filter      = new DUTools.Filter();
            filter.Size = new System.Drawing.Size(220, 40);

            filter.SignatureText = handler.filter.signature;
            filter.code          = handler.code;

            filter.Key                   = handler.key;
            filter.SlotKey               = handler.filter.slotKey;
            filter.SignatureMouseDown   += new MouseEventHandler(this.Signature_MouseDown);
            filter.CloseButtonClick     += new EventHandler(this.RemoveFilter_Click);
            filter.SignatureClick       += new EventHandler(this.FilterSignature_Click);
            filter.signatureButtonClick += new EventHandler(this.FilterSignatureButton_Click);
            this.Filters.Controls.Add(filter);
            filter.Select();
        }
示例#6
0
        private void AddFilter_Click(object sender, EventArgs e)
        {
            Modelhandlers newHandler = new Modelhandlers
            {
                code   = "",
                filter = new Modelfilter
                {
                    args      = new List <Modelargs>(),
                    signature = "Select Event",
                    slotKey   = CurrentSlot
                },
                key = NextKey().ToString()
            };

            obj.handlers.Add(newHandler);
            AddFilterControl(newHandler);
            fctb.Enabled = true;
        }
示例#7
0
        private void MnuUpdate_Click(object sender, EventArgs e)
        {
            Modelhandlers handler = obj.handlers.Find(h => h.key == filter.Key && h.filter.slotKey == filter.SlotKey);

            handler.filter.signature = filter.SignatureText = "update()";
        }