本文整理汇总了C#中FileFormatVersions类的典型用法代码示例。如果您正苦于以下问题:C# FileFormatVersions类的具体用法?C# FileFormatVersions怎么用?C# FileFormatVersions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileFormatVersions类属于命名空间,在下文中一共展示了FileFormatVersions类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SemanticValidator
public SemanticValidator(FileFormatVersions format, ApplicationType app)
{
FileFormat = format;
AppType = app;
_curReg = new SemanticConstraintRegistry(format, app);
}
开发者ID:eriawan,项目名称:Open-XML-SDK,代码行数:7,代码来源:SemanticValidator.cs
示例2: SemanticConstraintRegistry
/// <summary>
/// Constructor
/// </summary>
public SemanticConstraintRegistry(FileFormatVersions format, ApplicationType appType)
{
_format = format;
_appType = appType;
Initialize();
}
开发者ID:ErykJaroszewicz,项目名称:Open-XML-SDK,代码行数:10,代码来源:SemanticConstraintRegistry.cs
示例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
}
开发者ID:eriawan,项目名称:Open-XML-SDK,代码行数:32,代码来源:SchemaValidator.cs
示例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;
}
开发者ID:RicardoLo,项目名称:Open-XML-SDK,代码行数:12,代码来源:ValidationSettings.cs
示例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;
}
开发者ID:eriawan,项目名称:Open-XML-SDK,代码行数:8,代码来源:AttributeConstraint.cs
示例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);
}
}
开发者ID:ErykJaroszewicz,项目名称:Open-XML-SDK,代码行数:12,代码来源:SemanticConstraintRegistry.cs
示例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;
}
开发者ID:ErykJaroszewicz,项目名称:Open-XML-SDK,代码行数:18,代码来源:PartConstraintRule.cs
示例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;
}
开发者ID:eriawan,项目名称:Open-XML-SDK,代码行数:19,代码来源:UnionHelper.cs
示例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;
}
开发者ID:eriawan,项目名称:Open-XML-SDK,代码行数:19,代码来源:UnionHelper.cs
示例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);
}
开发者ID:ErykJaroszewicz,项目名称:Open-XML-SDK,代码行数:13,代码来源:OpenXmlValidator.cs
示例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;
}
开发者ID:ErykJaroszewicz,项目名称:Open-XML-SDK,代码行数:20,代码来源:ExtensionMethods.cs
示例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();
}
开发者ID:RicardoLo,项目名称:Open-XML-SDK,代码行数:28,代码来源:NamespaceIdMap.cs
示例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;
}
开发者ID:ErykJaroszewicz,项目名称:Open-XML-SDK,代码行数:9,代码来源:SchemaInfoAttribute.cs
示例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;
}
开发者ID:ErykJaroszewicz,项目名称:Open-XML-SDK,代码行数:10,代码来源:OpenXmlUnknownElement.cs
示例16: GetElementAction
internal ElementAction GetElementAction(OpenXmlElement element, FileFormatVersions format)
{
if (format == (FileFormatVersions.Office2010 | FileFormatVersions.Office2007) || format == (FileFormatVersions.Office2010 | FileFormatVersions.Office2007 | FileFormatVersions.Office2013))
{
return ElementAction.Normal;
}
if (element is AlternateContent)
{
return ElementAction.ACBlock;
}
if (element.IsInVersion(format))
{
return ElementAction.Normal;
}
if (IsIgnorableNs(element.NamespaceUri))
{
if (IsPreservedElement(element.NamespaceUri, element.LocalName))
{
return ElementAction.Normal;
}
if (IsProcessContent(element.NamespaceUri, element.LocalName))
{
return ElementAction.ProcessContent;
}
return ElementAction.Ignore;
}
return ElementAction.Normal;
}
开发者ID:eriawan,项目名称:Open-XML-SDK,代码行数:32,代码来源:AlternateContent.cs
示例17: Includes
/// <summary>
/// Determines whether the source FileFormatVersions includes the target FileFormatVersions.
/// </summary>
/// <param name="source">The source FileFormatVersions to be tested.</param>
/// <param name="target">The target FileFormatVersions be tested against.</param>
/// <returns>Returns true when (source & target) == target.</returns>
internal static bool Includes(this FileFormatVersions source, FileFormatVersions target)
{
return (source & target) == target;
}
开发者ID:eriawan,项目名称:Open-XML-SDK,代码行数:10,代码来源:ConformanceClasses.cs
示例18: GetNextChildMc
internal static OpenXmlElement GetNextChildMc(this OpenXmlElement parent, OpenXmlElement child, MCContext mcContext, FileFormatVersions format)
{
var next = child.GetNextNonMiscElementSibling();
var mcTier = child.Parent;
if (next == null && mcTier != parent)
{
// the child must be under element in ProcessContent or ACB
if (mcTier is AlternateContentChoice || mcTier is AlternateContentFallback)
{
mcTier = mcTier.Parent;
}
Debug.Assert(mcTier != null);
// there is no more next sibling in this level, then try to find the next siblig of the up level.
return parent.GetNextChildMc(mcTier, mcContext, format);
}
return parent.GetChildMc(next, mcContext, format);
}
开发者ID:eriawan,项目名称:Open-XML-SDK,代码行数:20,代码来源:AlternateContentValidator.cs
示例19: OfficeAvailabilityAttribute
/// <summary>
/// Initializes a new instance of the OfficeAvailabilityAttribute class.
/// </summary>
/// <param name="officeVersion">The Office version where this class or property is available.
/// If there is more than one version, use bitwise OR to specify multiple versions.</param>
public OfficeAvailabilityAttribute(FileFormatVersions officeVersion)
{
OfficeVersion = officeVersion;
}
开发者ID:eriawan,项目名称:Open-XML-SDK,代码行数:9,代码来源:ConformanceClasses.cs
示例20: IsInFileFormat
public static bool IsInFileFormat(string ns, FileFormatVersions format)
{
if (format == FileFormatVersions.Office2007)
{
if (NamespaceIdMap._O12NamespaceSet.Contains(ns))
return true;
else
return false;
}
else
{
if (format != FileFormatVersions.Office2010)
throw new NotImplementedException();
if (NamespaceIdMap._O14NamespaceSet.Contains(ns))
return true;
else
return false;
}
}
开发者ID:pauldbentley,项目名称:OpenXmlFactory,代码行数:19,代码来源:NamespaceIdMap.cs
注:本文中的FileFormatVersions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论