Click here to Skip to main content
15,902,299 members
Home / Discussions / C#
   

C#

 
AnswerRe: search for nearby wifi networks Pin
Vasudevan Deepak Kumar10-Jul-09 2:26
Vasudevan Deepak Kumar10-Jul-09 2:26 
Questionlist all wi-fi network connections Pin
Vivek Vijayan9-Jul-09 6:40
Vivek Vijayan9-Jul-09 6:40 
AnswerRe: list all wi-fi network connections Pin
Blue_Boy9-Jul-09 6:55
Blue_Boy9-Jul-09 6:55 
GeneralRe: list all wi-fi network connections Pin
Mycroft Holmes9-Jul-09 11:52
professionalMycroft Holmes9-Jul-09 11:52 
GeneralRe: list all wi-fi network connections Pin
Blue_Boy9-Jul-09 13:16
Blue_Boy9-Jul-09 13:16 
GeneralRe: list all wi-fi network connections Pin
Vasudevan Deepak Kumar10-Jul-09 2:26
Vasudevan Deepak Kumar10-Jul-09 2:26 
Questionown == Operator and null Problem [solved] Pin
chrisx519-Jul-09 6:34
chrisx519-Jul-09 6:34 
AnswerRe: own == Operator and null Problem Pin
harold aptroot9-Jul-09 6:51
harold aptroot9-Jul-09 6:51 
GeneralRe: own == Operator and null Problem Pin
chrisx519-Jul-09 23:18
chrisx519-Jul-09 23:18 
GeneralRe: own == Operator and null Problem Pin
harold aptroot10-Jul-09 3:37
harold aptroot10-Jul-09 3:37 
AnswerRe: own == Operator and null Problem Pin
Blue_Boy9-Jul-09 6:53
Blue_Boy9-Jul-09 6:53 
GeneralRe: own == Operator and null Problem Pin
chrisx519-Jul-09 23:22
chrisx519-Jul-09 23:22 
AnswerRe: own == Operator and null Problem Pin
DaveyM699-Jul-09 7:37
professionalDaveyM699-Jul-09 7:37 
GeneralRe: own == Operator and null Problem Pin
chrisx519-Jul-09 23:24
chrisx519-Jul-09 23:24 
GeneralRe: own == Operator and null Problem Pin
DaveyM6910-Jul-09 4:26
professionalDaveyM6910-Jul-09 4:26 
GeneralRe: own == Operator and null Problem Pin
chrisx5112-Jul-09 23:32
chrisx5112-Jul-09 23:32 
AnswerRe: own == Operator and null Problem Pin
Dave Kreskowiak9-Jul-09 7:55
mveDave Kreskowiak9-Jul-09 7:55 
GeneralRe: own == Operator and null Problem [modified] Pin
chrisx519-Jul-09 23:27
chrisx519-Jul-09 23:27 
QuestionXML to ObservableCollection Pin
VickyC#9-Jul-09 6:08
VickyC#9-Jul-09 6:08 
AnswerRe: XML to ObservableCollection Pin
Jeremy Likness9-Jul-09 6:45
professionalJeremy Likness9-Jul-09 6:45 
GeneralRe: XML to ObservableCollection Pin
VickyC#9-Jul-09 6:50
VickyC#9-Jul-09 6:50 
GeneralRe: XML to ObservableCollection Pin
VickyC#9-Jul-09 7:06
VickyC#9-Jul-09 7:06 
GeneralRe: XML to ObservableCollection Pin
Jeremy Likness9-Jul-09 7:14
professionalJeremy Likness9-Jul-09 7:14 
It will create a hierarchal object graph. Something like this would populate it:

C#
public TreeNode Populate(XDocument doc)
{
    var retVal = (from treeNode in doc.Descendants("TreeNode")
                select new TreeNode()
                           {
                               Code = treeNode.Attribute("Code").Value,
                               Text = treeNode.Attribute("Text").Value
                           }).SingleOrDefault();
    retVal.Children = _Recurse((from treeNode in doc.Descendants("TreeNode")
                               select treeNode).SingleOrDefault());
    return retVal; 
}

private static List<TreeNode> _Recurse(XContainer root)
{
    List<TreeNode> retVal = new List<TreeNode>();
    var children = from child in root.Descendants("TreeNode") select child;
    foreach(var child in children)
    {
        TreeNode node = new TreeNode
                            {
                                Code = child.Attribute("Code").Value,
                                Text = child.Attribute("Text").Value,
                                Children = _Recurse(child)
                            };
        retVal.Add(node);
    }
    return retVal;
}


Jeremy Likness
http://csharperimage.jeremylikness.com/

GeneralRe: XML to ObservableCollection Pin
VickyC#9-Jul-09 7:35
VickyC#9-Jul-09 7:35 
GeneralRe: XML to ObservableCollection Pin
VickyC#9-Jul-09 7:43
VickyC#9-Jul-09 7:43 

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.