Re: Progress maximum value on XML serialisation



Well, it would be kind of possible, but you would have to guess, at
best.

You can create a facade for the Stream that is being written to, passing
that to the XmlSerializer, which delegates calls to an underlying stream.
The facade would convey how many bytes were written to the underlying stream
through events, or some other mechanism.

However, it becomes moot, because you ultimately don't know the size of
the serialized instance until it is done. You could make a guess, but in
the end, that's all it is.

The best you can do is tell how many bytes were currently written.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

<zacks@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1181834565.361981.71550@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 14, 11:09 am, Manikandan <plmanikan...@xxxxxxxxx> wrote:
Hi,
I'm working with XML serialization.
I'm writing a xml file of huge size(above 500MB)
I need to show the user the progress of writing to file using progress
bar.
For this i need to create a thread and first start the thread and then
writing process, after writing to file stop the thread
My doubt is how to set the value for progress bar, some times file
size is 100MB and some other time 2GB like, I don't know how to set
the progress bar maximum value
Kindly help me to solve problem

Since the writing of an XML file with the XMLSerialization Serialize
method, I doubt if you could implement a progress bar showing the
progress of writing the file.



.



Relevant Pages

  • Re: Progress maximum value on XML serialisation
    ... which delegates calls to an underlying stream. ... The facade would convey how many bytes were written to the underlying stream ... I need to show the user the progress of writing to file using progress ... My doubt is how to set the value for progress bar, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Progress maximum value on XML serialisation
    ... The timer really doesn't do anything for you here, as your stream facade ... My doubt is how to set the value for progress bar, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: BinaryWriter (or streams) slow performance
    ... Who says you're the only one writing to that stream? ... The stream has the Position right. ... and then seeking back up to fill in the block size which it ... writer buffer, it could seek back to it, modify it in memory, and there's ...
    (microsoft.public.dotnet.framework.performance)
  • Re: Binary serialization
    ... DATA members from the class in question the method of writing each ... the base class where you collect the data in to a byte array which is ... then written to the stream by the base class. ...
    (microsoft.public.dotnet.general)
  • Re: Detailed info for COM based "Web Browser" control in VS.NET 2003
    ... from the stream. ... 'update the progress bar in response to ProgressChange, ... 'in response to DownloadComplete. ... 'Loop While hDoc Is Nothing ...
    (microsoft.public.dotnet.framework)