static void Main(string[] args)
    {
        System.Xml.Serialization.XmlAttributes xa =
            new System.Xml.Serialization.XmlAttributes();
        xa.XmlIgnore = true;
        System.Xml.Serialization.XmlAttributeOverrides xo1 =
            new System.Xml.Serialization.XmlAttributeOverrides();
        xo1.Add(typeof(Test), "group1_attr1", xa);
        xo1.Add(typeof(Test), "group1_attr2", xa);
        System.Xml.Serialization.XmlAttributeOverrides xo2 =
            new System.Xml.Serialization.XmlAttributeOverrides();
        xo2.Add(typeof(Test), "group2_attr1", xa);
        System.Xml.Serialization.XmlSerializer xs1 =
            new System.Xml.Serialization.XmlSerializer(typeof(Test), xo1);
        System.Xml.Serialization.XmlSerializer xs2 =
            new System.Xml.Serialization.XmlSerializer(typeof(Test), xo2);
        Test t1 = new Test();

        t1.group1_attr1 = 1;
        t1.group1_attr2 = 2;
        t1.group2_attr1 = 3;
        using (System.IO.StringWriter sw = new System.IO.StringWriter())
        {
            xs1.Serialize(sw, t1);
            Console.WriteLine(sw);
        }
        using (System.IO.StringWriter sw = new System.IO.StringWriter())
        {
            xs2.Serialize(sw, t1);
            Console.WriteLine(sw);
        }
    }
 public XmlSerializer(System.Type type, System.Xml.Serialization.XmlAttributeOverrides overrides, System.Type[] extraTypes, System.Xml.Serialization.XmlRootAttribute root, string defaultNamespace)
 {
 }
 public XmlSerializer(System.Type type, System.Xml.Serialization.XmlAttributeOverrides overrides)
 {
 }
Exemplo n.º 4
0
 public XmlReflectionImporter(System.Xml.Serialization.XmlAttributeOverrides attributeOverrides, string defaultNamespace)
 {
 }
Exemplo n.º 5
0
 public XmlReflectionImporter(System.Xml.Serialization.XmlAttributeOverrides attributeOverrides)
 {
 }