System.Windows.Media.Color.IFormattable C# (CSharp) Method

IFormattable() private method

private IFormattable ( string value, IFormatProvider formatProvider ) : string
value string
formatProvider IFormatProvider
return string
		string IFormattable.ToString (string value, IFormatProvider formatProvider)
		{
			if (value == null)
				return ToString (formatProvider);

			if (formatProvider != null) {
				ICustomFormatter cp = (ICustomFormatter) formatProvider.GetFormat (typeof (ICustomFormatter));
				if (cp != null) {
					return String.Format ("sc#{0}{1} {2}{3} {4}{5} {6}", 
						cp.Format (value, A, formatProvider), cp.Format (value, ',', formatProvider),
						cp.Format (value, R, formatProvider), cp.Format (value, ',', formatProvider),
						cp.Format (value, G, formatProvider), cp.Format (value, ',', formatProvider),
						cp.Format (value, B, formatProvider));
				}
			}

			return String.Format ("sc#{0}{1} {2}{3} {4}{5} {6}", 
				A.ToString (value, formatProvider), ','.ToString (formatProvider),
				R.ToString (value, formatProvider), ','.ToString (formatProvider),
				G.ToString (value, formatProvider), ','.ToString (formatProvider),
				B.ToString (value, formatProvider));
		}