コード例 #1
0
		protected override void WritePropertyDeclaration(PropertyDefinition property)
		{
			MethodDefinition moreVisibleMethod = property.GetMethod.GetMoreVisibleMethod(property.SetMethod);
			if (property.IsIndexer())
			{
				WriteIndexerKeywords();
			}

			if (this.ModuleContext.RenamedMembers.Contains(property.MetadataToken.ToUInt32()))
			{
				WriteComment(property.Name);
				WriteLine();
			}

			if (!property.IsExplicitImplementation())
			{
				WriteMethodVisibilityAndSpace(moreVisibleMethod);
			}

			if (!(property.IsVirtual() && !property.IsNewSlot()))
			{
				bool isIndexerProperty = property.IsIndexer();

				if ((isIndexerProperty && IsIndexerPropertyHiding(property)) || (!isIndexerProperty && IsPropertyHiding(property)))
				{
					WriteKeyword(KeyWordWriter.Hiding);
					WriteSpace();
				}
			}

			if (property.IsVirtual() && !property.DeclaringType.IsInterface)
			{
				if (WritePropertyKeywords(property))
				{
					WriteSpace();
				}
			}

			//covers the case of properties with only one of the get/set methods in VB
			WriteReadOnlyWriteOnlyProperty(property);

			if (property.IsStatic())
			{
				WriteKeyword(KeyWordWriter.Static);
				WriteSpace();
			}

			if (KeyWordWriter.Property != null)
			{
				WriteKeyword(KeyWordWriter.Property);
				WriteSpace();
			}

			if (property.IsIndexer())
			{
				if (WritePropertyAsIndexer(property))
				{
					return;
				}
			}

			WritePropertyTypeAndNameWithArguments(property);

			WritePropertyInterfaceImplementations(property);
		}