NArrange.VisualBasic.VBParser.ParseProperty C# (CSharp) 메소드

ParseProperty() 개인적인 메소드

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.
리턴 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;
        }