Click here to Skip to main content
15,914,410 members
Home / Discussions / C#
   

C#

 
AnswerRe: OleDbConnection question Pin
Colin Angus Mackay21-Sep-07 5:01
Colin Angus Mackay21-Sep-07 5:01 
GeneralRe: OleDbConnection question Pin
ForkOffandDie21-Sep-07 5:05
ForkOffandDie21-Sep-07 5:05 
AnswerRe: OleDbConnection question Pin
Scott Dorman21-Sep-07 5:15
professionalScott Dorman21-Sep-07 5:15 
GeneralRe: How to use LoadFile method of RichTextbox ? Pin
nesaver8521-Sep-07 3:56
nesaver8521-Sep-07 3:56 
QuestionPrinttoprinter Pin
Saamir21-Sep-07 3:49
Saamir21-Sep-07 3:49 
AnswerRe: Printtoprinter Pin
Ravi Bhavnani21-Sep-07 3:59
professionalRavi Bhavnani21-Sep-07 3:59 
GeneralRe: Printtoprinter Pin
Saamir21-Sep-07 4:16
Saamir21-Sep-07 4:16 
Questionsaving graph as an xml file Pin
Mamphekgo Bahula21-Sep-07 3:25
Mamphekgo Bahula21-Sep-07 3:25 
hi i have created this method to display graph on a form and is display but the problem that i have is that i want to save this method as an xml file but i can't get it right.under this method there is code that i am trying to use to save this method as an xml file.

private void DisplayTools()
{
Graph g = Graph("graph");
g.AddNode("Circle");
g.AddNode("Box");
g.AddNode("Ellipse");
g.AddNode("Diamond");

Edge e1 = (Edge)g.AddEdge("Circle", "Box");
Edge e2 = (Edge)g.AddEdge("Box", "Ellipse");
Edge e3 = (Edge)g.AddEdge("Ellipse", "Diamond");
Edge e4 = (Edge)g.AddEdge("Diamond", "Circle");


Node n1 = (Node)g.FindNode("Circle");
n1.Attr.Color = Microsoft.Glee.Drawing.Color.Black;
n1.Attr.Shape = Shape.Circle;

Node n2 = (Node)g.FindNode("Box");
n2.Attr.Color = Microsoft.Glee.Drawing.Color.Black;
n2.Attr.Shape = Shape.Box;

Node n3 = (Node)g.FindNode("Diamond");
n3.Attr.Color = Microsoft.Glee.Drawing.Color.Black;
n3.Attr.Shape = Shape.Diamond;
gViewer1.Graph = g;

here is code that i am trying to use to save as an xml file

FileStream fs = new FileStream("methods.xml", FileMode.Create);

XmlTextWriter w = new XmlTextWriter(fs,Encoding.UTF8);

w.WriteStartDocument();

w.WriteStartElement("methods");

DisplayTools();

w.WriteEndElement();

w.WriteEndDocument();

w.Flush();

fs.Close();



Mamphekgo

AnswerRe: saving graph as an xml file Pin
Ravi Bhavnani21-Sep-07 4:01
professionalRavi Bhavnani21-Sep-07 4:01 
QuestionHow to use LoadFile method of RichTextbox ? Pin
nesaver8521-Sep-07 3:23
nesaver8521-Sep-07 3:23 
AnswerRe: How to use LoadFile method of RichTextbox ? Pin
Luc Pattyn21-Sep-07 3:45
sitebuilderLuc Pattyn21-Sep-07 3:45 
GeneralRe: How to use LoadFile method of RichTextbox ? Pin
nesaver8521-Sep-07 4:28
nesaver8521-Sep-07 4:28 
GeneralRe: How to use LoadFile method of RichTextbox ? Pin
Luc Pattyn21-Sep-07 5:14
sitebuilderLuc Pattyn21-Sep-07 5:14 
AnswerRe: How to use LoadFile method of RichTextbox ? Pin
Pete O'Hanlon21-Sep-07 3:50
mvePete O'Hanlon21-Sep-07 3:50 
QuestionProblem in TreeView Pin
stancrm21-Sep-07 2:18
stancrm21-Sep-07 2:18 
AnswerRe: Problem in TreeView Pin
DaveyM6921-Sep-07 2:24
professionalDaveyM6921-Sep-07 2:24 
QuestionDirectoryInfo UNC Path Pin
TheShihan21-Sep-07 2:18
TheShihan21-Sep-07 2:18 
AnswerRe: DirectoryInfo UNC Path Pin
TJoe21-Sep-07 2:57
TJoe21-Sep-07 2:57 
GeneralRe: DirectoryInfo UNC Path Pin
TheShihan21-Sep-07 3:14
TheShihan21-Sep-07 3:14 
GeneralRe: DirectoryInfo UNC Path Pin
TJoe21-Sep-07 3:29
TJoe21-Sep-07 3:29 
GeneralRe: DirectoryInfo UNC Path Pin
TheShihan21-Sep-07 3:40
TheShihan21-Sep-07 3:40 
GeneralRe: DirectoryInfo UNC Path Pin
TheShihan21-Sep-07 4:13
TheShihan21-Sep-07 4:13 
QuestionPage refresh..... Pin
pavya_Cool21-Sep-07 1:55
pavya_Cool21-Sep-07 1:55 
AnswerRe: Page refresh..... Pin
Christian Graus21-Sep-07 2:20
protectorChristian Graus21-Sep-07 2:20 
QuestionProblem in passing message betwin client server. Pin
Tarun Dudhatra21-Sep-07 0:49
Tarun Dudhatra21-Sep-07 0:49 

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.