public void Serialize (XmlWriter writer, object obj, Type type) { DataNode data = serializer.Serialize (obj, type); XmlConfigurationWriter cw = new XmlConfigurationWriter (); cw.StoreAllInElements = StoreAllInElements; cw.Write (writer, data); }
protected internal override object OnDeserialize(SerializationContext serCtx, object mapData, DataNode data) { XmlConfigurationWriter sw = new XmlConfigurationWriter(); XmlDocument doc = new XmlDocument(); return(sw.Write(doc, data)); }
void UpdateEntry () { var ser = new DataSerializer (new DataContext ()); var data = ser.Serialize (this); XmlDocument doc = new XmlDocument (); var writer = new XmlConfigurationWriter { Namespace = MSBuildProject.Schema }; var elem = writer.Write (doc, data); entry.MSBuildProject.SetMonoDevelopProjectExtension ("Deployment.LinuxDeployData", elem); }
internal void SaveToXml (XmlWriter xw) { XmlConfigurationWriter cw = new XmlConfigurationWriter (); cw.StoreAllInElements = true; cw.StoreInElementExceptions = new String[] { "scope", "inheritsSet", "inheritsScope" }; xw.WriteStartElement ("PolicySet"); if (!string.IsNullOrEmpty (Name)) xw.WriteAttributeString ("name", Name); if (!string.IsNullOrEmpty (Id)) xw.WriteAttributeString ("id", Id); if (policies != null) { foreach (KeyValuePair<PolicyKey,object> policyPair in policies) cw.Write (xw, PolicyService.DiffSerialize (policyPair.Key.PolicyType, policyPair.Value, policyPair.Key.Scope)); } xw.WriteEndElement (); }
internal void SaveToFile (StreamWriter writer) { XmlWriterSettings xws = new XmlWriterSettings (); xws.Indent = true; XmlConfigurationWriter cw = new XmlConfigurationWriter (); cw.StoreAllInElements = true; cw.StoreInElementExceptions = new String[] { "scope", "inheritsSet", "inheritsScope" }; using (XmlWriter xw = XmlTextWriter.Create(writer, xws)) { xw.WriteStartElement ("PolicySet"); if (policies != null) { foreach (KeyValuePair<PolicyKey,object> policyPair in policies) cw.Write (xw, PolicyService.DiffSerialize (policyPair.Key.PolicyType, policyPair.Value, policyPair.Key.Scope)); } xw.WriteEndElement (); } }
protected internal override object OnDeserialize (SerializationContext serCtx, object mapData, DataNode data) { XmlConfigurationWriter sw = new XmlConfigurationWriter (); XmlDocument doc = new XmlDocument (); return sw.Write (doc, data); }