Ejemplo n.º 1
0
        private void textArea_TextChangedDelayed(object sender, TextChangedEventArgs e)
        {
            WorkerObject worker = new WorkerObject
            {
                Editor        = DashGlobal.EditorHelper.ActiveEditor,
                UserVariables = new List <UserVariable>()
            };

            if (!loadUserVarsBw.IsBusy)
            {
                loadUserVarsBw.RunWorkerAsync(worker);
            }
        }
Ejemplo n.º 2
0
        private void rebuildArmaSenseCacheToolStripMenuItem_Click(object sender, EventArgs e)
        {
            WorkerObject worker = new WorkerObject
            {
                Editor        = DashGlobal.EditorHelper.ActiveEditor,
                UserVariables = DashGlobal.EditorHelper.UserVariablesCurrentFile,
                ForceUpdate   = true
            };

            if (!loadUserVarsBw.IsBusy)
            {
                loadUserVarsBw.RunWorkerAsync(worker);
            }
            //EditorHelper.BuildAutocompleteMenu(ArmaSense, true);
        }
Ejemplo n.º 3
0
        private void textArea_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.OemSemicolon)
            {
                WorkerObject worker = new WorkerObject
                {
                    Editor        = DashGlobal.EditorHelper.ActiveEditor,
                    UserVariables = new List <UserVariable>(),
                    ForceUpdate   = true
                };

                if (!loadUserVarsBw.IsBusy)
                {
                    loadUserVarsBw.RunWorkerAsync(worker);
                }
                //EditorHelper.BuildAutocompleteMenu(ArmaSense, true);
            }
        }
Ejemplo n.º 4
0
        private void loadUserVarsBw_DoWork(object sender, DoWorkEventArgs e)
        {
            WorkerObject workerObject = e.Argument as WorkerObject;

            // Build user variables in current file

            if (workerObject != null)
            {
                var lines = workerObject.Editor.Lines;
                workerObject.UserVariables.Clear();

                foreach (var line in lines)
                {
                    // Loop through each occurange of string to left of "=" -> won't work if multiple variables are declared on one line
                    var parts = line.Split('=');
                    if (parts.Length > 1)
                    {
                        var variable     = parts[0].Trim();
                        var tooltipParts = parts[1].Split(';');
                        var tooltip      = tooltipParts[0].Trim();

                        var varType = DashGlobal.EditorHelper.GetVarTypeFromString(tooltip);

                        workerObject.UserVariables.Add(new UserVariable {
                            VarName = variable, TooltipTitle = varType, TooltipText = tooltip
                        });
                    }

                    // Attempt using regex -> regex times out if lines are longer than 20 chars
                    //foreach (Match m in Regex.Matches(cleanLine, "(\\w+.)+="))
                    //{
                    //    var parts = m.Value.Split('=');
                    //    var variable = parts[0].Trim();
                    //    workerObject.UserVariables.Add(variable);
                    //}
                }

                e.Result = workerObject;
            }
        }
Ejemplo n.º 5
0
        private void textArea_TextChangedDelayed(object sender, TextChangedEventArgs e)
        {
            WorkerObject worker = new WorkerObject
            {
                Editor = DashGlobal.EditorHelper.ActiveEditor,
                UserVariables = new List<UserVariable>()
            };

            if (!loadUserVarsBw.IsBusy)
            {
                loadUserVarsBw.RunWorkerAsync(worker);
            }
        }
Ejemplo n.º 6
0
        private void textArea_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.OemSemicolon)
            {
                WorkerObject worker = new WorkerObject
                {
                    Editor = DashGlobal.EditorHelper.ActiveEditor,
                    UserVariables = new List<UserVariable>(),
                    ForceUpdate = true
                };

                if (!loadUserVarsBw.IsBusy)
                {
                    loadUserVarsBw.RunWorkerAsync(worker);
                }
                //EditorHelper.BuildAutocompleteMenu(ArmaSense, true);
            }
        }
Ejemplo n.º 7
0
        private void rebuildArmaSenseCacheToolStripMenuItem_Click(object sender, EventArgs e)
        {
            WorkerObject worker = new WorkerObject
            {
                Editor = DashGlobal.EditorHelper.ActiveEditor,
                UserVariables = DashGlobal.EditorHelper.UserVariablesCurrentFile,
                ForceUpdate = true
            };

            if (!loadUserVarsBw.IsBusy)
            {
                loadUserVarsBw.RunWorkerAsync(worker);
            }
            //EditorHelper.BuildAutocompleteMenu(ArmaSense, true);
        }