本文整理汇总了C#中FileFormatVersions类的典型用法代码示例。如果您正苦于以下问题:C# FileFormatVersions类的具体用法?C# FileFormatVersions怎么用?C# FileFormatVersions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FileFormatVersions类属于命名空间,在下文中一共展示了FileFormatVersions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SemanticValidator
public SemanticValidator(FileFormatVersions format, ApplicationType app)
{
FileFormat = format;
AppType = app;
_curReg = new SemanticConstraintRegistry(format, app);
}
示例2: SemanticConstraintRegistry
/// <summary>
/// Constructor
/// </summary>
public SemanticConstraintRegistry(FileFormatVersions format, ApplicationType appType)
{
_format = format;
_appType = appType;
Initialize();
}
示例3: SchemaValidator
/// <summary>
/// Initializes a new instance of the SchemaValidator.
/// </summary>
/// <param name="fileFormat">The target Open XML format.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown when the "fileFormat" parameter is not FileFormat.Office2007, FileFormat.Office2010 or FileFormat.O15.</exception>
internal SchemaValidator(FileFormatVersions fileFormat)
{
if (fileFormat == FileFormatVersions.Office2007)
{
this._sdbSchemaDatas = SdbSchemaDatas.GetOffice2007SchemaDatas();
}
else if(fileFormat == FileFormatVersions.Office2010)
{
this._sdbSchemaDatas = SdbSchemaDatas.GetOffice2010SchemaDatas();
}
else if (fileFormat == FileFormatVersions.Office2013)
{
this._sdbSchemaDatas = SdbSchemaDatas.GetOffice2013SchemaDatas();
}
else
{
string message = String.Format(System.Globalization.CultureInfo.CurrentUICulture,
ExceptionMessages.FileFormatNotSupported,
fileFormat);
throw new ArgumentOutOfRangeException("fileFormat", message);
}
this._schemaTypeValidator = new SchemaTypeValidator(this._sdbSchemaDatas);
#if DEBUG
this._fileFormat = fileFormat;
#endif
}
示例4: 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;
}
示例5: IsInVersion
/// <summary>
/// Whether this element is available in a specific version of Office Application.
/// </summary>
/// <param name="version">The Office file format version.</param>
/// <returns>Returns true if the element is defined in the specified version.</returns>
internal override bool IsInVersion(FileFormatVersions version)
{
if((7 & (int)version) > 0)
{
return true;
}
return false;
}
开发者ID:eriawan,项目名称:Open-XML-SDK,代码行数:13,代码来源:schemas_openxmlformats_org_drawingml_2006_wordprocessingDrawing.cs
示例6: AttributeConstraint
internal AttributeConstraint(XsdAttributeUse xsdAttributeUse, SimpleTypeRestriction simpleTypeConstraint, FileFormatVersions supportedVersion)
{
Debug.Assert(simpleTypeConstraint != null);
this.XsdAttributeUse = xsdAttributeUse;
this.SimpleTypeConstraint = simpleTypeConstraint;
this.SupportedVersion = supportedVersion;
}
示例7: RegisterConstraint
/// <summary>
/// Register a constraint to this registry.
/// </summary>
public void RegisterConstraint(int elementTypeID, int ancestorTypeID, FileFormatVersions fileFormat, ApplicationType appType, SemanticConstraint constraint )
{
if ((fileFormat & _format) == _format && (appType & _appType) == _appType)
{
AddConstraintToDic(constraint, ancestorTypeID, _cleanList);
AddConstraintToDic(constraint, elementTypeID, _semConstraintMap);
}
}
示例8: PartConstraintRule
/// <summary>
/// Initialize a instance of PartConstraintRule class.
/// </summary>
/// <param name="partClassName">The class name of the part.</param>
/// <param name="partContentType">The content type of the part.</param>
/// <param name="minOccursIsNonZero">The MinOccursIsNonZero data.</param>
/// <param name="maxOccursGreatThanOne">The MaxOccursGreatThanOne data.</param>
/// <param name="fileFormat">The file format version information.</param>
internal PartConstraintRule(string partClassName, string partContentType,
bool minOccursIsNonZero, bool maxOccursGreatThanOne,
FileFormatVersions fileFormat)
{
this.PartClassName = partClassName;
this.PartContentType = partContentType;
this.MinOccursIsNonZero = minOccursIsNonZero;
this.MaxOccursGreatThanOne = maxOccursGreatThanOne;
this.FileFormat = fileFormat;
}
示例9: CreateTargetValueObject
internal static OpenXmlSimpleType CreateTargetValueObject(RedirectedRestriction redirectedRestriction, FileFormatVersions fileFormatVersion)
{
switch (fileFormatVersion)
{
case FileFormatVersions.Office2007:
return O12UnionHelper.CreateTargetValueObject(redirectedRestriction);
case FileFormatVersions.Office2010:
return O14UnionHelper.CreateTargetValueObject(redirectedRestriction);
case FileFormatVersions.Office2013:
return O15UnionHelper.CreateTargetValueObject(redirectedRestriction);
default:
Debug.Assert(fileFormatVersion == FileFormatVersions.Office2007 || fileFormatVersion == FileFormatVersions.Office2010 || fileFormatVersion == FileFormatVersions.Office2013);
break;
}
return null;
}
示例10: CreatePossibleMembers
internal static OpenXmlSimpleType[] CreatePossibleMembers(UnionValueRestriction unionValueRestriction, FileFormatVersions fileFormatVersion)
{
switch (fileFormatVersion)
{
case FileFormatVersions.Office2007:
return O12UnionHelper.CreatePossibleMembers(unionValueRestriction);
case FileFormatVersions.Office2010:
return O14UnionHelper.CreatePossibleMembers(unionValueRestriction);
case FileFormatVersions.Office2013:
return O15UnionHelper.CreatePossibleMembers(unionValueRestriction);
default:
Debug.Assert(fileFormatVersion == FileFormatVersions.Office2007 || fileFormatVersion == FileFormatVersions.Office2010 || fileFormatVersion == FileFormatVersions.Office2013);
break;
}
return null;
}
示例11: 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);
}
示例12: TryCreateValidChild
/// <summary>
/// Trys to create an OpenXmlElement from the specified namesapce URI and local name.
/// </summary>
/// <param name="parent">The parent element.</param>
/// <param name="fileFormat">The specified file format version.</param>
/// <param name="namespaceUri">The namespace URI of the requested child element.</param>
/// <param name="localName">The local name of the requested child element.</param>
/// <returns>A new OpenXmlElement if the parent element can contains a child with the specified namespace and local name. Otherwise, returns null.</returns>
internal static OpenXmlElement TryCreateValidChild(this OpenXmlElement parent, FileFormatVersions fileFormat, string namespaceUri, string localName)
{
Debug.Assert(parent is OpenXmlCompositeElement);
Debug.Assert(localName != null);
var newElement = parent.ElementFactory(string.Empty, localName, namespaceUri);
if (newElement is OpenXmlUnknownElement || !newElement.IsInVersion(fileFormat))
{
return null;
}
return newElement;
}
示例13: IsInFileFormat
public static bool IsInFileFormat(string ns,FileFormatVersions format)
{
if (format == FileFormatVersions.Office2007)
{
if (_O12NamespaceSet.Contains(ns))
{
return true;
}
return false;
}
else if (format == FileFormatVersions.Office2010)
{
if (_O14NamespaceSet.Contains(ns))
{
return true;
}
return false;
}
else if (format == FileFormatVersions.Office2013)
{
if (_O15NamespaceSet.Contains(ns))
{
return true;
}
return false;
}
throw new NotImplementedException();
}
示例14: ChildElementInfoAttribute
/// <summary>
/// Initialize a new instance of ChildElementTypeAttribute.
/// </summary>
/// <param name="elementType">Specifies the type of the possible child element.</param>
public ChildElementInfoAttribute(Type elementType)
{
_type = elementType;
format = FileFormatVersions.Office2007 | FileFormatVersions.Office2010;
}
示例15: IsInVersion
/// <summary>
/// Whether this element is available in a specific version of Office Application.
/// For OpenXmlUnknownElement, always return false, no matter what the version is.
/// </summary>
/// <param name="version">The Office file format version.</param>
/// <returns>Returns true if the element is defined in the specified version.</returns>
internal override bool IsInVersion(FileFormatVersions version)
{
return false;
}