|
I'm sorry, I misunderstand what you wanted. I though you had extraneous elements (e.g. items without a matching property in your C# class) that you wanted to skip.
You could derive your own class from XmlTextReader[^]and override the Read[^] method. But that would get messy because you have to take into account elements that only have sub-elements.
The easiest way is to probably define another property that you use for serialization like so:
private Int32 myInt = 0;
[XmlIgnore]
public Int32 MyInt {
get {
return this.myInt;
}
set {
this.myInt = value;
}
}
[XmlElement("MyInt")]
public String MyIntSerialize {
get {
return this.MyInt.ToString();
}
set {
Int32 newValue = 42;
if (!String.IsNullOrEmpty(value))
newValue = Int32.Parse(value);
this.myInt = newValue;
}
}
This gets messy also because you have to double up on your properties.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi,
I've just decided to impliment a support layer that removes empty nodes. This is working now and I haven't found any issues with it:
string ct = this.HttpWebResponse.Headers["Content-Type"];
if (ct.Contains("application/xml"))
this.response_text = FilterOutEmptyNodes(this.response_text);
}
private string FilterOutEmptyNodes(string p)
{
return System.Text.RegularExpressions.Regex.Replace(p, "<[^>]*><[^>]*>", "");
}
/\ |_ E X E GG
|
|
|
|
|
I asked this question before, but I lost the forum post, so here it is again. How do you make a label (or status-strip) count up in seconds from a timer? It's really simple, but not cming to me right now. Thanks in advance...
|
|
|
|
|
In the timer code that fires each time you have a tick ( assuming you set it to one second), you get the value from your label's text, increment it by 1.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
That's what I need. It's something close to (x++) or something...
|
|
|
|
|
Oh, I just got it. Thanks for even trying to help!
|
|
|
|
|
MasterSharp wrote: Oh, I just got it. Thanks for even trying to help!
No problem at all.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
One suggestion. Timers are not perfect, so I'd get the time from DateTime.Now and show a difference, if you want it to be perfect. I'd also update twice a second, so it doesn't ever skip a number.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I don't understand how to set an Icon. After you add the icon file to the solution explorer, and set it to the form, the icon always makes a page picture, not the icon I chose. Please help, thanks in advance!
|
|
|
|
|
You could:
A) add the icon as a resource and retrieve it and set it programatically
or
B) rename your icon file to App.ico and drop it into your solution's folder
B is the quick and dirty way of doing it
---
http://iheartdotnet.blogspot.com/
|
|
|
|
|
i want to make a programe to convert numbers to alphapitic with c#
example:
1200 when it convert ,it will be
one thousand and two hundreds
|
|
|
|
|
see here[^] and here.[^]
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|
|
|
This is a very easy and standard homework problem. Do it yourself!
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
i think it is your class assignment .............
I AM WORKING ON "PLOTTER ROBOT"(FYP).
|
|
|
|
|
memaia wrote: i want to make a programe to convert numbers to alphapitic with c#
Permission granted. Please, proceed.
|
|
|
|
|
You should email his teacher
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
"There is a program that does that very thing right here on code project already.
http://www.codeproject.com/cs/design/TestFirstDevelopment.asp[^]
Remember: Google is your friend. "
Gosh Colin - how ever did you come up with that link so quickly? And how come you didn't comment on his use of such a rubbish post title?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: And how come you didn't comment on his use of such a rubbish post title?
I'm getting old.
|
|
|
|
|
Colin Angus Mackay wrote: I'm getting old.
As long as you're not mellowing.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
The real question is why he didn't mention SQL injection attacks.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
A well deserved 5 sir.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
you dont have any other work...MR.Pete O'Hanlon
|
|
|
|
|
What are you on about?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
suppose
bmp1 = new Bitmap(530, 335);<br />
bmp2 = new Bitmap(250, 200);
in which, bmp1 contains an image but bmp2 is empty
now,
bmp2 = new Bitmap(bmp1);
Since there are diffrence between the size of bmp1 and bmp2,so image of bmp2 losing the pixels due to the shrinking.
Am i right? i know i right.......
but i want shrink the desir pixels like
bmp1 = new Bitmap(bmp, 530, 335);<br />
bmp2 = new Bitmap(530, 335);<br />
Graphics gg = Graphics.FromImage(bmp2);<br />
p = new Pen(Color.Red, 1);<br />
for (i = 0; i < bmp1.Width; i++)<br />
{<br />
for (j = 0; j < bmp1.Height; j++)<br />
if (bmp1.GetPixel(i, j) == Color.FromArgb(255, 0, 0) && <br />
bmp1.GetPixel(i + 1, j) == Color.FromArgb(255, 0, 0)&&<br />
bmp1.GetPixel(i + 2, j) == Color.FromArgb(255, 0, 0)&&<br />
bmp1.GetPixel(i + 3, j) == Color.FromArgb(255, 0, 0)&&<br />
bmp1.GetPixel(i + 4, j) == Color.FromArgb(255, 0, 0)&&<br />
bmp1.GetPixel(i + 5, j) == Color.FromArgb(255, 0, 0))<br />
{<br />
gg.DrawEllipse(p, i, j, 1, 1); this.Invalidate();<br />
<br />
i += 6;<br />
}<br />
means that sense the only red pixels,if 6 pixels are in one row then change these six red pixels with the one pixel.
like
RRRRRRRRRRRBBBBRRRRRRRRRRBBBBBBBBBBBRRRRRR R=red,B=blue
R R RBBBBR R BBBBBBBBBBBR
iS it right method?is it efficeint method? for reducing the length of line of desire color.
i am confuse
I AM WORKING ON "PLOTTER ROBOT"(FYP).
|
|
|
|