Search Results

Search found 5 results on 1 pages for 'pee2002'.

Page 1/1 | 1 

  • XmlSerializer one Class that has multiple classes properties

    - by pee2002
    Hi there! Objective: Serialize all the public properties of the ClassMain: public class ClassMain { ClassA classA = new ClassA(); public ClassMain() { classA.Prop1 = "Prop1"; classA.Prop2 = "Prop2"; } public string Prop1 { get; set; } public string Prop2 { get; set; } public ClassA ClassA { get { return classA; } } } ClassA: public class ClassA { public string Prop1 { get; set; } public string Prop2 { get; set; } } This is how i´m serializing: private void button1_Click(object sender, EventArgs e) { ClassMain classMain = new ClassMain(); classMain.Prop1 = "Prop1"; classMain.Prop2 = "Prop2"; XmlSerializer mySerializer = new XmlSerializer(typeof(ClassMain)); StreamWriter myWriter = new StreamWriter("xml1.xml"); mySerializer.Serialize(myWriter, classMain); myWriter.Close(); } In this case, the xml output is: <?xml version="1.0" encoding="utf-8"?> <ClassMain xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Prop1>Prop1</Prop1> <Prop2>Prop2</Prop2> </ClassMain> As you see, is lacking the ClassA properties. Can anyone help me out? Regards

    Read the article

  • How to sequential filter/Select multiple combobox w/ just one DataSet

    - by pee2002
    Hi! I´m communicating via webservices with the Server (where's installed the database) and the c# application. So, i dont have direct access with the database Somehow, i receive a DataSet with 3 tables inside: And would like to populate 3 combobox like this: Which (as you already see) has a sequential logic. If i perhaps select "Gabicontas1" instead "Gabicontas" from the first combobox, the next ones has to change.. Can anyone help? Regards

    Read the article

  • Visual Studio Code Metrics and the Maintainability index of switch case

    - by pee2002
    Hi there! As a person who loves to follow the best practices, If i run code metrics (right click on project name in solution explorer and select "Calculate Code Metrics" - Visual Studio 2010) on: public static string GetFormFactor(int number) { string formFactor = string.Empty; switch (number) { case 1: formFactor = "Other"; break; case 2: formFactor = "SIP"; break; case 3: formFactor = "DIP"; break; case 4: formFactor = "ZIP"; break; case 5: formFactor = "SOJ"; break; } return formFactor; } It Gives me a Maintainability index of 61 (of course this is insignificant if you have only this, but if you use an utility like class whos philosophy is doing stuff like that, your utility class will have the maintainability index much worst..) Whats the solution for this?

    Read the article

  • How to send a XmlSerializer Class to a WebService and then Deserialize it?

    - by pee2002
    Hi! I want to be able to send a XmlSerializer class (which is generated obvious in remote C# application) over a WebService that will then deserialize it into a class. (I didnt know it its possible either) My class is: SystemInfo I'm serializing it this way: XmlSerializer mySerializer = new XmlSerializer(typeof(SystemInfo)); StreamWriter myWriter = new StreamWriter(textBox1.Text); mySerializer.Serialize(myWriter, sysinfo); How can i build the WebService? [WebMethod] public void Reports(XmlSerializer xmlSerializer) { . . . } Can anyone help me out? Regards

    Read the article

  • ASP.NET How to save and use persistent information depending on user type login

    - by pee2002
    Hi there! I´m building a website and i need to store somehow some informations that i will use in the whole site depending of the user type logged in. Example: 1) User XPTO logs in 2) Query DataBase to see where he belongs 3) Store those 2 or 3 fields that i will get in Database in a persistent way to use it in the whole site. My question is: Whats the best practices to do this? Best Regards

    Read the article

1