473,403 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Progress maximum value on XML serialisation

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

Thanks & Regards,
Mani

Jun 14 '07 #1
4 2840
On Jun 14, 11:09 am, Manikandan <plmanikan...@gmail.comwrote:
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.

Jun 14 '07 #2
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]
- mv*@spam.guard.caspershouse.com

<za***@construction-imaging.comwrote in message
news:11*********************@o11g2000prd.googlegro ups.com...
On Jun 14, 11:09 am, Manikandan <plmanikan...@gmail.comwrote:
>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.

Jun 14 '07 #3
On 14 Jun, 16:37, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
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]
- m...@spam.guard.caspershouse.com

<z...@construction-imaging.comwrote in message

news:11*********************@o11g2000prd.googlegro ups.com...
On Jun 14, 11:09 am, Manikandan <plmanikan...@gmail.comwrote:
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.
Hi,
How about showing a processing message in label using timer
Any idea of doing the processing text in label(procesing.....) with
timer

Thanks,
Mani
Jun 14 '07 #4
The timer really doesn't do anything for you here, as your stream facade
would fire events when there is a write to the underlying stream you are
serializing to. You would only use a timer when you have to poll for the
event, which a facade eliminates the need for.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Manikandan" <pl**********@gmail.comwrote in message
news:11**********************@i13g2000prf.googlegr oups.com...
On 14 Jun, 16:37, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
> 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]
- m...@spam.guard.caspershouse.com

<z...@construction-imaging.comwrote in message

news:11*********************@o11g2000prd.googlegr oups.com...
On Jun 14, 11:09 am, Manikandan <plmanikan...@gmail.comwrote:
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.

Hi,
How about showing a processing message in label using timer
Any idea of doing the processing text in label(procesing.....) with
timer

Thanks,
Mani


Jun 14 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sunny123 | last post by:
hello i am trying to find the maximum value of a function and where it occur. i.e there is an array x |y ============= | |
29
by: garyusenet | last post by:
I'm trying to investigate the maximum size of different variable types. I'm using INT as my starting variable for exploration. I know that the maximum number that the int variable can take is:...
3
by: Madmartigan | last post by:
Hello I have the following task but am battling with the final output. How do I keep two different vectors in sync and how would I retrieve the index for the maximum value of one of the vectors??...
2
by: Pugi! | last post by:
hi, I am using this code for checking wether a value (form input) is an integer and wether it is smaller than a given maximum and greater then a given minimum value: function...
6
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I'm using the VScrollBar and set it as follow: m_vScrollBar.Minimum = -19602; m_vScrollBar.Maximum = 0; m_vScrollBar.SmallChange = 1; m_vScrollBar.LargeChange = 1089; m_vScrollBar.Value =...
3
by: getmeidea | last post by:
Code: <script language="javascript"> function setMaximumValue(txtObj, maxVal){ var tempVal = parseFloat('' + txtObj.value) window.event.returnValue = (tempVal <= maxValue); } </script>...
2
choke
by: choke | last post by:
I need to write a function in devc++ that creates an array of n integers, each element is equal to n*n+i*i-n*i where i is from 0 to n-1 as the array index. Within the same function I need to find...
0
by: Fredrik Lundh | last post by:
maurizio wrote: What kind of file is it? Did you pick numpy because you want to do matrix operations (beyond just finding a maximum value), or was it just the first thing you stumbled upon...
1
by: maurizio | last post by:
thank you for your answer actually i've to do some statistics (maximum,minimum,mean,standard deviation,....) of a file of data in which each column is a particular type of data. (the file is a tab...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.