internal FileFormat GetDefaultFormat(object ob) { if (defaultFormat.CanWrite(ob)) { return(defaultFormat); } FileFormat[] formats = FileFormats.GetFileFormatsForObject(ob); if (formats.Length == 0) { throw new InvalidOperationException("Can't handle objects of type '" + ob.GetType() + "'"); } return(formats [0]); }