Uno.SkiaSharp/binding/Binding/SKXml.cs

50 строки
844 B
C#
Исходник Обычный вид История

2017-01-16 16:06:16 +03:00
//
// Bindings for Skia's XML features
//
// Author:
// Matthew Leibowitz
//
// Copyright 2017 Xamarin Inc
//
using System;
namespace SkiaSharp
{
public abstract class SKXmlWriter : SKObject
{
internal SKXmlWriter (IntPtr h, bool owns)
: base (h, owns)
{
}
}
public class SKXmlStreamWriter : SKXmlWriter
{
[Preserve]
internal SKXmlStreamWriter (IntPtr h, bool owns)
: base (h, owns)
{
}
public SKXmlStreamWriter (SKWStream stream)
: this (IntPtr.Zero, true)
{
if (stream == null) {
throw new ArgumentNullException (nameof (stream));
}
Handle = SkiaApi.sk_xmlstreamwriter_new (stream.Handle);
}
protected override void Dispose (bool disposing)
{
if (Handle != IntPtr.Zero && OwnsHandle) {
SkiaApi.sk_xmlstreamwriter_delete (Handle);
}
base.Dispose (disposing);
}
}
}