예제 #1
0
		public XamlNodeQueue (XamlSchemaContext schemaContext)
		{
			if (schemaContext == null)
				throw new ArgumentNullException ("schemaContext");
			this.ctx = schemaContext;
			reader = new XamlNodeQueueReader (this);
			writer = new XamlNodeQueueWriter (this);
		}
예제 #2
0
		public static void Transform (XamlReader xamlReader, XamlWriter xamlWriter)
		{
			Transform (xamlReader, xamlWriter, true);
		}
예제 #3
0
		public static void Transform (XamlReader xamlReader, XamlWriter xamlWriter, bool closeWriter)
		{
			if (xamlReader == null)
				throw new ArgumentNullException ("xamlReader");
			if (xamlWriter == null)
				throw new ArgumentNullException ("xamlWriter");

			if (xamlReader.NodeType == XamlNodeType.None)
				xamlReader.Read ();

			while (!xamlReader.IsEof) {
				xamlWriter.WriteNode (xamlReader);
				xamlReader.Read ();
			}
			if (closeWriter)
				xamlWriter.Close ();
		}
예제 #4
0
		public static void Save (XamlWriter xamlWriter, object instance)
		{
			if (xamlWriter == null)
				throw new ArgumentNullException ("xamlWriter");
			var r = new XamlObjectReader (instance, xamlWriter.SchemaContext);
			Transform (r, xamlWriter);
		}