示例#1
0
        private void UpdateModifierToken()
        {
            IEnumerator enumerator = this.ModifersQueue.GetEnumerator();

            while (enumerator.MoveNext())
            {
                this.ModifierToken += ReplaceManager.HandleModifiers((string)enumerator.Current + " ");
            }
        }
示例#2
0
        private void BuildPropertyDeclaration(string tcLine)
        {
            tcLine = ReplaceManager.GetSingledSpacedString(tcLine).Trim();
            if (tcLine.EndsWith(")"))
            {
                int length = tcLine.IndexOf("(");
                this.PropertyParameterToken = base.ExtractBlock(tcLine, "(", ")");
                FieldManager fieldManager = new FieldManager();
                this.PropertyParameterToken = "(" + fieldManager.GetConvertedExpression(this.PropertyParameterToken) + ") ";
                this.PropertyParameterToken = this.PropertyParameterToken.Replace("Dim ", "");
                tcLine = tcLine.Substring(0, length).Trim();
            }
            int num = tcLine.LastIndexOf(" ");

            this.PropertyNameToken = tcLine.Substring(num + 1);
            string text = tcLine.Substring(0, num).Trim();

            text = ReplaceManager.HandleModifiers(text);
            text = text.Trim();
            num  = text.LastIndexOf(" ");
            this.ReturnValueToken = "As " + text.Substring(num).Trim();
            text = text.Substring(0, num);
            this.PropertyModifiersToken = text;
        }
示例#3
0
        private void BuildMethodDeclaration(string tcLine)
        {
            int num = tcLine.IndexOf(":");

            if (num > 0)
            {
                this.MethodParentToken = tcLine.Substring(num + 1);
                tcLine = tcLine.Substring(0, num);
            }
            tcLine = ReplaceManager.GetSingledSpacedString(tcLine).Trim();
            int    num2     = 0;
            int    num3     = 0;
            string tcString = "";
            string text     = tcLine;
            int    num4     = tcLine.Length;

            while (0 < num4)
            {
                int num5 = num4 - 1;
                if (tcLine[num5] == ')')
                {
                    num3++;
                }
                if (tcLine[num5] == '(')
                {
                    num2++;
                }
                if (num2 != 0 && num3 != 0 && num2 - num3 == 0)
                {
                    text     = tcLine.Substring(0, num5);
                    tcString = tcLine.Substring(num5).Trim();
                    break;
                }
                num4--;
            }
            this.ParameterToken = this.GetParameters(tcString);
            text = ReplaceManager.GetSingledSpacedString(text);
            string[] array = text.Split(new char[]
            {
                ' '
            });
            if (array.Length == 2)
            {
                text = "private " + text;
            }
            if (text.IndexOf("void ") >= 0)
            {
                this.MethodType = "Sub";
            }
            text = " " + text.Trim() + " ";
            text = ReplaceManager.HandleModifiers(text);
            text = text.Trim();
            int num6 = text.LastIndexOf(" ");

            this.MethodNameToken = text.Substring(num6).Trim();
            text = text.Substring(0, num6);
            if (this.MethodType != "Sub")
            {
                num6 = text.LastIndexOf(" ");
                if (num6 >= 0)
                {
                    this.ReturnValueToken = " As " + text.Substring(num6).Trim();
                    text = text.Substring(0, num6);
                }
            }
            if (num6 > 0)
            {
                this.MethodModifiersToken = text.Substring(0, num6) + " ";
            }
        }