Click here to Skip to main content
15,907,492 members
Home / Discussions / C#
   

C#

 
GeneralRe: pass multiplae parameter in crystal report Pin
OriginalGriff3-Sep-09 1:06
mveOriginalGriff3-Sep-09 1:06 
QuestionXElement vs XmlWriter Question Pin
Programm3r2-Sep-09 23:03
Programm3r2-Sep-09 23:03 
AnswerRe: XElement vs XmlWriter Question Pin
Keith Barrow2-Sep-09 23:28
professionalKeith Barrow2-Sep-09 23:28 
GeneralRe: XElement vs XmlWriter Question Pin
Programm3r2-Sep-09 23:37
Programm3r2-Sep-09 23:37 
GeneralRe: XElement vs XmlWriter Question Pin
Keith Barrow2-Sep-09 23:43
professionalKeith Barrow2-Sep-09 23:43 
GeneralRe: XElement vs XmlWriter Question Pin
Programm3r3-Sep-09 0:31
Programm3r3-Sep-09 0:31 
AnswerRe: XElement vs XmlWriter Question Pin
Programm3r3-Sep-09 1:42
Programm3r3-Sep-09 1:42 
GeneralRe: XElement vs XmlWriter Question Pin
Keith Barrow3-Sep-09 2:15
professionalKeith Barrow3-Sep-09 2:15 
How about:

XElement CreateReaderElement(ReaderType reader)
{
    return new XElement("reader",
            new XAttribute("name", reader.ReaderName),
            new XAttribute("readergroup", reader.ReaderGroup),
            new XAttribute("host", reader.ReaderHost),
            new XAttribute("type", reader.ReaderType),
            new XAttribute("startdate", DateTimeClass.DateTimeYearMonthDay(reader.StartDate)), new XAttribute("enddate", DateTimeClass.DateTimeYearMonthDay(reader.Value.EndDate)),
            new XAttribute("description", reader.ReaderDescription));
}

XElement CreateControllerElement(ControllerType controller)
{
    new XElement("controller",
                new XAttribute("name", controller.ControllerName),
                new XAttribute("description", controller.ControllerDescription),
                new XAttribute("area", controller.ControllerArea),
                new XAttribute("startdate", DateTimeClass.DateTimeYearMonthDay(controller.StartDate)),
                new XAttribute("enddate", DateTimeClass.DateTimeYearMonthDay(controller.EndDate)),
                new XAttribute("updatemode", controller.UpdateMode));
}
        
void AddComment(XElement target, string format, params object[] args)
{
    target.Add(new XComment(String.Format(format, args)));
}

void Foo(string[] args)
{
    //...    
    XElement xElement;
    foreach (var controller in ControllerList)
    {                
        AddComment(xElement.Element("plant").Element("building"), "Controller: {0} Declaration", controller.Key);
        XElement con = CreateControllerElement(controller.Value);
        // write the reader element and attributes
        foreach (var reader in controller.Value.ReaderList)
            con.Add(CreateReaderElement(reader.Value));
        xElement.Element("plant").Element("building").Add(con);            
    }
    //...
}


Where the italicised stuff are types / method names I can't determine.
GeneralRe: XElement vs XmlWriter Question Pin
Programm3r3-Sep-09 3:21
Programm3r3-Sep-09 3:21 
QuestionUpdate the XElement - Question Pin
Programm3r3-Sep-09 5:04
Programm3r3-Sep-09 5:04 
AnswerRe: XElement vs XmlWriter Question Pin
PIEBALDconsult3-Sep-09 6:30
mvePIEBALDconsult3-Sep-09 6:30 
GeneralRe: XElement vs XmlWriter Question Pin
Programm3r7-Sep-09 2:20
Programm3r7-Sep-09 2:20 
QuestionNavigating Internet Explorer Pin
Vijay Mudunuri2-Sep-09 22:50
Vijay Mudunuri2-Sep-09 22:50 
AnswerRe: Navigating Internet Explorer Pin
Jacobb Michael2-Sep-09 23:31
Jacobb Michael2-Sep-09 23:31 
GeneralRe: Navigating Internet Explorer Pin
Vijay Mudunuri3-Sep-09 2:00
Vijay Mudunuri3-Sep-09 2:00 
Questionconnectionstring Pin
sepehr_sepehr2-Sep-09 22:13
sepehr_sepehr2-Sep-09 22:13 
AnswerRe: connectionstring Pin
Mohammad Dayyan2-Sep-09 22:22
Mohammad Dayyan2-Sep-09 22:22 
QuestionAn issue in windows service ? Pin
Mohammad Dayyan2-Sep-09 21:59
Mohammad Dayyan2-Sep-09 21:59 
AnswerRe: An issue in windows service ? Pin
N a v a n e e t h3-Sep-09 0:23
N a v a n e e t h3-Sep-09 0:23 
GeneralRe: An issue in windows service ? [modified] Pin
Mohammad Dayyan3-Sep-09 1:22
Mohammad Dayyan3-Sep-09 1:22 
GeneralRe: An issue in windows service ? Pin
N a v a n e e t h3-Sep-09 5:43
N a v a n e e t h3-Sep-09 5:43 
GeneralRe: An issue in windows service ? [modified] Pin
Mohammad Dayyan4-Sep-09 0:49
Mohammad Dayyan4-Sep-09 0:49 
GeneralRe: An issue in windows service ? Pin
N a v a n e e t h4-Sep-09 5:57
N a v a n e e t h4-Sep-09 5:57 
GeneralRe: An issue in windows service ? Pin
Mohammad Dayyan4-Sep-09 6:32
Mohammad Dayyan4-Sep-09 6:32 
AnswerRe: An issue in windows service ? Pin
Calla3-Sep-09 0:23
Calla3-Sep-09 0:23 

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.