protected string GetValueString (XamlMember xm, object value)
{
// change XamlXmlReader too if we change here.
if ((value as string) == String.Empty) // FIXME: there could be some escape syntax.
return "\"\"";
var xt = value == null ? XamlLanguage.Null : sctx.GetXamlType (value.GetType ());
var vs = xm.ValueSerializer ?? xt.ValueSerializer;
if (vs != null)
return vs.ConverterInstance.ConvertToString (value, service_provider);
else
throw new XamlXmlWriterException (String.Format ("Value type is '{0}' but it must be either string or any type that is convertible to string indicated by TypeConverterAttribute.", value != null ? value.GetType () : null));
}
}