Hi,
I programmed a custom annotation insertion and, I have an issue when custom annotation's prefix are exported. Here is the fragment of code to make the custom annotation:
Here is the code to put the annotation in the document :
So, when I save the document under a .XAML format, the section with the custom annotation does not save the TypeCase value but put the prefix and, the BookFormat prefix is not there at all. On the other hand, the Name prefix is with the good value. Here is a sample fragment :
<t:Section PageMargin="96,96,96,96" PageSize="816,1056">
<t:Paragraph LineSpacing="1" StyleName="Normal">
<custom1:NovoBookMarkRangeStart AnnotationID="1" Name="5" TypeCase="0" />
<t:Span Text="{}{Patient.PostalCode}" />
<custom1:NovoBookMarkRangeEnd AnnotationID="1" />
</t:Paragraph>
</t:Section>
So, can you find why the BookFormat prefix and value are not present and, why the the TypeCase value is the wrong one?
Thank a lot,
Patrick
I programmed a custom annotation insertion and, I have an issue when custom annotation's prefix are exported. Here is the fragment of code to make the custom annotation:
Public Class NovoBookMarkRangeStart Inherits FieldRangeStartBase Private m_Name As String Private m_TypeCase As Integer Private m_BookFormat As String <XamlSerializable()> _ Public Property BookFormat As String Get Return m_BookFormat End Get Set(value As String) m_BookFormat = value End Set End Property <XamlSerializable()> _ Public Property Name() As String Get Return m_Name End Get Set(value As String) m_Name = value End Set End Property <XamlSerializable()> _ Public Property TypeCase() As Integer Get Return m_TypeCase End Get Set(value As Integer) m_TypeCase = value End Set End Property Public Sub New() End Sub Public Sub New(name As String, TypeCase As Integer, Bookformat As String) Me.TypeCase = TypeCase Me.Name = name Me.BookFormat = Bookformat End SubHere is the code to put the annotation in the document :
Private Sub Wpf_NewBookMark(ID As Integer, TypeCase As Integer, BookFormat As String) Handles Wpf.NewBookMark Dim StartRange As New NovoBookMarkRangeStart(ID.ToString, TypeCase, BookFormat) Dim EndRange As New NovoBookMarkRangeEnd() 'Caret Position Dim S As New DocumentPosition(Me.editor.Document.CaretPosition) Dim E As New DocumentPosition(Me.editor.Document) EndRange.PairWithStart(StartRange) 'Custom Span Dim BookMarkSpan As New Span("{" & Id.ToString() & "}") S.AnchorToCurrentBoxIndex() editor.InsertInline(StartRange) editor.InsertInline(BookMarkSpan) editor.InsertInline(EndRange) S.RestorePositionFromBoxIndex() editor.UpdateEditorLayout() End SubSo, when I save the document under a .XAML format, the section with the custom annotation does not save the TypeCase value but put the prefix and, the BookFormat prefix is not there at all. On the other hand, the Name prefix is with the good value. Here is a sample fragment :
<t:Section PageMargin="96,96,96,96" PageSize="816,1056">
<t:Paragraph LineSpacing="1" StyleName="Normal">
<custom1:NovoBookMarkRangeStart AnnotationID="1" Name="5" TypeCase="0" />
<t:Span Text="{}{Patient.PostalCode}" />
<custom1:NovoBookMarkRangeEnd AnnotationID="1" />
</t:Paragraph>
</t:Section>
So, can you find why the BookFormat prefix and value are not present and, why the the TypeCase value is the wrong one?
Thank a lot,
Patrick