本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}