|
You can ignore object from being xml serialized using the XmlIgnore attribute
<br />
[XmlIgnore()]<br />
public List vehicles<br />
|
|
|
|
|
Thank you Eduard for your answer but my problem is not to exclude the list.
The class Parking only contain a List<Vehicle> called 'Vehicles'.
the problem is that I get :
<parking><br />
<vehicles><br />
.... all vehicules (classes Car, Truck, Motorbike ...)<br />
</vehicles><br />
</parking><br />
I only want the 'vehicles' tags to disappear and 'Car', 'Motorbike' or 'Truck' vehicles to inside the 'parking' tags.
With your solution, I get :
</parking> (the content of the 'Vehicles' list is not serialized)
jpeg
|
|
|
|
|
Hello,
I don't think that you could deserialze it correctly once it was modified this way.
And I also don't think there is a way to serialize it the way you want it.
All the best,
Martin
|
|
|
|
|
I think there is, you need to customize the serialization process by making your class IXmlSerializable and use the WriteXml() and ReadXml() functions to write your custom XML message, and Read it when the objects is being deserialized.
The WriteXml and ReadXml will be called by you serializer...
|
|
|
|
|
This sounds like it could end up in a nice article.
Hope somebody takes his time to share it.
All the best,
Martin
|
|
|
|
|
Hello folks.
how can use a javascript so that if i clicked on a treenode it wont post back to the server and close the root tree!
what im asking, if there is anyway to do it using javascript so when i click on a tree node it wont close the root.
thanks in advanced
Estarta
|
|
|
|
|
How do I get keyboard inputs like 'X' to exit and maybe right arrow to go to next frame, etc. I tried
protected override void OnKeyDown(KeyEventArgs e)
{
if(e.KeyCode == Keys.X);
Close();
}
ut I am not sure about the event handler I need to put out
Thanks!
Samuel
|
|
|
|
|
Hi!
What's wrong with the code? What do you mean by "putting out" an event handler? Your implementation of OnKeyDown is a way to handle the KeyDown event...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Like the below
Convert.ToInt32 (e.KeyChar ) == 95 // this is for 'a'
you can find constant integer valus of X and validate against it then proceed.
|
|
|
|
|
Hi,
there are several Keyboard events:
- KeyDown and KeyUp events provide e.KeyCode (type Keys) and e.KeyValue (the int value of KeyCode); it also fires when pressing/releasing modifier keys (CTRL, ALT, SHIFT, ...)
- for printable keys (the ones that normally add text in a text editor) you
better use KeyPress event which provides e.KeyChar (char), so you dont need to refer
to the Keys enumeration nor the explicit conversion to integers.
|
|
|
|
|
How do I get keyboard inputs like 'X' to exit and maybe right arrow to go to next frame, etc. I tried
protected override void OnKeyDown(KeyEventArgs e)
{
if(e.KeyCode == Keys.X);
Close();
}
ut I am not sure about the event handler I need to put out
Thanks!
Samuel
|
|
|
|
|
Hello,
On your MainForm you have to set the "KeyPreview" property and handle KeyPress.
this.KeyPreview = true;
}
protected override void OnKeyPress(KeyPressEventArgs e)
{
if(e.KeyChar.Equals('X')||e.KeyChar.Equals('x'))
Close();
else
base.OnKeyPress (e);
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
Yes It Worked, exactly what I was looking for. Thanks Martin!
|
|
|
|
|
Glad I could help!
All the best,
Martin
|
|
|
|
|
Hi,
Currently i'm working on a project that tries to create xml files by getting data from backend. The problem now is that i'm unable to preserve the whitespaces between the tags.
Can any one help on this.
Thanx and Rgds,
Seenivasan
|
|
|
|
|
What are you using for creating the xml file DOM or xmlTextWriter ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I'm quite curios myself. How do you deal with this if you use XmlTextWriter?
|
|
|
|
|
Add this after writing every tag i think that will create some white space
What you think ?
ObjectxmlTextwriter.WriteWhitespace(" ");
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Good Morning Friends
we are using asp.net with c# i have a problem in password display.
this coding is retrive a data from database to display username and password in c#
txtPassword.Enabled = false;
txtUserName.Text = drStaffDetails["UserName"].ToString() ;
txtPassword .Text = drStaffDetails["Password"].ToString() ;
now problem is username is displaying and password is not displaying in a password char field showing blank
Bellow coding is in asp.net
asp:textbox ID="txtPassword" Runat=Server textMode="Password">
from above coding if i used as a textmode as text it displaying a password.
another thing i am using breakpoint for checking whether the password is retrieving or not , it is displaying
pls help me urgent
Kankeyan
|
|
|
|
|
i think you can not display a text while the textMode=Password.
then there is no benefit of displaying a password
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Mr i cannot able to display a password in password format the field is being cleared and there is no value while the textmode is in password.
But textmode is in text password is visible and in a text format i don't want to visible in text format.
give a solution
kankeyan
|
|
|
|
|
How to check if someone is logged on Server Console (local logon)?
Manual steps > TaskMgr.exe > Users Tab > Check user with ID=0
We have Terminal Server farm and need to know console logons.
Many Thanks.
h.
|
|
|
|
|
Hi all
I am reading a DB into a binding source that I am then displaying in a datagridview
I want to do a few things like go through and format a few rows (example: companyname/username to just display the user name)
i also want to get a count on of how many of each type in a certain column
lastly i know i can use the .filter to the binding source but i have two questions i need clarified
1a) how do you string more than one filter together.
2a) if i use the filter and then i ran a counting loop or something in the binding source would it give me the account for all the info in the binding source or would it give me the totals for the filtered info.
Thanks
|
|
|
|
|
Hai,
I want to place an microsoft office document imaging in a windows form in c#.net ie(C#.net + windows application)
My requirement is to place the image in the half of the winform and below some controls such as labels and textboxes are to be placed and by seeing the data from the image user is going to enter the data in the controls if he enters the correct data user has to save the data.if any body finds a solution and what area the dlls to be imported .
Please send to me
suryaprakash_kk@apollohealthstreet.com
surya prakash
|
|
|
|
|
hi did u found the solution for doing this....can u gv me some sample for this code if ur done with this....
|
|
|
|