Click here to Skip to main content
15,887,683 members
Home / Discussions / C#
   

C#

 
GeneralAccess is denied Pin
Anonymous2-Aug-04 22:00
Anonymous2-Aug-04 22:00 
GeneralCulture extrange behavior Pin
Jose Vicente2-Aug-04 21:53
Jose Vicente2-Aug-04 21:53 
GeneralRe: Culture extrange behavior Pin
Norman-Timo3-Aug-04 1:20
Norman-Timo3-Aug-04 1:20 
GeneralRe: Culture extrange behavior Pin
Jose Vicente3-Aug-04 3:14
Jose Vicente3-Aug-04 3:14 
QuestionHow to save status of runtime controls? Pin
sachinkalse2-Aug-04 21:24
sachinkalse2-Aug-04 21:24 
AnswerRe: How to save status of runtime controls? Pin
Norman-Timo3-Aug-04 0:52
Norman-Timo3-Aug-04 0:52 
GeneralIdentify max no of child nodes for a node in XML Pin
saud_a_k2-Aug-04 20:49
saud_a_k2-Aug-04 20:49 
GeneralRe: Identify max no of child nodes for a node in XML Pin
Norman-Timo3-Aug-04 1:06
Norman-Timo3-Aug-04 1:06 
I think the best solution for this problem is to get the complete XML file with following instructions:

**************************************************
private static XmlDocument doc = new XmlDocument();
public XmlNode root;


using (StreamReader myTempFile = new StreamReader(xmlFile))
{
//read complete File into string
while ((rl = myTempFile.ReadLine()) != null)
{
tmpString += rl;
}
}

doc.LoadXml(tmpString);

root = doc.DocumentElement;

*************************************************

Now you have your complete XML-file in 'doc'. Additionally you have a root node.

Now you have to go through every node and check how many childs are available.

Something like:

*************************************************

int maxChildCount = 0;
int maxNodePos = 0;
int actNodePos = 0;

while (actNode != null)
{
actNodePos++;

int actChildCount = actNode.ChildNodes.Count;

if (maxChildCount < acthildCount)
{
maxchildCount = actChildCount;
maxNodePos = actNodePos;
}

actNode = actNode.NextSibling;
}
*************************************************

At the end you have the maxNodePos and the maxChildCount. At least you have to do is to start with your root-node and to step forward with 'actNode = actNode.NextSibling;' until your maxNodePos is reached.

I think it´s one solution and there are other possible, maybe faster to.

But I think it´s a solution.

Enjoy it, your
Norman-Timo
GeneralRe: Identify max no of child nodes for a node in XML Pin
saud_a_k3-Aug-04 1:35
saud_a_k3-Aug-04 1:35 
GeneralRe: Identify max no of child nodes for a node in XML Pin
Norman-Timo3-Aug-04 1:54
Norman-Timo3-Aug-04 1:54 
GeneralRe: Identify max no of child nodes for a node in XML Pin
saud_a_k3-Aug-04 2:38
saud_a_k3-Aug-04 2:38 
GeneralRe: Identify max no of child nodes for a node in XML Pin
leppie3-Aug-04 1:52
leppie3-Aug-04 1:52 
GeneralRe: Identify max no of child nodes for a node in XML Pin
saud_a_k3-Aug-04 2:31
saud_a_k3-Aug-04 2:31 
GeneralProblem accessing array of objects Pin
crushinghellhammer2-Aug-04 20:33
crushinghellhammer2-Aug-04 20:33 
GeneralRe: Problem accessing array of objects Pin
misterbear2-Aug-04 23:22
misterbear2-Aug-04 23:22 
GeneralRe: Problem accessing array of objects Pin
Stefan Troschuetz2-Aug-04 23:35
Stefan Troschuetz2-Aug-04 23:35 
QuestionIs there an MMC Snap-in Designer for .NET environment? Pin
zzzhouzhou2-Aug-04 18:34
zzzhouzhou2-Aug-04 18:34 
Generalprobability Pin
Member 7040992-Aug-04 17:39
Member 7040992-Aug-04 17:39 
GeneralRe: probability Pin
SOCM_FP_CPP3-Aug-04 1:28
SOCM_FP_CPP3-Aug-04 1:28 
QuestionC++ class defined in header file. Implementation in C# ? Pin
crushinghellhammer2-Aug-04 14:42
crushinghellhammer2-Aug-04 14:42 
AnswerRe: C++ class defined in header file. Implementation in C# ? Pin
Christian Graus2-Aug-04 14:56
protectorChristian Graus2-Aug-04 14:56 
GeneralData Grid problem Pin
Anonymous2-Aug-04 13:33
Anonymous2-Aug-04 13:33 
QuestionMoved code breaks? Pin
Chris Korzeniowski2-Aug-04 13:09
Chris Korzeniowski2-Aug-04 13:09 
AnswerRe: Moved code breaks? Pin
Jay Shankar2-Aug-04 19:00
Jay Shankar2-Aug-04 19:00 
AnswerRe: Moved code breaks? Pin
sreejith ss nair2-Aug-04 19:22
sreejith ss nair2-Aug-04 19:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.