Mono.Xaml.XamlParser.ParseException C# (CSharp) Méthode

ParseException() private méthode

private ParseException ( string message ) : System.Windows.Markup.XamlParseException
message string
Résultat System.Windows.Markup.XamlParseException
		internal XamlParseException ParseException (string message, params object [] p)
		{
			int pos = -1;
			int line = -1;

			IXmlLineInfo linfo = reader as IXmlLineInfo;
			if (linfo != null) {
				line = linfo.LineNumber;
				pos = linfo.LinePosition;
			}

			return new XamlParseException (line, pos, String.Format (message, p));
		}

Usage Example

Exemple #1
0
		private static unsafe IntPtr ParseTemplate (Value *context_ptr, string resource_base, IntPtr surface, IntPtr binding_source, string xaml, ref MoonError error)
		{
			XamlContext context = Value.ToObject (typeof (XamlContext), context_ptr) as XamlContext;

			var parser = new XamlParser (context);

			var source = NativeDependencyObjectHelper.FromIntPtr (binding_source);
			if (source == null) {
				error = new MoonError (parser.ParseException ("Attempting to parse a template with an invalid binding source."));
				return IntPtr.Zero;
			}

			FrameworkElement fwe = source as FrameworkElement;
			if (fwe == null) {
				error = new MoonError (parser.ParseException ("Only FrameworkElements can be used as TemplateBinding sources."));
				return IntPtr.Zero;
			}

			context.IsExpandingTemplate = true;
			context.TemplateBindingSource = fwe;

			INativeEventObjectWrapper dob = null;
			try {
				dob = parser.ParseString (xaml) as INativeEventObjectWrapper;
			} catch (Exception e) {
				error = new MoonError (e);
				return IntPtr.Zero;
			}

			if (dob == null) {
				error = new MoonError (parser.ParseException ("Unable to parse template item."));
				return IntPtr.Zero;
			}

			return dob.NativeHandle;
		}
All Usage Examples Of Mono.Xaml.XamlParser::ParseException