I can't open the Web Services and XML-Related topics thread section so I posted my this thread here..
I have a class that has the following contents :
[Serializable()]
public class InstrumentConfiguration
{
[XmlElement("GPIBAddress")]
public static string gpibAddress;
[XmlElement("DCSourceAddress")]
public static string dcSourceAddress;
[XmlElement("DMMAddress")]
public static string dmmAddress;
// Static Constructor
static InstrumentConfiguration()
{}
// Default Constructor
public InstrumentConfiguration()
{}
}
Questions :
1. Can static fields like the one above be serialized?
2. Are public properties good substitutes for serializing private fields? Is this a good practice?
3. Are static classes serializable? I don't see a way to pass them in the XmlSerializer.Serialize() method since the object parameter must be an instance of a class?
I'm actually implementing a settings file for class entities which can be saved through xml files and possibly through a database. Do you guys have a suggestion on how I can implement this.
Success is 1% Inspiration and 99% Perspiration..
- T. Edison -