本文整理汇总了C#中FileFormatVersions.ThrowExceptionIfFileFormatNotSupported方法的典型用法代码示例。如果您正苦于以下问题:C# FileFormatVersions.ThrowExceptionIfFileFormatNotSupported方法的具体用法?C# FileFormatVersions.ThrowExceptionIfFileFormatNotSupported怎么用?C# FileFormatVersions.ThrowExceptionIfFileFormatNotSupported使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileFormatVersions
的用法示例。
在下文中一共展示了FileFormatVersions.ThrowExceptionIfFileFormatNotSupported方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidationSettings
/// <summary>
/// Initializes a new instance of the ValidationSettings.
/// </summary>
/// <param name="fileFormat">The target file format.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown when the "fileFormat" parameter is not FileFormat.Office2007, or FileFormat.Office2010 or FileFormat.Office2013.</exception>
internal ValidationSettings(FileFormatVersions fileFormat)
{
fileFormat.ThrowExceptionIfFileFormatNotSupported("fileFormat");
this.FileFormat = fileFormat;
this.MaxNumberOfErrors = _defaultMaxNumberOfErrorsReturned;
}
示例2: OpenXmlValidator
/// <summary>
/// Initializes a new instance of the OpenXmlValidator.
/// </summary>
/// <param name="fileFormat">The target filr format to be validated aginst.</param>
/// <remarks>
/// Default to FileFormat.Office2007.
/// </remarks>
/// <exception cref="ArgumentOutOfRangeException">Thrown when the "fileFormat" parameter is not FileFormat.Office2007, FileFormat.Office2010 or FileFormat.O15.</exception>
public OpenXmlValidator(FileFormatVersions fileFormat)
{
fileFormat.ThrowExceptionIfFileFormatNotSupported("fileFormat");
this._settings = new ValidationSettings(fileFormat);
}