|
It would be better to post this question in the XML/XSL forum.
|
|
|
|
|
ok, i'll try there
thanks
|
|
|
|
|
guys no1 can help here ?
maybe this one will be easier.
i need to serialize this list
Class A
{
Int _a,_b,_c;
InsertData(a,b,c);
{ _a=a.._c=c;}
}
Class B
{
List of A _l
Public B()
{
Loop 1 to 3
{
A a = new A();
_l.add(a.insertData(i+10,i+20,i+30);
}
}
}
Class Main
{
List of B _l;
Loop 1 to 3
_l.add(new Class B());
}
but got some trouble to serialize list in list
|
|
|
|
|
I don't understand your code.
I have a little article on XML serialization here[^].
I did a little extra experiment, and it worked right from the start. Here it goes.
the inner list:
public class StringList : List<string> {
public StringList() { }
public StringList(int count) {
for (int i=0; i<count; i++) this.Add("item"+i);
}
}
the serializer:
List<StringList> list=new List<StringList>();
list.Add(new StringList(2));
list.Add(new StringList(5));
list.Add(new StringList(3));
xSer=new XmlSerializer(typeof(List<StringList>));
xSer.Serialize(sw, list);
the deserializer:
List<StringList> list=(List<StringList>)xSer.Deserialize(sr);
foreach (StringList sl in list) {
log("***");
foreach (string s in sl) log(s);
}
|
|
|
|
|
first, thanks for the answer !!
second, your second example seems to be what i need, but it a bit different...
instead of declaring 2 aggregated object of Class Mini inside Class Combo, i've a list of Mini inside Combo...
and also i've a list of Combo... (and here i fail...)
third, why do you use private ctor in this example ? (for both classes)
modified on Monday, December 20, 2010 5:49 PM
|
|
|
|
|
igalep132 wrote: why do you use private ctor
The access attributes aren't really relevant. Some of the default constructors are not used explicitly by my code, however they are needed by the serialization; making them private suits this, as serialization is based on reflection, it can access anything it finds!
|
|
|
|
|
I see...
Your examples are helped me a lot
small thing, how can i add an attributes to combo class ?
in order to see it like
<Combo num ="1">...</Combo>
<Combo num ="2">...</Combo>
Thanks again
|
|
|
|
|
I don't know. Are the ComboBox properties insufficient? they have Name, Tag, etc.
|
|
|
|
|
you didn't understand me correctly...
Combo is your example (second example in your article)
|
|
|
|
|
I have no experience with XML attributes. You're on your own. Try something like:
[XmlAttribute(DataType="int", AttributeName="myInteger")]
|
|
|
|
|
a bit late response, but thanks
|
|
|
|
|
I need a code that will allow me to find how much total storage space a local HD has on a server
(for example, \\randomname\c$), and also the amount of currently used space on that same HD.
So, if, for example, I am using the code on a computer named "Banana" I need it to tell me how much
space there is on a server called "RandomName".
Thanks in advance
|
|
|
|
|
If you want to do this in C# you'd have to use System.Management namespace. It contains the classes to do WMI in .NET. It's too bad that access of remote machines wasn't build into the DriveInfo class of the System.IO namespace.
|
|
|
|
|
I wonder if mapping a drive to the location would allow you to use the DriveInfo class?
|
|
|
|
|
It should do, but think of the consequences:
You would have to map every drive of the server to get at all of them.
And when enumerating your drives with driveInfo you have to filter for the
network drives and then look only at the ones from the server you're interested
in. Since you might want to inspect other servers too you'd need to do this programatically.
So I need to enumerate the drives on the remote computer ...?
The dog seems to chasing it's tail ...
|
|
|
|
|
how to play power point files in C#, the point is how to paly them seamless?
It is better of me!
|
|
|
|
|
Lots of ideas here[^].
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Thanks , I'll check them out .
It is better of me!
|
|
|
|
|
This Link[^] may work for you.
|
|
|
|
|
hi
all member in c# forum
im student and i need answer from my question:
why i create image histogram from any image by using c# .
please geve me the code to drow that .
milion thanks from all persons about help me
|
|
|
|
|
mohammed alshaweesh wrote: why i create image histogram from any image by using c# .
I don't know why you create a histogram for your images. I don't do it for mine.
mohammed alshaweesh wrote: please geve me the code
The code to do what? Tell you why you created a histogram?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I doubt anyone here is going to give you code, since most of us work for a living. Perhaps there's a language barrier and what you said was not what you meant.
At any rate, if you want to write your own code to make image histograms, try searching in the articles on this site for "image histogram" and you should get quite a few ideas. For example, here's one such article: 2D and 3D Image histograms and 2D multistage entropy[^]
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
many time we populate UI with data from DB in the form load and that is why form gets freeze for few second. so i just want to know how can i load data asynchronously and populate UI in form load as a result my form will not freeze and also will be responsive but i don't want to use background worker class. please help me with sample code which can solve my problem.
thanks
tbhattacharjee
|
|
|
|
|
The one way to avoid GUI freeze is by using one or more extra threads (instances of Thread, work items for ThreadPool, BackgroundWorkers, whatever), as they act like extra hands to get the work done. So you should obtain the data in a thread, then take the right action to get it into the GUI (a thread cannot access the GUI). And the best solution is the BackgroundWorker!
There are lots of examples around. I have one in my CP Vanity article, which is getting data asynchronously, not from a database, but from a web site (CodeProject), the philosophy is exactly the same though.
|
|
|
|
|
Hmmmmmm (*drools*), CP Vanity. Take 5!
|
|
|
|