Castle.MonoRail.Framework.Helpers.FormHelper.FormatIfNecessary C# (CSharp) 메소드

FormatIfNecessary() 보호된 정적인 메소드

Formats if necessary.
protected static FormatIfNecessary ( object value, IDictionary attributes ) : string
value object The value.
attributes IDictionary The attributes.
리턴 string
		protected static string FormatIfNecessary(object value, IDictionary attributes)
		{
			string formatString = CommonUtils.ObtainEntryAndRemove(attributes, "textformat");

			if (value != null && formatString != null)
			{
				IFormattable formattable = value as IFormattable;

				if (formattable != null)
				{
					value = formattable.ToString(formatString, null);
				}
			}
			else if (value == null)
			{
				value = String.Empty;
			}

			return value.ToString();
		}