private void Release()
 {
     if (this.comObject != null)
     {
         Marshal.ReleaseComObject(this.comObject);
         this.comObject = null;
     }
 }
Example #2
0
        public static IComObject <ID2D1GeometryGroup> CreateGeometryGroup(this ID2D1Factory factory, D2D1_FILL_MODE fillMode, IReadOnlyList <ID2D1Geometry> geometries)
        {
            if (factory == null)
            {
                throw new ArgumentNullException(nameof(factory));
            }

            if (geometries == null)
            {
                throw new ArgumentNullException(nameof(geometries));
            }

            if (geometries.IsEmpty())
            {
                throw new ArgumentException(null, nameof(geometries));
            }

            factory.CreateGeometryGroup(fillMode, geometries.ToArray(), geometries.Count, out var geometry).ThrowOnError();
            return(new ComObject <ID2D1GeometryGroup>(geometry));
        }
Example #3
0
 private static extern int D2D1CreateFactory(D2D1_FACTORY_TYPE factoryType, [MarshalAs(UnmanagedType.LPStruct)] Guid riid, IntPtr pFactoryOptions, out ID2D1Factory ppIFactory);
 private D2D1Factory(ID2D1Factory obj)
 {
     this.comObject = obj;
 }
 public static extern void D2D1CreateFactory(
     [In] D2D1FactoryType factoryType,
     [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid,
     [In] IntPtr factoryOptions,
     [Out] out ID2D1Factory factory);
Example #6
0
        public static IComObject <ID2D1RoundedRectangleGeometry> CreateRoundedRectangleGeometry(this ID2D1Factory factory, D2D1_ROUNDED_RECT rectangle)
        {
            if (factory == null)
            {
                throw new ArgumentNullException(nameof(factory));
            }

            factory.CreateRoundedRectangleGeometry(ref rectangle, out var geometry).ThrowOnError();
            return(new ComObject <ID2D1RoundedRectangleGeometry>(geometry));
        }
 internal D2D1Factory(ID2D1Factory factory)
 {
     this.factory = factory;
 }
 internal D2D1Factory(ID2D1Factory factory)
 {
     this.factory = factory;
 }