当前位置: 首页>>代码示例>>C#>>正文


C# OPCPackage.GetRelationshipsByType方法代码示例

本文整理汇总了C#中NPOI.OpenXml4Net.OPC.OPCPackage.GetRelationshipsByType方法的典型用法代码示例。如果您正苦于以下问题:C# OPCPackage.GetRelationshipsByType方法的具体用法?C# OPCPackage.GetRelationshipsByType怎么用?C# OPCPackage.GetRelationshipsByType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NPOI.OpenXml4Net.OPC.OPCPackage的用法示例。


在下文中一共展示了OPCPackage.GetRelationshipsByType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: POIXMLDocumentPart

        /**
         * Construct POIXMLDocumentPart representing a "core document" namespace part.
         */
        public POIXMLDocumentPart(OPCPackage pkg)
        {
            PackageRelationship coreRel = pkg.GetRelationshipsByType(PackageRelationshipTypes.CORE_DOCUMENT).GetRelationship(0);

            this.packagePart = pkg.GetPart(coreRel);
            this.packageRel = coreRel;
        }
开发者ID:89sos98,项目名称:npoi,代码行数:10,代码来源:POIXMLDocumentPart.cs

示例2: POIXMLDocumentPart

 /**
  * Construct POIXMLDocumentPart representing a "core document" namespace part.
  */
 public POIXMLDocumentPart(OPCPackage pkg)
 {
     PackageRelationship coreRel = pkg.GetRelationshipsByType(PackageRelationshipTypes.CORE_DOCUMENT).GetRelationship(0);
     if (coreRel == null)
     {
         coreRel = pkg.GetRelationshipsByType(PackageRelationshipTypes.STRICT_CORE_DOCUMENT).GetRelationship(0);
         if (coreRel != null)
         {
             throw new POIXMLException("Strict OOXML isn't currently supported, please see bug #57699");
         }
     }
     if (coreRel == null)
     {
         throw new POIXMLException("OOXML file structure broken/invalid - no core document found!");
     }
     this.packagePart = pkg.GetPart(coreRel);
     this.packageRel = coreRel;
 }
开发者ID:Reinakumiko,项目名称:npoi,代码行数:21,代码来源:POIXMLDocumentPart.cs

示例3: POIXMLProperties

        public POIXMLProperties(OPCPackage docPackage)
        {
            this.pkg = docPackage;

            // Core properties
            core = new CoreProperties((PackagePropertiesPart)pkg.GetPackageProperties());

            // Extended properties
            PackageRelationshipCollection extRel =
                pkg.GetRelationshipsByType(PackageRelationshipTypes.EXTENDED_PROPERTIES);
            if (extRel.Size == 1)
            {
                extPart = pkg.GetPart(extRel.GetRelationship(0));
                ExtendedPropertiesDocument props = ExtendedPropertiesDocument.Parse(
                     extPart.GetInputStream()
                );
                ext = new ExtendedProperties(props);
            }
            else
            {
                extPart = null;
                ext = new ExtendedProperties((ExtendedPropertiesDocument)NEW_EXT_INSTANCE.Copy());
            }

            // Custom properties
            PackageRelationshipCollection custRel =
                pkg.GetRelationshipsByType(PackageRelationshipTypes.CUSTOM_PROPERTIES);
            if (custRel.Size == 1)
            {
                custPart = pkg.GetPart(custRel.GetRelationship(0));
                CustomPropertiesDocument props = CustomPropertiesDocument.Parse(
                        custPart.GetInputStream()
                );
                cust = new CustomProperties(props);
            }
            else
            {
                custPart = null;
                cust = new CustomProperties((CustomPropertiesDocument)NEW_CUST_INSTANCE.Copy());
            }
        }
开发者ID:xoposhiy,项目名称:npoi,代码行数:41,代码来源:POIXMLProperties.cs


注:本文中的NPOI.OpenXml4Net.OPC.OPCPackage.GetRelationshipsByType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。