NArrange.VisualBasic.VBParser.ParseProperty C# (CSharp) Method

ParseProperty() private method

Parses a property.
private ParseProperty ( CodeAccess access, MemberModifiers memberAttributes, bool isDefault, string modifyAccess, bool inInterface ) : PropertyElement
access CodeAccess The access.
memberAttributes MemberModifiers The member attributes.
isDefault bool Whether or not the property is a default property
modifyAccess string The modify access.
inInterface bool Whether or not the property is part of an interface.
return NArrange.Core.CodeElements.PropertyElement
        private PropertyElement ParseProperty(
			CodeAccess access,
			MemberModifiers memberAttributes,
			bool isDefault,
			string modifyAccess,
			bool inInterface)
        {
            PropertyElement property = new PropertyElement();
            property.Name = CaptureWord();
            property.Access = access;
            property.MemberModifiers = memberAttributes;
            property[VBExtendedProperties.Default] = isDefault;
            property[VBExtendedProperties.AccessModifier] = modifyAccess;

            EatLineContinuation();

            if (NextChar == VBSymbol.BeginParameterList)
            {
                string indexParam = this.ParseParams();
                if (indexParam.Length > 0)
                {
                    property.IndexParameter = indexParam;
                }
            }

            EatWord(VBKeyword.As, "Expected As");

            string type = CaptureTypeName();
            if (string.IsNullOrEmpty(type))
            {
                this.OnParseError("Expected return type");
            }

            property.Type = type;

            string[] implements;
            string blockTemp = TryParseImplements(out implements);
            foreach (string implementation in implements)
            {
                InterfaceReference interfaceReference =
                    new InterfaceReference(implementation, InterfaceReferenceType.Interface);
                property.AddImplementation(interfaceReference);
            }

            if ((memberAttributes & MemberModifiers.Abstract) != MemberModifiers.Abstract &&
                !inInterface)
            {
                property.BodyText = (blockTemp + this.ParseBlock(VBKeyword.Property)).Trim();
            }

            return property;
        }