Beispiel #1
0
        private void EvaluateRegex(object text)
        {
            try
            {
                try
                {
                    Regex regex = CurrentVariable.CreateRegex();
                    if (regex == null)
                    {
                        return;
                    }

                    Match match = regex.Match(text as string);

                    this.BeginInvoke((MethodInvoker) delegate
                    {
                        txtRegularExpression.HintText = string.Empty;
                        RefreshRtfFormatting(match);

                        if (match.Success && this.gotoMatch)
                        {
                            this.gotoMatch = false;
                            GoToMatch();
                        }
                    });
                }
                catch (UriFormatException ex)
                {
                    this.BeginInvoke((MethodInvoker) delegate
                    {
                        MessageBox.Show(this, "The regular expression cannot be evaluated: " + ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    });
                }
                catch (ThreadAbortException)
                {
                    /* Thread aborted, no error */
                }
                finally
                {
                    this.BeginInvoke((MethodInvoker) delegate
                    {
                        txtRegularExpression.HintText = string.Empty;
                    });
                }
            }
            catch (InvalidOperationException)
            {
                /* Ignore error if form is closed */
            }
        }
Beispiel #2
0
        public Dictionary <String, String> GetRefStateDictRecursive()
        {
            Dictionary <String, String> Result = new Dictionary <String, String>();
            EXEScope CurrentScope = this;

            while (CurrentScope != null)
            {
                foreach (EXEReferencingVariable CurrentVariable in CurrentScope.ReferencingVariables)
                {
                    Result[CurrentVariable.Name] = CurrentVariable.ClassName;
                }
                foreach (EXEReferencingSetVariable CurrentVariable in CurrentScope.SetReferencingVariables)
                {
                    Result[CurrentVariable.Name + "[" + CurrentVariable.ValidVariableCount() + "]"] = CurrentVariable.ClassName;
                }

                CurrentScope = CurrentScope.SuperScope;
            }

            return(Result);
        }