protected void UpdateClientData() { if (_clientData != null && _clientRecords != null) { MemoryStream out1 = new MemoryStream(); try { for (int i = 0; i < _clientRecords.Length; i++) { _clientRecords[i].WriteOut(out1); } } catch (Exception e) { throw new HSLFException(e); } _clientData.SetRemainingData(out1.ToArray()); } }
public void SetHyperlink(Hyperlink link) { if (link.GetId() == -1) { throw new HSLFException("You must call SlideShow.AddHyperlink(Hyperlink link) first"); } EscherClientDataRecord cldata = new EscherClientDataRecord(); cldata.SetOptions((short)0xF); GetSpContainer().AddChildRecord(cldata); // TODO - junit to prove GetChildRecords().add is wrong InteractiveInfo info = new InteractiveInfo(); InteractiveInfoAtom infoAtom = info.GetInteractiveInfoAtom(); switch (link.GetType()) { case Hyperlink.LINK_FIRSTSLIDE: infoAtom.SetAction(InteractiveInfoAtom.ACTION_JUMP); infoAtom.SetJump(InteractiveInfoAtom.JUMP_FIRSTSLIDE); infoAtom.SetHyperlinkType(InteractiveInfoAtom.LINK_FirstSlide); break; case Hyperlink.LINK_LASTSLIDE: infoAtom.SetAction(InteractiveInfoAtom.ACTION_JUMP); infoAtom.SetJump(InteractiveInfoAtom.JUMP_LASTSLIDE); infoAtom.SetHyperlinkType(InteractiveInfoAtom.LINK_LastSlide); break; case Hyperlink.LINK_NEXTSLIDE: infoAtom.SetAction(InteractiveInfoAtom.ACTION_JUMP); infoAtom.SetJump(InteractiveInfoAtom.JUMP_NEXTSLIDE); infoAtom.SetHyperlinkType(InteractiveInfoAtom.LINK_NextSlide); break; case Hyperlink.LINK_PREVIOUSSLIDE: infoAtom.SetAction(InteractiveInfoAtom.ACTION_JUMP); infoAtom.SetJump(InteractiveInfoAtom.JUMP_PREVIOUSSLIDE); infoAtom.SetHyperlinkType(InteractiveInfoAtom.LINK_PreviousSlide); break; case Hyperlink.LINK_URL: infoAtom.SetAction(InteractiveInfoAtom.ACTION_HYPERLINK); infoAtom.SetJump(InteractiveInfoAtom.JUMP_NONE); infoAtom.SetHyperlinkType(InteractiveInfoAtom.LINK_Url); break; } infoAtom.SetHyperlinkID(link.GetId()); MemoryStream out1 = new MemoryStream(); try { info.WriteOut(out1); } catch (Exception e) { throw new HSLFException(e); } cldata.SetRemainingData(out1.ToArray()); }