NClass.CSharp.CSharpField.GetDeclarationLine C# (CSharp) Method

GetDeclarationLine() public method

public GetDeclarationLine ( bool withSemicolon ) : string
withSemicolon bool
return string
		public string GetDeclarationLine(bool withSemicolon)
		{
			StringBuilder builder = new StringBuilder(50);

			if (AccessModifier != AccessModifier.Default) {
				builder.Append(Language.GetAccessString(AccessModifier, true));
				builder.Append(" ");
			}

			if (IsHider)
				builder.Append("new ");
			if (IsConstant)
				builder.Append("const ");
			if (IsStatic)
				builder.Append("static ");
			if (IsReadonly)
				builder.Append("readonly ");
			if (IsVolatile)
				builder.Append("volatile ");

			builder.AppendFormat("{0} {1}", Type, Name);
			if (HasInitialValue)
				builder.AppendFormat(" = {0}", InitialValue);

			if (withSemicolon)
				builder.Append(";");

			return builder.ToString();
		}