예제 #1
0
		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);
		}
예제 #2
0
        protected internal override object OnDeserialize(SerializationContext serCtx, object mapData, DataNode data)
        {
            XmlConfigurationWriter sw  = new XmlConfigurationWriter();
            XmlDocument            doc = new XmlDocument();

            return(sw.Write(doc, data));
        }
예제 #3
0
		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);
		}
예제 #4
0
		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);
		}