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


C# Shape.GetSpContainer方法代码示例

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


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

示例1: Find

    /**
     * Find hyperlink assigned to the supplied shape
     *
     * @param shape  <code>Shape</code> to lookup hyperlink in
     * @return found hyperlink or <code>null</code>
     */
    protected static Hyperlink Find(Shape shape){
        ArrayList lst = new ArrayList();
        SlideShow ppt = shape.Sheet.GetSlideShow();
        //document-level Container which stores info about all links in a presentation
        ExObjList exobj = ppt.GetDocumentRecord().GetExObjList();
        if (exobj == null) {
            return null;
        }

        EscherContainerRecord spContainer = shape.GetSpContainer();
        for (Iterator<EscherRecord> it = spContainer.GetChildIterator(); it.HasNext(); ) {
            EscherRecord obj = it.next();
            if (obj.GetRecordId() ==  EscherClientDataRecord.RECORD_ID){
                byte[] data = obj.Serialize();
                Record[] records = Record.FindChildRecords(data, 8, data.Length-8);
                if(records != null) Find(records, exobj, lst);
            }
        }

        return lst.Count == 1 ? (Hyperlink)lst.Get(0) : null;
    }
开发者ID:hanwangkun,项目名称:npoi,代码行数:27,代码来源:Hyperlink.cs

示例2: AddShape

    /**
     * Add a new Shape to this Slide
     *
     * @param shape - the Shape to add
     */
    public void AddShape(Shape shape) {
        PPDrawing ppdrawing = GetPPDrawing();

        EscherContainerRecord dgContainer = (EscherContainerRecord) ppdrawing.GetEscherRecords()[0];
        EscherContainerRecord spgr = (EscherContainerRecord) Shape.GetEscherChild(dgContainer, EscherContainerRecord.SPGR_CONTAINER);
        spgr.AddChildRecord(shape.GetSpContainer());

        shape.SetSheet(this);
        shape.SetShapeId(allocateShapeId());
        shape.afterInsert(this);
    }
开发者ID:ctddjyds,项目名称:npoi,代码行数:16,代码来源:Sheet.cs

示例3: RemoveShape

    /**
     * Removes the specified shape from this sheet.
     *
     * @param shape shape to be Removed from this sheet, if present.
     * @return <tt>true</tt> if the shape was deleted.
     */
    public bool RemoveShape(Shape shape) {
        PPDrawing ppdrawing = GetPPDrawing();

        EscherContainerRecord dg = (EscherContainerRecord) ppdrawing.GetEscherRecords()[0];
        EscherContainerRecord spgr = null;

        for (Iterator<EscherRecord> it = dg.GetChildIterator(); it.HasNext();) {
            EscherRecord rec = it.next();
            if (rec.GetRecordId() == EscherContainerRecord.SPGR_CONTAINER) {
                spgr = (EscherContainerRecord) rec;
                break;
            }
        }
        if(spgr == null) {
            return false;
        }

        List<EscherRecord> lst = spgr.GetChildRecords();
        bool result = lst.Remove(shape.GetSpContainer());
        spgr.SetChildRecords(lst);
        return result;
    }
开发者ID:ctddjyds,项目名称:npoi,代码行数:28,代码来源:Sheet.cs

示例4: AddShape

    /**
     * Add a shape to this group.
     *
     * @param shape - the Shape to add
     */
    public void AddShape(Shape shape){
        _escherContainer.AddChildRecord(shape.GetSpContainer());

        Sheet sheet = Sheet;
        shape.SetSheet(sheet);
        shape.SetShapeId(sheet.allocateShapeId());
        shape.afterInsert(sheet);
    }
开发者ID:ctddjyds,项目名称:npoi,代码行数:13,代码来源:ShapeGroup.cs


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