FlatRedBall.Glue.Parsing.ParsedMethod.FillHeaderInformation C# (CSharp) Method

FillHeaderInformation() private method

private FillHeaderInformation ( string headerLine ) : void
headerLine string
return void
        internal void FillHeaderInformation(string headerLine)
        {
            Scope scope;
            ParsedType type;
            string variableName;
            bool isConst; // will always be false for properties
            string valueToAssignTo;
            bool isVirtual;
            bool isOverride;
            bool isStatic;
            bool isNew;
            bool isAsync;

            GetLineInformation(headerLine, out scope, out type, out variableName, out isConst, out isVirtual,
                out isOverride, out isStatic, out isNew, out isAsync, out valueToAssignTo);

            Scope = scope;
            Type = type;
            Name = variableName;
            IsStatic = isStatic;

            // Unqualify the type
            type.Unqualify();


        }

Usage Example

示例#1
0
        private void CreateParsedMethod(int startIndex, int endIndex, bool trimContents)
        {
            // For now we'll assume that all properties are on
            // the same line.  Eventually we may want to combine
            // all lines before the opening bracket


            // todo: add attributes:
            CurrentAttributes.Clear();


            #region Get header information

            int lineIndexForHeader = 0;

            string headerLine = mCurrentBlock[lineIndexForHeader].Trim();

            int numberOfParens = mCurrentBlock[lineIndexForHeader].CountOf('(') - mCurrentBlock[lineIndexForHeader].CountOf(')');


            while (numberOfParens > 0)
            {
                lineIndexForHeader++;
                headerLine += " " + mCurrentBlock[lineIndexForHeader].Trim();

                numberOfParens += mCurrentBlock[lineIndexForHeader].CountOf('(') - mCurrentBlock[lineIndexForHeader].CountOf(')');
            }

            ParsedMethod parsedMethod = new ParsedMethod();

            parsedMethod.FillHeaderInformation(headerLine);

            #endregion

            parsedMethod.StartIndex = startIndex;
            parsedMethod.EndIndex   = endIndex;

            parsedMethod.FillArgumentList(parsedMethod, mCurrentBlock, 0, true);

            // Fill generic restrictions after getting all arguments
            parsedMethod.FillGenericRestrictions(headerLine);

            parsedMethod.FillBaseCall(mCurrentBlock);

            StringBuilder methodContents = new StringBuilder();

            bool hasGetter;
            bool hasSetter;

            bool hasAutomaticGetter;
            bool hasAutomaticSetter;

            FillGettersAndSetters(methodContents, methodContents, false, trimContents, out hasGetter, out hasSetter, out hasAutomaticGetter, out hasAutomaticSetter);

            parsedMethod.MethodContents = methodContents.ToString();
            parsedMethod.StoreOffOldName();

            mParsedMethods.Add(parsedMethod);
        }
All Usage Examples Of FlatRedBall.Glue.Parsing.ParsedMethod::FillHeaderInformation