Exemplo n.º 1
0
		public XamlBackgroundReader (XamlReader wrappedReader)
		{
			if (wrappedReader == null)
				throw new ArgumentNullException ("wrappedReader");
			r = wrappedReader;
			q = new XamlNodeQueue (r.SchemaContext) { LineInfoProvider = r as IXamlLineInfo };
		}
Exemplo n.º 2
0
		public void WriteNode (XamlReader reader)
		{
			if (reader == null)
				throw new ArgumentNullException ("reader");

			switch (reader.NodeType) {
			case XamlNodeType.StartObject:
				WriteStartObject (reader.Type);
				break;
			case XamlNodeType.GetObject:
				WriteGetObject ();
				break;
			case XamlNodeType.EndObject:
				WriteEndObject ();
				break;
			case XamlNodeType.StartMember:
				WriteStartMember (reader.Member);
				break;
			case XamlNodeType.EndMember:
				WriteEndMember ();
				break;
			case XamlNodeType.Value:
				WriteValue (reader.Value);
				break;
			case XamlNodeType.NamespaceDeclaration:
				WriteNamespace (reader.Namespace);
				break;
			default:
				throw NotImplemented (); // documented behavior
			}
		}
Exemplo n.º 3
0
		public XamlNodeQueue (XamlSchemaContext schemaContext)
		{
			if (schemaContext == null)
				throw new ArgumentNullException ("schemaContext");
			this.ctx = schemaContext;
			reader = new XamlNodeQueueReader (this);
			writer = new XamlNodeQueueWriter (this);
		}
Exemplo n.º 4
0
		public static Object Load (XamlReader xamlReader)
		{
			if (xamlReader == null)
				throw new ArgumentNullException ("xamlReader");
			var w = new XamlObjectWriter (xamlReader.SchemaContext);
			Transform (xamlReader, w);
			return w.Result;
		}
Exemplo n.º 5
0

        
Exemplo n.º 6
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 ();
		}
Exemplo n.º 7
0
		public static void Transform (XamlReader xamlReader, XamlWriter xamlWriter)
		{
			Transform (xamlReader, xamlWriter, true);
		}
Exemplo n.º 8
0
		internal XamlSubtreeReader (XamlReader source)
		{
			this.source = source;
		}
Exemplo n.º 9
0
 public abstract object Load(XamlReader xamlReader, IServiceProvider serviceProvider);
Exemplo n.º 10
0
 internal XamlSubtreeReader(XamlReader source)
 {
     this.source = source;
 }
		public abstract object Load (XamlReader xamlReader, IServiceProvider serviceProvider);