コード例 #1
0
		public XamlBackgroundReader (XamlReader wrappedReader)
		{
			if (wrappedReader == null)
				throw new ArgumentNullException ("wrappedReader");
			r = wrappedReader;
			q = new XamlNodeQueue (r.SchemaContext) { LineInfoProvider = r as IXamlLineInfo };
		}
コード例 #2
0
ファイル: XamlWriter.cs プロジェクト: Core2D/Portable.Xaml
		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
			}
		}
コード例 #3
0
		public XamlNodeQueue (XamlSchemaContext schemaContext)
		{
			if (schemaContext == null)
				throw new ArgumentNullException ("schemaContext");
			this.ctx = schemaContext;
			reader = new XamlNodeQueueReader (this);
			writer = new XamlNodeQueueWriter (this);
		}
コード例 #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;
		}
コード例 #5
0

        
コード例 #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 ();
		}
コード例 #7
0
		public static void Transform (XamlReader xamlReader, XamlWriter xamlWriter)
		{
			Transform (xamlReader, xamlWriter, true);
		}
コード例 #8
0
		internal XamlSubtreeReader (XamlReader source)
		{
			this.source = source;
		}
コード例 #9
0
 public abstract object Load(XamlReader xamlReader, IServiceProvider serviceProvider);
コード例 #10
0
 internal XamlSubtreeReader(XamlReader source)
 {
     this.source = source;
 }
コード例 #11
0
		public abstract object Load (XamlReader xamlReader, IServiceProvider serviceProvider);