|
For the LookupItem class you should use the XmlElementAttribute (I think). So something like this:
[XmlElement("Item")]
public class LookupItem ...
The XmlRootAttribute is only good for the root item in the XML doc (of which there is only one). Let me know if this doesn't work, though.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
XmlElement can not be used on a class only property, index, field or param.
The XmlRoot attribute simply tells the serializer that for this particular class to use a specific name for the node, it doesn't directly relate to the root element of the doc.
Cheers
Nathan
|
|
|
|
|
Sorry, my memory isn't what is used to be Here is the code that should do what you want...
[XmlType(TypeName = "Item")]
public class LookupItem {
}
[XmlRoot("Clean")]
public class LookupItemList : List<LookupItem> {
}
I'm assuming you are using a generic List and that you are serializing the List as the root object.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
XmlType - of course!
Got so hung up on the XmlRoot that I completely forgot about that.
Got it all serializing lovely now, managed it without a specific class by simply providing a XmlRoot attribute to the serializer.
Thanks Tom
|
|
|
|
|
Hi friends,im using updatepanel.Session is not expiring..even i do Session.Abondon(),Session.Clear(),Session.RemoveAll()...but after doing log out,if i hit back button,its still working..how can i ban it..?
Hi,Im Razana
|
|
|
|
|
You could probably use the logout event to clear the session (session.clear or session.abondon);
Treat the page_load event and check for the session("UserID") (or whatever you are interested in...)
But, is it not the wrong forum?
SkyWalker
|
|
|
|
|
I know that ZedGraph is a good tool to plot 2D figures.
Is there similar free source code to plot 3D ones, which can be used in VC#?
Thank you ver much.
|
|
|
|
|
Why wouldn't you have a look here at CP[^]?
SkyWalker
|
|
|
|
|
hi,
if i am using folloing code to open a perticular xml file,
OpenFileDialog dlg = new OpenFileDialog();
dlg.Title = "Open XML File";
dlg.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*" ;
if (dlg.ShowDialog() == DialogResult.OK)
{
doc.Load(dlg.OpenFile());
}
and now if i want to read a file name in the xmltextreader , how can i read it?
|
|
|
|
|
|
|
Hi All,
I am developing a c# app which calls a function in a c++ dll. For this function to work the calling application must have a privilege certificate as the function i am calling is a privilege API(lineGetGeneralInfo).
Does anybody know how yo use this function in my app??
|
|
|
|
|
I'm sorry guys, but google is not working today .. No, seriously, I keep getting some redirection message to sorry.google.com.. anywayz, my main function has some string[] args and I want to know what's happening to the passed parameters and cant do it from the IDE, please help me..
Thanks
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hello Muammar!
I'm not shure if I understand your question, or better what you think you don't understand.
Pathing arguments:
using System.Diagnostics;
ProcessStartInfo PSItest= new ProcessStartInfo();
PSItest.FileName = @"???";
PSItest.Arguments = "oneargument";
PSItest.Arguments = "firstargument secondargument";
using(Process Ptest = Process.Start(PSItest))
{
}
Getting arguments:
public static void Main(string[] Args)
{
string arg1 = "";
string arg2 = "";
if (Args.Length > 0)
{
arg1 = Args[0];
}
if (Args.Length > 1)
{
arg2 = Args[1];
}
}
All the best,
Martin
|
|
|
|
|
Hey Martin!
Good to hear from you buddy , thank you for your help and I'm sorry my question wasnt clear, I just meant to watch my parameters getting processed, the other answer is what I was looking for but thanks anyways for your time Martin...
BTW: Your new icon looks great ..
Have a nice day Martin!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Are you trying to debug the parameters passed ? Then choose Project Properties - > Debug - > Command line arguments . There you can supply them
|
|
|
|
|
Thanks buddy
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
What the other said works, but I understood from you was you don't/can't do this from the IDE. So what you can do is the following:
static void Main(string[] args)
{
#if DEBUG
args[0] = "string1";
args[1] = "string2";
#endif
}
|
|
|
|
|
Cool!! I Didnt know this, thanks man!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
hi friends ,
i want to pass a cnt value which is used in event to button click... how can i do it?
--------------------------------------------------------------
private void treeXml_AfterSelect(object sender,
System.Windows.Forms.TreeViewEventArgs e,e)
{
int cnt = e.Node.GetNodeCount(false);
grpbox.Controls.Clear();
for (int i = 0; i < cnt; i++)
{
Label lbl = new Label();
TextBox txt = new TextBox();
//PictureBox img = new PictureBox();
lbl.Text = e.Node.Text;
lbl.Left = 200;
lbl.Top = 200 * i;
txt.Left = 250;
txt.Top = 200 * i;
//img.left=300;
//img.top=200 * i;
lbl.Show();
txt.Show();
grpbox.Controls.Add(txt);
grpbox.Controls.Add(lbl);
//grpbox.Controls.Add(img);
}
}
private void button2_Click(object sender, System.EventArgs e)
{
}
|
|
|
|
|
samidhas wrote: int cnt = e.Node.GetNodeCount(false);
Declare this inside the class, not inside this method. So you have access to this variable in the button click event.
|
|
|
|
|
its not working bcoz i am using e.node which can be only possible in the treeview event not in the main class ..... am i right, plz guide me
|
|
|
|
|
Don't put the entire code in class. Declare the variable there like int cnt = 0;
|
|
|
|
|
oh that was simple yar....... thanks....
|
|
|
|
|
hi
i'm looking for articles or ... to know how to inject my code into pe file with csharp, i found some useful articles like this but it's in c++ and i dont know c++ very good, can anybody help me ?
thanks.
|
|
|
|