This project is read-only.

Error by Edit Story, if Name is not in English. And if 2 different people's has same name

Sep 25, 2009 at 11:45 AM
Edited Sep 28, 2009 at 10:18 PM

Hi,

i found error in

1:

Private Shared Sub ExtractPart(ByVal packagePart As PackagePart, ByVal targetDirectory As String)
      ' Remove leading slash from the Part Uri, and make a new Uri from the result

      ' If URI is "Alex%20XXX.rtf"  file is not found, or if file name is not in english is same error

       ' Original ->Dim stringPart As String = packagePart.Uri.ToString().TrimStart("/"c)
      Dim stringPart As String = Uri.UnescapeDataString(packagePart.Uri.ToString()).TrimStart("/"c) '  <- This return correct file name "Alex XXX.rtf"

 

Same error is in last C# sourcecode

           // Original with error ->string stringPart = packagePart.Uri.ToString().TrimStart('/');
            string stringPart = Uri.UnescapeDataString( packagePart.Uri.ToString()).TrimStart('/');

 

2:

If 2 different people's has same name

Private Sub SaveStoryButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
      Dim person As Person = CType(Me.DataContext, Person)

      If person IsNot Nothing Then
        ' Pass in a TextRange object to save the story     
        Dim textRange As New TextRange(StoryRichTextBox.Document.ContentStart, StoryRichTextBox.Document.ContentEnd)
        person.Story = New Story()
        ' ORIGINAL ->Dim storyFileName As String = New StringBuilder(person.Name).Append(".rtf").ToString() <- you write data from 2 people's in 1 file.
        Dim storyFileName As String = New StringBuilder(person.Id).Append(".rtf").ToString()

Sorry for my english :)