Quantcast
Channel: xInterop C++ .NET Bridge
Viewing all 31 articles
Browse latest View live

Can I export a C++ interface with C-Style methods to a C# DLL?

$
0
0

This is a question posted right here on the stack overflow web site. None of the answers are completely correct since they do not address the real issue of the question. I consider those answers are work-around and they are not direct solution.

With using xInterop C++ .NET Bridge, the answer of course is, YES.

In C++, there is really no concept of an interface, the OP referred to the C++ abstract class by stating C++ interface. So let’s change the question to

Can I export a C++ abstract class with C-Style methods to a C# DLL?

Stating exporting a C++ abstract (base) class is not completely correct, it is useless to export a C++ abstract base class as an interface, because most of the instance methods are pointing to the address of the pure virtual method. Remember all the instance methods except the destructor are pure virtual methods if you want to represent an interface using a C++ abstract base class. There are a lot of talks about this topic on stack overflow web site, the followings are just some of them,

http://stack overflow.com/questions/12854778/abstract-class-vs-interface-in-c

http://stackoverflow.com/questions/318064/how-do-you-declare-an-interface-in-c?noredirect=1&lq=1

The real issue of the question represents is how one can retrieve the pointer and the virtual function table of a C++ abstract class, how one can find the virtual function address and marshal it to a C# .NET delegate. Okay, let’s discuss this question and answer step by step.

Assuming we have an interface named ICalculator which defines 4 methods, Add, Subtract, Multiply and Divide respectively as shown below.

class ICalculator
{
public:
    virtual ~ICalculator(void) {};
    virtual int Add(int a, int b) = 0;
    virtual int Subtract(int a, int b) = 0;
    virtual int Multiply(int a, int b) = 0;
    virtual int Divide(int a, int b) = 0;
};

Remember we already said that we can’t export ICaculator class because all the instance methods, Add, Subtract, Multiply and Divide are pure virtual methods, they are pointing to the pure virtual methods, even you export them, you will be calling into the pure virtual methods when you call any of the methods. This means writing the following code won’t work as expected if you intend to call methods on any ICalculator instance.

#ifdef MATHLIB_EXPORTS
#define MATHLIB_API __declspec(dllexport)
#else
#define MATHLIB_API __declspec(dllimport)
#endif

class ICalculator;

class MATHLIB_API ICalculator
{
public:
    virtual ~ICalculator(void) {};
    virtual int Add(int a, int b) = 0;
    virtual int Subtract(int a, int b) = 0;
    virtual int Multiply(int a, int b) = 0;
    virtual int Divide(int a, int b) = 0;
};

So if we can’t export ICalculator, how do we get an instance of ICaculator. As the OP asked, what is desired to export a c-style method to return an instance of a class deriving from the abstract base class. But first, lets implement a new class which is derived from ICalculator.

class Calculator : ICalculator
{
public:
    Calculator() {};
    virtual ~Calculator(void) {};
    virtual int Add(int a, int b) { return a + b; };
    virtual int Subtract(int a, int b) { return a - b; };
    virtual int Multiply(int a, int b) { return a * b; };
    virtual int Divide(int a, int b) { return a / b; };
};

Now let’s simply return a pointer of a global variable of an instance of Calculator.

Calculator calculator;

ICalculator * GetCalculator(void)
{
    return &calculator;
}

And the last thing is to define an export entry in the .def file.

LIBRARY MathLib

EXPORTS

    GetCalculator                @1

When you build the DLL, all you get from the native DLL is just one method of GetCalculator as shown in the following screen-shot. I was using Explorer Suite to analyze the PE information of the native DLL, you may download the application from here. It is free thanks to Daniel Pistelli.

Export function GetCalculator using Explorer Suite

Now that we have built the native DLL of MathLib, we would want to create a .NET wrapper assembly using xInterop C++ .NET Bridge. Let’s fire up xInterop C++ .NET Bridge. For a native DLL as simple as MathLib which has only one header file to include, I will just show you a few screen-shots demonstrating how you can create an xInterop C++ .NET bridge project. I am using xInterop C++ .NET Bridge standard version .NET to native C++ bridge. The feature of creating C# wrapper class for a C++ abstract class is currently not included in the trial/evaluation version.

image

image

image

image

By adding ICalculator as an abstract class in the preceding GUI, we are telling xInterop C++ .NET Bridge to create a C# wrapper class for ICalculator.

Now, let’s generate the source code of all the C# wrapper class and the project file and solution file.

image

Once xInterop C++ .NET Bridge completes generating the C# wrapper source code, you will see the following message in the output window.

image

On the right site of xInterop C++ .NET Bridge, it is the solution explorer. You can see the complete solution as shown below.

image

Let’s look at the static C# wrapper method for GetCalculator,

public static ICalculator GetCalculator()
{
    try
    {
        // Retrieve the pointer of an instance of C++ ICalculator derived class, which is the class of Calculator.
        var  ___localReturnValue___ = MathLibWin32.MathLibWrapper_GetCalculator();
 
        // Construct a new C# ICalculator instance. ICalculator is not a C# interface.
        return ___localReturnValue___ != IntPtr.Zero ? new ICalculator(___localReturnValue___, IntPtr.Zero, false) : null;
    }
    catch(SEHException exception)
    {
        // throw an enhanced SEH exception which may contain the error message of original C++ exception.
        throw EnhancedSEHExceptionManager.Create(exception);
    }
}

[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.LinkDemand, Unrestricted = true)]
[System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptions]
[System.Security.SuppressUnmanagedCodeSecurity]
[System.Runtime.InteropServices.DllImport(___DllName___, EntryPoint = "?GetCalculator@MathLibWrapper@@SAPAVICalculator@@XZ", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
public extern static IntPtr MathLibWrapper_GetCalculator();

The followings are the C# wrapper method for Add, Subtract, Multiply and Divide.

public virtual int Add(int a, int b)
{
    try
    {
        var ___localReturnValue___ = this.delegateOfICalculator_AddDelegate(this.___ptrObject___, a, b);
        GC.KeepAlive(this);
        return ___localReturnValue___;
    }
    catch(SEHException exception)
    {
        // throw an enhanced SEH exception which may contain the error message of orignal C++ exception.
        throw EnhancedSEHExceptionManager.Create(exception);
    }
}

public virtual int Divide(int a, int b)
{
    try
    {
        var ___localReturnValue___ = this.delegateOfICalculator_DivideDelegate(this.___ptrObject___, a, b);
        GC.KeepAlive(this);
        return ___localReturnValue___;
    }
    catch(SEHException exception)
    {
        // throw an enhanced SEH exception which may contain the error message of orignal C++ exception.
        throw EnhancedSEHExceptionManager.Create(exception);
    }
}

public virtual int Multiply(int a, int b)
{
    try
    {
        var ___localReturnValue___ = this.delegateOfICalculator_MultiplyDelegate(this.___ptrObject___, a, b);
        GC.KeepAlive(this);
        return ___localReturnValue___;
    }
    catch(SEHException exception)
    {
        // throw an enhanced SEH exception which may contain the error message of orignal C++ exception.
        throw EnhancedSEHExceptionManager.Create(exception);
    }
}

public virtual int Subtract(int a, int b)
{
    try
    {
        var ___localReturnValue___ = this.delegateOfICalculator_SubtractDelegate(this.___ptrObject___, a, b);
        GC.KeepAlive(this);
        return ___localReturnValue___;
    }
    catch(SEHException exception)
    {
        // throw an enhanced SEH exception which may contain the error message of orignal C++ exception.
        throw EnhancedSEHExceptionManager.Create(exception);
    }
}

Because all the four methods are not exported, but we do know the address of the virtual function table and the index of the each virtual method, we can look into the virtual function table and get the address of each function and turn them into each delegate which we can call in the proceeding code. You can download xInterop C++ .NET Bridge and try yourself, the above code was generated by a paid version, if a trial version is used, the generated source code is obfuscated, you will still be able to test each generated C# methods though.

The post Can I export a C++ interface with C-Style methods to a C# DLL? appeared first on xInterop C++ .NET Bridge.


Inheriting from native C++ in C# and passing the inherit class backward to c++

$
0
0

How to inherit from a native C++ class in C# and then use the class in native C++?

To answer this question, what we need to do from C# is to achieve the following 3 things,

  • Subclass/inherit C++ classes from C#

  • Override C++ methods with C# methods

  • Expose or pass the instances of C# class to C++ as if they were native code

Just like using C++/CLI, there is simply no way we can override any C++ virtual method directly using C# class by deriving from the native C++ class, we are talking about two different language. What xInterop C++ .NET Bridge can do is to create a wrapper bridge C# class for the underlying native C++ class, and developers can subclass or inherit from the wrapper C# class.

There are multiple scenario that we would want to inherit from the native C++ class. What I can think about is,

1. Some or all of the existing implementation of the virtual methods of the underlying C++ class do not meet our requirements, we would want to override those methods from C#.

2. The native C++ class is an abstract class representing an interface, we will have to implement in C# before we can pass an instance of such interface back to the native C++.

I will be presenting a simple example for us to look into the details of such a scenario that we must implement a so called C++ interface from C#.

// C++ abstract class representing an interface of INotification.
class INotification
{
public:
    // Always reserve a slot in the virtual function table so that we can make sure any derived class's destructor be called.
    virtual ~INotification() {};

    // A function to notify that a message has arrived.
    virtual void OnNotify(const char * message) = 0;
};

// Initialize the DLL with a pointer to the given C++ abstract class.
void Initialize(INotification * notification);

// Called to notify with a given message.
void Notify(const char * message);

We are only going to export two methods from this native DLL.

LIBRARY LibCallback
EXPORTS
    Initialize            @1
    Notify                @2

The following screenshots show how I was able to create the xInterop C# wrapper project using xInterop C++ .NET Bridge.

Step 1: Choose the type of xInterop project.

image

Step 2: Create xInterop C++ .NET Bridge project.

image

Step 3: Set up a new .NET to Native C++ Bridge project.

image

Step 4: Further configuration of the .NET to Native C++ Bridge project.

image

Step 5: Add abstract class.

image

Step 6: How to choose to add a callback class.

image

Step 7: Add a callback class

Since we want to override the C++ method in C#, we must tell xInterop C++ .NET Bridge to treat the class of INotification callback class. A callback class in C# would allow us to override the virtual methods, in the case that we need to pass an instance of the C++ class, we may pass an appointer of the C# class.

image

Step 8: Generate the C# wrapper source code.

image

Step 9: The logging message.

image

Step 10: The source code structure.

image

The following virtual method is the one we will need to override in C#. Since an instance of the class of INotification is created from C# without calling the constructor of the native C++ class, there is no virtual function address to be initialize by the native C++ if the class is not sub-classed. The delegate variable is actually null.

public virtual void OnNotify(string message)
{
    try
    {
        this.delegateOfINotification_OnNotifyDelegate(this.___ptrObject___, message);
        GC.KeepAlive(this);
    }
    catch(SEHException exception)
    {
        // throw an enhanced SEH exception which may contain the error message of orignal C++ exception.
        throw EnhancedSEHExceptionManager.Create(exception);
    }
}

In order to use the generated C# .NET assembly, we also created a console application named NotificationDemo to demonstrate how to call the C# callback class.

First, we will need to derive from the existing C# wrapper class of INotifiication.

public class Notification : INotification
{
    public Notification()
    {
    }

    public override void OnNotify(string message)
    {
        Console.WriteLine(message);
    }
}

Secondly, we will need to create the Program class and Main method to call all the related C# methods to pass the message to the underlying native DLL and gets callback to the Notification class.

using System;
using xInterop.Win32.LibCallback;

namespace NotificationDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            // Creates an instance of Notification which derives from the C# bridge class of INotification.
            Notification notificaiton = new Notification();

            // Initialize the underlying native DLL by passing an instance of the Notification class.
            LibCallbackWrapper.Initialize(notificaiton);

            // Notify the underlying native DLL with a message. This call will call back to Notification class.
            LibCallbackWrapper.Notify("This is a C# message passed to native C++ DLL which then gets passed back into C# by using callback class.");
        }
    }
}

The post Inheriting from native C++ in C# and passing the inherit class backward to c++ appeared first on xInterop C++ .NET Bridge.

12 New Features of xInterop C++ .NET Bridge with Native C++ to .NET Bridge

$
0
0

We have been busying working on lots of new features of xInterop C++ .NET Bridge for more than a year and I have not been able to find time to write technical article for too long, and I found the last time I wrote about Native C++ to .NET Bridge was 15 months ago. Since then, the features of Native C++ .NET Bridge is getting much richer, actually, the other bridge, .NET to Native C++ Bridge has gained lots of new features too.

If you don’t know already, xInterop Native C++ .NET Bridge is based on P/Invoke (PInvoke), Reverse P/Invoke (Reverse PInvoke) and also xInterop Technology on top of xInterop .NET to Native C++ Bridge. If you are currently using C++/CLI or about to use C++/CLI, xInterop C++ .NET Bridge is the perfect candidate to replace C++/CLI, it is much better than C++/CLI in terms of productivity and it lets you build native C++ bridge DLL automatically for the targeting .NET assembly, developers can even use post-build script to build the native C++ bridge DLL automatically every time the targeting .NET assembly is changed and rebuilt.

Let’s take a look what we have added since the last time we blogged about it.

The following is the configuration window of the earlier version of Native C++ to .NET Bridge.

And the following is the current configuration window of Native C++ to .NET Bridge.

image

As you can see from the differences of the two screen-shots, there are lots of new features and changes. Let’s examine each of them one by one.

1. Honor .NET namespace

The earlier version of xInterop C++ .NET Bridge puts all bridge C++ classes, enums in the namespace of xinterop, we have changed to enable users to honor the .NET namespaces. It seems a very small change, but because the Native C++ to .NET Bridge relies on the .NET to Native C++ Bridge, we had to make Native C++ Bridge support namespace first. I am giving you a few examples of the C++ namespaces matching to the corresponding .NET namespaces. It is an option, users can still choose to map all namespaces to xinterop namespace for simplicity, not everyone likes complicated namespaces and having to either type “using namespaces” or full type of each of c++ bridge classes and enum. But this won’t work when there is duplicate class name, struct name, enum name in different namespaces, it will cause compiler error when xInterop C++ .NET Bridge tries to build the native C++ bridge DLL. Honoring .NET namespace resolves this kind of issue.

image

System::Object                        System.Object
System::Type                          System.Type
System::Reflection::MemberInfo        System.Reflection.MemberInfo

image

xinterop::Object                      System.Object
xinterop::Type                        System.Type
xinterop::MemberInfo                  System.Reflection.MemberInfo

2. Debug and Release version of the native C++ Bridge.

Any auto-generated Native C++ bridge DLL relies on the also-auto-generated .NET bridge assembly to communicate with the original .NET assembly, at present, the .NET bridge assembly are configuration specific, its debug version can only communicate with the debug version, the release version can only communicate with the release version, the reason for that is the size of instance of each class may be different in the debug version and release version. When the native C++ bridge DLL is used in a C++ application, the debug version and release version can’t be mixed, a debug version of the C++ application can not call a release version of the DLL, a release version of the C++ application can’t call a debug version of the DLL, the native C++ bridge DLL is a normal native DLL. If users try to build a C++ application by linking to the native C++ bridge DLL in a different configuration, it will trigger a compiler error.

3. .NET exception handling

Any call from the Native C++ bridge DLL into .NET method including constructor may trigger .NET exception which can be handled by the .NET bridge assembly and then a C++ exception can be raised in the Native C++ bridge DLL with all the available information from the original .NET exception, including message and stack trace, etc.

4. Simulate .NET property and index

.NET class may have property or index while C++ language do not have concept of property and index. In the earlier version of xInterop C++ .NET Bridge, a property with a name of get_Value gets mapped to a C++ method of get_Value. With this new feature, an instance property of .NET becomes a property of the native C++ bridge class, an .NET index also have corresponding index in the native C++ class. This feature does not support static property.

5. Support WPF

When the option of Support WPF is enabled, xInterop C++ .NET Bridge will create bridge classes for all necessary WPF controls to support create and manipulate WPF windows and controls from the native C++ application using the native C++ bridge DLL.

6. Support WinForm

When the option of Support WinForm is enabled, xInterop C++ .NET Bridge will create bridge classes for all necessary WinForm controls to support create and manipulate WinForm windows and controls from the native C++ application using the native C++ bridge DLL.

7. Support WinForm controls

When the option of Support WinForm controls is enabled, xInterop C++ .NET Bridge will create bridge classes for all windows WinForm controls so that users do not have choose the controls by themselves.

8. Support WCF service

When the option of Support WCF service is enabled, xInterop C++ .NET Bridge will create bridge classes for all necessary .NET classes to support create and manipulate WCF service from the native C++ application using the native C++ bridge DLL.

9. Support .NET extension methods

The extension methods are defined outside of the original class declaration, mostly, it is implemented in a different assembly than the one implementing the original .NET class. To find the extension methods, xInterop C++ .NET Bridge will have to iterate each classes of all the assemblies involved. The option can be turned off if extension method is not a concern.

10. .NET type selection

When targeting a certain assembly, if users are not interested in creating bridge C++ classes for all .NET classes, or they are interested in creating bridge C++ class for other .NET classes outside of the targeting assembly, such as the .NET classes implemented by the .NET framework, they can choose which classes to be bridged.

11. Static read-only field optimization

A .NET static read-only field may contained a fixed value through out of the lifetime of an application. Once being fetched, the value never changes. When this feature is enabled, xInterop C++ .NET Bridge will create code caching the value in the native C++ bridge, no call shall be made the next time the same static read-only field is accessed.

12. Targeting .NET framework different from the framework of the .NET assembly.

The original .NET assembly may be targeting earlier version of .NET framework, such as .NET framework 2.0, this feature allows users to target a higher version of .NET framework when using the native C++ bridge DLL together with the .NET bridge assembly.

The post 12 New Features of xInterop C++ .NET Bridge with Native C++ to .NET Bridge appeared first on xInterop C++ .NET Bridge.

Using PdfSharp, a .NET Library for Processing PDF from Native C++

$
0
0

PDFsharp is the Open Source .NET library that easily creates and processes PDF documents on the fly from any .NET language. The same drawing routines can be used to create PDF documents, draw on the screen, or send output to any printer.

PDFsharp has the following key features,

  • Creates PDF documents on the fly from any .NET language
  • Easy to understand object model to compose documents
  • One source code for drawing on a PDF page as well as in a window or on the printer
  • Modify, merge, and split existing PDF files
  • Images with transparency (color mask, monochrome mask, alpha mask)
  • Newly designed from scratch and written entirely in C#
  • The graphical classes go well with .NET

With xInterop Native C++ to .NET Bridge, we can create a native C++ bridge DLL for the PDFsharp library assembly easily. By creating a native C++ bridge to the PDFsharp library assembly, we got ourselves a very nice and powerful C++ PDF library. And PDFsharp is published under the MIT License. Once you have a paid version of xInterop Native C++ to .NET bridge, you can create Native C++ bridge DLL to as many as .NET library as you want, including PDFsharp library.

C++/CLI can also be used to create C++ bridge/wrapper to PDFsharp library assembly, but it will take too much time to create such a C++ bridge/wrapper to such a library as complicated as PDFsharp library. On top of that, developers will have to learn C++/CLI if they have not already, in my opinion, it is a pain to learn C++/CLI. If you already have C++ knowledge, it costs you nothing to learn xInterop Native C++ to .NET Bridge, it is just as simple as configuration using a few forms/windows.

Let’s start creating an xInterop Native C++ to .NET Bridge project.

Step 1: Create a new xInterop C++ .NET Bridge

image

Step 2: Choose Native C/C++ to .NET Bridge project

image

Step 3: Sets up the targeting .NET assembly and the options.

image

Step 4: Choose the .NET classes to create native C++ bridge classes.

image

Step 5: Start creating the Native C++ Bridge DLL and associated .NET Bridge assembly Visual Studio project.

image

The process of creating a Native C++ Bridge DLL and associated .NET Bridge assembly Visual Studio project is much slower than simply creating a .NET to Native C++ Bridge whose underlying native C++ usually contains less C++ classes. It usually takes between minutes to hours depending on the number of classes contained in the .NET assembly, or the number of .NET classes users pick. But it is the computer who does the job, once set up and configured, users barely need to do anything to the Native C++ Bridge DLL, it is ready for use immediately after it is done.

Step 5:

image

image

Step 6: Open the TestApp Visual Studio Solution

image

When you look at the TestApp.cpp file, you will find that a skeleton application has already been created as the code shows below.

// ----------------------------------------------------------------------------
// <copyright file="TestApp.cpp" company="xInterop Software, LLC">
// Copyright (c) 2016 xInterop Software, LLC. All rights reserved.
// http://www.xinterop.com
// </copyright>
//
// NOTICE:  All information contained herein is, and remains the property of 
// xInterop Software, LLC, if any. The intellectual and technical concepts 
// contained herein are proprietary to xInterop Software, LLC and may be 
// covered by U.S. and Foreign Patents, patents in process, and are protected 
// by trade secret or copyright law. Dissemination of this information or 
// reproduction of this material is strictly forbidden unless prior written 
// permission is obtained from xInterop Software, LLC. 
//
// This copyright header must be kept intact without any change under any circumstances.
//
// The source code of this file can NOT be re-distributed to any third parties
// unless certain OEM license has been arranged and written permission has been
// authorized by xInterop Software, LLC.
//
// ----------------------------------------------------------------------------

#include "stdafx.h"
#include <Ole2.h>

#include "../Native/Include/PdfSharpgdiBridge.h"

#ifdef _WIN64
#pragma comment(lib, "../Native/Lib/x64/PdfSharpgdiBridge.lib")
#else
#pragma comment(lib, "../Native/Lib/win32/PdfSharpgdiBridge.lib")
#endif

using namespace::xinterop;

int _tmain(int argc, _TCHAR* argv[])
{    
    ///////////////////////////////////////////////////////////////////////////////////////////////
    //
    // Notes:
    //
    // This file was created when "Load .NET bridge assembly automatically" option was turned on.
    //
    // The C# bridge assembly shall be loaded and initialized automatically when any c++     
    // class of the C++ bridge DLL is accessed.
    //
    // The C# bridge assembly can also be loaded and initialized by calling xiInitializeBridgeAssembly.
    //
    ///////////////////////////////////////////////////////////////////////////////////////////////

    CoInitializeEx(0, COINIT_APARTMENTTHREADED);

    ///////////////////////////////////////////////////////////////////////////////////////////////
    // Add your code here.
    ///////////////////////////////////////////////////////////////////////////////////////////////






    ///////////////////////////////////////////////////////////////////////////////////////////////
    // End of your code.
    ///////////////////////////////////////////////////////////////////////////////////////////////

    CoUninitialize();

    exit(0);

    return 0;
}

We are also showing you the partial header file of the PDFsharp native C++ bridge DLL.

// ----------------------------------------------------------------------------
// <copyright file="PdfSharpgdiBridge.h" company="xInterop Software, LLC">
// Copyright (c) xInterop Software, LLC. All rights reserved.
// http://www.xinterop.com
// </copyright>
//
// NOTICE:  All information contained herein is, and remains the property of 
// xInterop Software, LLC, if any. The intellectual and technical concepts 
// contained herein are proprietary to xInterop Software, LLC and may be 
// covered by U.S. and Foreign Patents, patents in process, and are protected 
// by trade secret or copyright law. Dissemination of this information or 
// reproduction of this material is strictly forbidden unless prior written 
// permission is obtained from xInterop Software, LLC. 
//
// This copyright header must be kept intact without any change under any circumstances.
//
// The source code of this file can NOT be re-distributed to any third parties
// unless certain OEM license has been arranged and written permission has been
// authorized by xInterop Software, LLC.
//
// If you are using/including this header file, please make sure you purchase 
// the right version of xInterop C++ .NET Bridge before you deploy/distribute any product 
// depending on this header file. Please contact us at license@xinterop.com should 
// you have any questions regarding our licensing.
//
// The file was generated by xInterop C++ .NET Bridge, Debug Version 3.3.8.2701, 
// a C# wrapper generator for native C++ DLL. 

// The file should not be modified or it won't work correctly with the DLL. 
//
// The file was generated at 11:04 PM on 8/28/2016.
// ----------------------------------------------------------------------------

#ifndef __PDFSHARPGDIBRIDGE_H__
#define __PDFSHARPGDIBRIDGE_H__


#ifndef _DEBUG
    #error PdfSharpgdiBridge bridge native DLL was compiled as a DEBUG version. Please change the configurion option of xInterop C++ .NET Bridge project to RELEASE and create a RELEASE version of the bridge DLL.
#endif


#ifdef PDFSHARPGDIBRIDGE_EXPORTS
    #define PDFSHARPGDIBRIDGE_API __declspec(dllexport)
#else
    #define PDFSHARPGDIBRIDGE_API __declspec(dllimport)
#endif



///////////////////////////////////////////////////////////////////////////////
//
// C++ class forward declaration.
//
///////////////////////////////////////////////////////////////////////////////

namespace System
{
    class Object;
}

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class CodeBase;
        }
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class BarCode;
        }
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class ThickThinBarCode;
        }
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class Code2of5Interleaved;
        }
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class Code3of9Standard;
        }
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class CodeOmr;
        }
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class MatrixCode;
        }
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class CodeDataMatrix;
        }
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        namespace Layout
        {
            class XTextFormatter;
        }
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XPdfFontOptions;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XBitmapDecoder;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XBitmapEncoder;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XImage;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XBitmapSource;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XBitmapImage;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XForm;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XPdfForm;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XBrush;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XLinearGradientBrush;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XSolidBrush;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XBrushes;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XColor;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XColorResourceManager;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XColors;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XFont;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XFontFamily;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XFontMetrics;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XGraphics;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XGraphicsXGraphicsInternals;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XGraphicsSpaceTransformer;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XGraphicsContainer;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XGraphicsPath;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XGraphicsPathInternals;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XGraphicsState;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XImageFormat;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XMatrix;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XPen;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XPens;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XPoint;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XPrivateFontCollection;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XRect;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XSize;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XStringFormat;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XStringFormats;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XUnit;
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        class XVector;
    }
}

namespace PdfSharp
{
    namespace Fonts
    {
        class FontResolverInfo;
    }
}

namespace PdfSharp
{
    namespace Fonts
    {
        class GlobalFontSettings;
    }
}

namespace PdfSharp
{
    namespace Fonts
    {
        class PlatformFontResolver;
    }
}

namespace PdfSharp
{
    namespace Forms
    {
        class ColorComboBox;
    }
}

namespace PdfSharp
{
    namespace Forms
    {
        class DeviceInfos;
    }
}

namespace PdfSharp
{
    namespace Forms
    {
        class PagePreview;
    }
}

namespace PdfSharp
{
    namespace Forms
    {
        class RenderEvent;
    }
}

namespace PdfSharp
{
    namespace Internal
    {
        class DebugBreak;
    }
}

namespace PdfSharp
{
    namespace Internal
    {
        class FontsDevHelper;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfItem;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfObject;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfDictionary;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfAcroField;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfButtonField;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfCheckBoxField;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfPushButtonField;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfRadioButtonField;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfChoiceField;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfComboBoxField;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfListBoxField;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfGenericField;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfSignatureField;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfTextField;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfAcroForm;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Actions
        {
            class PdfAction;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Actions
        {
            class PdfGoToAction;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfCatalog;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfFont;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfContent;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfDictionaryWithContentStream;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfShadingPattern;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfTilingPattern;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfExtGState;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfFontDescriptor;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfXObject;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfFormXObject;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfImage;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfGroupAttributes;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfTransparencyGroupAttributes;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfObjectStream;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfResources;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfShading;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfSoftMask;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Annotations
        {
            class PdfAnnotation;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Annotations
        {
            class PdfLinkAnnotation;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Annotations
        {
            class PdfRubberStampAnnotation;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Annotations
        {
            class PdfTextAnnotation;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Security
        {
            class PdfSecurityHandler;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Security
        {
            class PdfStandardSecurityHandler;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfCustomValue;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfCustomValues;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfDocumentInformation;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfOutline;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfPage;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfPages;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfViewerPreferences;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfArray;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfAcroFieldPdfAcroFieldCollection;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfContents;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Annotations
        {
            class PdfAnnotations;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfBooleanObject;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfDocument;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfNumberObject;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfIntegerObject;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfRealObject;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfUIntegerObject;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfNameObject;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfNullObject;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfOutlineCollection;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfStringObject;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfReference;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfBoolean;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfDate;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfNumber;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfInteger;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfReal;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfUInteger;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfLiteral;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfName;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfNull;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfRectangle;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfString;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfDictionaryDictionaryElements;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfDictionaryPdfStream;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class KeysBase;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfDictionaryPdfStreamKeys;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfDictionaryWithContentStreamKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfXObjectKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfFormXObjectKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfImageKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfObjectStreamKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfAcroFieldKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfButtonFieldKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfCheckBoxFieldKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfRadioButtonFieldKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfChoiceFieldKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfComboBoxFieldKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfGenericFieldKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfListBoxFieldKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfPushButtonFieldKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfSignatureFieldKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfTextFieldKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            class PdfAcroFormKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfFontKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfFontDescriptorKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfGroupAttributesKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfTransparencyGroupAttributesKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfResourcesKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfSoftMaskKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Annotations
        {
            class PdfAnnotationKeys;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfArrayArrayElements;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfResourceTable;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfExtGStateTable;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfInternals;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Advanced
        {
            class PdfObjectInternals;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
class CObject;
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
class CComment;
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
class CSequence;
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
class CArray;
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
class CNumber;
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
class CInteger;
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
class CReal;
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
class CString;
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
class CName;
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
class COperator;
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
class OpCode;
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
class OpCodes;
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            class CLexer;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            class ContentReader;
        }
    }
}

namespace System
{
    class Exception;
}

namespace PdfSharp
{
    class PdfSharpException;
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            class ContentReaderException;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace IO
        {
            class PdfReaderException;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            class CParser;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Filters
        {
            class Filter;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Filters
        {
            class Ascii85Decode;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Filters
        {
            class AsciiHexDecode;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Filters
        {
            class FlateDecode;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Filters
        {
            class LzwDecode;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Filters
        {
            class FilterParms;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Filters
        {
            class Filtering;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Internal
        {
            class AnsiEncoding;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Internal
        {
            class RawEncoding;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace IO
        {
            class Chars;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace IO
        {
            class Lexer;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace IO
        {
            class PdfPasswordProviderArgs;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace IO
        {
            class PdfPasswordProvider;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace IO
        {
            class PdfReader;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Security
        {
            class PdfSecuritySettings;
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfDocumentOptions;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfDocumentSettings;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfNamePdfXNameComparer;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class PdfObjectID;
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        class TrimMargins;
    }
}

namespace PdfSharp
{
    class PageSizeConverter;
}

namespace PdfSharp
{
    class ProductVersionInfo;
}

namespace xinterop
{
    class ObjectConverter;
}

namespace System
{
    namespace Reflection
    {
        class MemberInfo;
    }
}

namespace System
{
    class Type;
}

namespace System
{
    namespace IO
    {
        class Stream;
    }
}

namespace System
{
    namespace IO
    {
        class MemoryStream;
    }
}

namespace System
{
    namespace Drawing
    {
        class Image;
    }
}

namespace System
{
    namespace Drawing
    {
        class Color;
    }
}

namespace System
{
    namespace Globalization
    {
        class CultureInfo;
    }
}

namespace xinterop
{
    class GenericXKnownColorArray;
}

namespace System
{
    namespace Drawing
    {
        class FontFamily;
    }
}

namespace System
{
    namespace Drawing
    {
        class Font;
    }
}

namespace System
{
    namespace Drawing
    {
        class Graphics;
    }
}

namespace System
{
    namespace Drawing
    {
        class Point;
    }
}

namespace System
{
    namespace Drawing
    {
        class PointF;
    }
}

namespace xinterop
{
    class GenericPointArray;
}

namespace xinterop
{
    class GenericPointFArray;
}

namespace xinterop
{
    class GenericXPointArray;
}

namespace xinterop
{
    class GenericDoubleArray;
}

namespace System
{
    namespace Drawing
    {
        class Rectangle;
    }
}

namespace System
{
    namespace Drawing
    {
        class RectangleF;
    }
}

namespace xinterop
{
    class GenericRectangleArray;
}

namespace xinterop
{
    class GenericRectangleFArray;
}

namespace xinterop
{
    class GenericXRectArray;
}

namespace System
{
    namespace Drawing
    {
        class Size;
    }
}

namespace System
{
    namespace Drawing
    {
        class SizeF;
    }
}

namespace xinterop
{
    class GenericByteArray;
}

namespace System
{
    namespace Drawing
    {
        namespace Drawing2D
        {
            class GraphicsPath;
        }
    }
}

namespace xinterop
{
    class GenericXVectorArray;
}

namespace System
{
    namespace Drawing
    {
        namespace Drawing2D
        {
            class Matrix;
        }
    }
}

namespace System
{
    class GenericXGraphicsAction;
}

namespace System
{
    class DateTime;
}

namespace System
{
    namespace Collections
    {
        namespace Generic
        {
            class GenericStringPdfItemKeyValuePair;
        }
    }
}

namespace xinterop
{
    class GenericPdfNameArray;
}

namespace xinterop
{
    class GenericGenericStringPdfItemKeyValuePairArray;
}

namespace xinterop
{
    class GenericStringArray;
}

namespace xinterop
{
    class GenericPdfItemArray;
}

namespace System
{
    class Guid;
}

namespace xinterop
{
    class GenericPdfObjectArray;
}

namespace xinterop
{
    class GenericCObjectArray;
}

namespace xinterop
{
    class GenericObjectArray;
}

namespace xinterop
{
    class GenericPdfOutlineArray;
}

namespace PdfSharp
{
    namespace Pdf
    {
        class NullablePdfReadingDirection;
    }
}

#include <windows.h>
#include <string>
#include <vector>
#include <exception>
#include <memory>
#include <functional>
#include <math.h>


namespace xinterop
{


    enum __XI_Constructor_Enum__
    {
        __XI_Default_Constructor__ = 0
    };


    ///////////////////////////////////////////////////////////////////////////////
    //
    // C++ Decimal class definition
    //
    ///////////////////////////////////////////////////////////////////////////////

    enum MidpointRounding
    {
        ToEven    = 0,            //    Round to the next even value.
        AwayFromZero = 1        //    Round to the value which is away from 0.
    };

    struct DecimalData
    {
    public:
        int Data[4];
    };

    struct PDFSHARPGDIBRIDGE_API Decimal
    {
        // Sign mask for the flags field. A value of zero in this bit indicates a
        // positive Decimal value, and a value of one in this bit indicates a
        // negative Decimal value.
        //
        // Look at OleAut's DECIMAL_NEG constant to check for negative values
        // in native code.
        static int SignMask;

        // Scale mask for the flags field. This byte in the flags field contains
        // the power of 10 to divide the Decimal value by. The scale byte must
        // contain a value between 0 and 28 inclusive.
        static int ScaleMask;

        // Number of bits scale is shifted by.
        static int ScaleShift;

        // The maximum power of 10 that a 32 bit integer can store
        static int MaxInt32Scale;

        // Fast access for 10^n where n is 0-9
        static unsigned int Powers10[10];

    private:

        // The lo, mid, hi, and flags fields contain the representation of the
        // Decimal value. The lo, mid, and hi fields contain the 96-bit integer
        // part of the Decimal. Bits 0-15 (the lower word) of the flags field are
        // unused and must be zero; bits 16-23 contain must contain a value between
        // 0 and 28, indicating the power of 10 to divide the 96-bit integer part
        // by to produce the Decimal value; bits 24-30 are unused and must be zero;
        // and finally bit 31 indicates the sign of the Decimal value, 0 meaning
        // positive and 1 meaning negative.
        //
        // NOTE: Do not change the order in which these fields are declared. The
        // native methods in this class rely on this particular order.
        int flags;
        int hi;
        int lo;
        int mid;

    public:

        // Constant representing the Decimal value 0.
        static Decimal Zero;

        // Constant representing the Decimal value 1.
        static Decimal One;

        // Constant representing the Decimal value -1.
        static Decimal MinusOne;

        // Constant representing the largest possible Decimal value. The value of
        // this constant is 79,228,162,514,264,337,593,543,950,335.
        static Decimal MaxValue;

        // Constant representing the smallest possible Decimal value. The value of
        // this constant is -79,228,162,514,264,337,593,543,950,335.
        static Decimal MinValue;

        // Constant representing the negative number that is the closest possible
        // Decimal value to -0m.
        static Decimal NearNegativeZero;

        // Constant representing the positive number that is the closest possible
        // Decimal value to +0m.
        static Decimal NearPositiveZero;

    private:
        // Constructs a Decimal from its constituent parts.
        Decimal(int lo, int mid, int hi, int flags);    
        Decimal(bool isMax);

        bool IsZero() const;
        bool IsNegative();

        static void InternalRoundFromZero(Decimal & d, int decimalCount);
        static unsigned int InternalDivRemUInt32(Decimal & value, unsigned int divisor);
        static void InternalAddUInt32RawUnchecked(Decimal & value, unsigned int i);

    public:

        // Constructors
        Decimal(void);
        Decimal(const DecimalData& bits);
        Decimal(const Decimal& value);
        Decimal(char value);
        Decimal(unsigned char value);
        Decimal(short int value);
        Decimal(unsigned short int value);    
        Decimal(int value);
        Decimal(unsigned int value);
        Decimal(long long value);
        Decimal(unsigned long long value);
        Decimal(float value);
        Decimal(double value);
        Decimal(int lo, int mid, int hi, bool isNegative, unsigned scale);

        // Returns the absolute value of the given Decimal. If d is
        // positive, the result is d. If d is negative, the result
        // is -d.
        static Decimal Absolute(Decimal d);

        // Adds two Decimal values.
        static Decimal Add(const Decimal & d1, const Decimal & d2);
        
        // Subtracts two Decimal values.
        static Decimal Subtract(const Decimal & d1, const Decimal & d2);
        
        // Multiplies two Decimal values.
        static Decimal Multiply(const Decimal & d1, const Decimal & d2);
        
        // Divides two Decimal values.
        static Decimal Divide(const Decimal & d1, const Decimal & d2);

        // Returns the larger of two Decimal values.
        static Decimal Maximum(const Decimal & d1, const Decimal & d2);

        // Returns the smaller of two Decimal values.
        static Decimal Minimum(const Decimal & d1, const Decimal & d2);

        static int Compare(const Decimal & d1, const Decimal & d2);

        int CompareTo(const Decimal & value);    

        Decimal Floor(Decimal & d);

        // Truncates a Decimal to an integer value. The Decimal argument is rounded
        // towards zero to the nearest integer value, corresponding to removing all
        // digits after the decimal point.
        static Decimal Truncate(const Decimal & d);
        
        // Returns the negated value of the given Decimal. If d is non-zero,
        // the result is -d. If d is zero, the result is zero.    
        Decimal Negate(const Decimal & d);
        
        // Rounds a Decimal value to a given number of decimal places. The value
        // given by d is rounded to the number of decimal places given by
        // decimals. The decimals argument must be an integer between
        // 0 and 28 inclusive.
        //
        // By default a mid-point value is rounded to the nearest even number. If the mode is
        // passed in, it can also round away from zero.
        static Decimal Round(const Decimal & d);
        static Decimal Round(const Decimal & d, int decimals);
        static Decimal Round(const Decimal & d, MidpointRounding mode);
        static Decimal Round(const Decimal & d, int decimals, MidpointRounding mode);

        static unsigned char ToByte(const Decimal & value);
        static char ToSByte(const Decimal & value);
        static short ToInt16(const Decimal & value);
        static unsigned short ToUInt16(const Decimal value);
        static int ToInt32(const Decimal & d);
        static unsigned int ToUInt32(const Decimal& d);
        static long long ToInt64(const Decimal & d);
        static unsigned long long ToUInt64(const Decimal d);

        static DecimalData GetBits(const Decimal & d);

        // Converts a Decimal to a float. Since a float has fewer significant
        // digits than a Decimal, this operation may produce round-off errors.
        static float ToSingle(const Decimal & d);
        
        // Converts a Decimal to a double. Since a double has fewer significant
        // digits than a Decimal, this operation may produce round-off errors.    
        static double ToDouble(const Decimal & d);

        operator const unsigned char();
        operator const char();
        operator const unsigned short int();
        operator const short int();
        operator const unsigned int();
        operator const int();
        operator const long long();
        operator const unsigned long long();
        operator const float();
        operator const double();
            
        Decimal& operator= (int nValue) throw();

        // Operators (mutating)
        Decimal& operator = (char nValue) throw();
        Decimal& operator = (short nValue) throw();    
        Decimal& operator = (long long nValue) throw();
        Decimal& operator = (unsigned char nValue) throw();
        Decimal& operator = (unsigned short nValue) throw();
        Decimal& operator = (unsigned int nValue) throw();
        Decimal& operator = (unsigned long long nValue) throw();
        Decimal& operator = (float nValue) throw();
        Decimal& operator = (double nValue) throw();

        Decimal& operator += (const Decimal& decRHS) throw();
        Decimal& operator -= (const Decimal& decRHS) throw();
        Decimal& operator *= (const Decimal& decRHS) throw();
        Decimal& operator /= (const Decimal& decRHS) throw();
        Decimal operator++(int /* prefix operator: not used */) throw();
        Decimal operator--(int /* prefix operator: not used */) throw();
        Decimal& operator++() throw();
        Decimal& operator--() throw();

        Decimal operator+(const Decimal&);
        Decimal operator-(const Decimal&);
        Decimal operator*(const Decimal&);
        Decimal operator/(const Decimal&);

        static Decimal Parse(const std::string& decString, LCID lcid = 0);
        static Decimal Parse(const char* decString, LCID lcid = 0);    
        static bool TryParse(const std::string& decString, LCID lcid, Decimal * pValue);
        static bool TryParse(const char* decString, LCID lcid, Decimal * pValue);
        
        std::string ToString(LCID lcid = 0) const throw();
    };

    // Operators
    PDFSHARPGDIBRIDGE_API Decimal operator + (const Decimal& decLHS, const Decimal& decRHS) throw();
    PDFSHARPGDIBRIDGE_API Decimal operator - (const Decimal& decLHS, const Decimal& decRHS) throw();
    PDFSHARPGDIBRIDGE_API Decimal operator * (const Decimal& decLHS, const Decimal& decRHS) throw();
    PDFSHARPGDIBRIDGE_API Decimal operator / (const Decimal& decLHS, const Decimal& decRHS) throw();
    PDFSHARPGDIBRIDGE_API bool operator < (const Decimal& decLHS, const Decimal& decRHS) throw();
    PDFSHARPGDIBRIDGE_API bool operator > (const Decimal& decLHS, const Decimal& decRHS) throw();
    PDFSHARPGDIBRIDGE_API bool operator <= (const Decimal& decLHS, const Decimal& decRHS) throw();
    PDFSHARPGDIBRIDGE_API bool operator >= (const Decimal& decLHS, const Decimal& decRHS) throw();
    PDFSHARPGDIBRIDGE_API bool operator == (const Decimal& decLHS, const Decimal& decRHS) throw();
    PDFSHARPGDIBRIDGE_API bool operator != (const Decimal& decLHS, const Decimal& decRHS) throw();


    #ifdef UNICODE    
        #define xiGetExceptionMessage xiGetExceptionMessageW
    #else    
        #define xiGetExceptionMessage xiGetExceptionMessageA
    #endif

    ///////////////////////////////////////////////////////////////////////////////////////////////////
    // START OF GLOBAL FUNCTIONS AND MACROS
    ///////////////////////////////////////////////////////////////////////////////////////////////////

    // This file was created when "Load .NET bridge assembly automatically" option was turned on.
    // Loads the .NET bridge assembly whose name must not be changed or the function 
    // will fail to load it because of missing assembly.
    PDFSHARPGDIBRIDGE_API void xiInitializeBridgeAssembly();

    // ANSI version of xiGetExceptionMessage
    // Gets the error message using the given error code.
    PDFSHARPGDIBRIDGE_API const char * xiGetExceptionMessageA(int errorCode);

    // UNICODE version of xiGetExceptionMessage
    // Gets the error message using the given error code.
    PDFSHARPGDIBRIDGE_API const wchar_t * xiGetExceptionMessageW(int errorCode);

    #ifndef DEFINE_ENUM_FLAG_OPERATORS

    #ifdef __cplusplus

    extern "C++" {

        template <size_t S>
        struct _ENUM_FLAG_INTEGER_FOR_SIZE;

        template <>
        struct _ENUM_FLAG_INTEGER_FOR_SIZE<1>
        {
            typedef char type;
        };

        template <>
        struct _ENUM_FLAG_INTEGER_FOR_SIZE<2>
        {
            typedef short type;
        };

        template <>
        struct _ENUM_FLAG_INTEGER_FOR_SIZE<4>
        {
            typedef int type;
        };    

        template <class T>
        struct _ENUM_FLAG_SIZED_INTEGER
        {
            typedef typename _ENUM_FLAG_INTEGER_FOR_SIZE<sizeof(T)>::type type;
        };
    }

    #define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
    extern "C++" { \
    inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)a) | ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
    inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type &)a) |= ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
    inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)a) & ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
    inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type &)a) &= ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
    inline ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)a)); } \
    inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)a) ^ ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
    inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type &)a) ^= ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
    }
    #else
    #define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE)
    #endif

    #endif

    ///////////////////////////////////////////////////////////////////////////////////////////////////
    // END OF GLOBAL FUNCTIONS AND MACROS
    ///////////////////////////////////////////////////////////////////////////////////////////////////



};


///////////////////////////////////////////////////////////////////////////////
//
// C++ enum definitions for C# enum
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            enum class AnchorType : unsigned int
            {
TopLeft = 0x00000000,
TopCenter = 0x00000001,
TopRight = 0x00000002,
MiddleLeft = 0x00000003,
MiddleCenter = 0x00000004,
MiddleRight = 0x00000005,
BottomLeft = 0x00000006,
BottomCenter = 0x00000007,
BottomRight = 0x00000008
            };
        }
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            enum class CodeDirection : unsigned int
            {
LeftToRight = 0x00000000,
BottomToTop = 0x00000001,
RightToLeft = 0x00000002,
TopToBottom = 0x00000003
            };
        }
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            enum class CodeType : unsigned int
            {
Code2of5Interleaved = 0x00000000,
Code3of9Standard = 0x00000001,
Omr = 0x00000002,
DataMatrix = 0x00000003
            };
        }
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            enum class TextLocation : unsigned int
            {
None = 0x00000000,
Above = 0x00000001,
Below = 0x00000002,
AboveEmbedded = 0x00000003,
BelowEmbedded = 0x00000004
            };
        }
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            enum class DataMatrixEncoding : unsigned int
            {
Ascii = 0x00000000,
C40 = 0x00000001,
Text = 0x00000002,
X12 = 0x00000003,
EDIFACT = 0x00000004,
Base256 = 0x00000005
            };
        }
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        namespace Layout
        {
            enum class XParagraphAlignment : unsigned int
            {
Default = 0x00000000,
Left = 0x00000001,
Center = 0x00000002,
Right = 0x00000003,
Justify = 0x00000004
            };
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        enum class PdfFontEncoding : unsigned int
        {
            WinAnsi = 0x00000000,
            Unicode = 0x00000001,
            Automatic = 0x00000001
        };
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        enum class PdfFontEmbedding : unsigned int
        {
            Always = 0x00000000,
            None = 0x00000001,
            Default = 0x00000002,
            Automatic = 0x00000003
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XKnownColor : unsigned int
        {
            AliceBlue = 0x00000000,
            AntiqueWhite = 0x00000001,
            Aqua = 0x00000002,
            Aquamarine = 0x00000003,
            Azure = 0x00000004,
            Beige = 0x00000005,
            Bisque = 0x00000006,
            Black = 0x00000007,
            BlanchedAlmond = 0x00000008,
            Blue = 0x00000009,
            BlueViolet = 0x0000000A,
            Brown = 0x0000000B,
            BurlyWood = 0x0000000C,
            CadetBlue = 0x0000000D,
            Chartreuse = 0x0000000E,
            Chocolate = 0x0000000F,
            Coral = 0x00000010,
            CornflowerBlue = 0x00000011,
            Cornsilk = 0x00000012,
            Crimson = 0x00000013,
            Cyan = 0x00000014,
            DarkBlue = 0x00000015,
            DarkCyan = 0x00000016,
            DarkGoldenrod = 0x00000017,
            DarkGray = 0x00000018,
            DarkGreen = 0x00000019,
            DarkKhaki = 0x0000001A,
            DarkMagenta = 0x0000001B,
            DarkOliveGreen = 0x0000001C,
            DarkOrange = 0x0000001D,
            DarkOrchid = 0x0000001E,
            DarkRed = 0x0000001F,
            DarkSalmon = 0x00000020,
            DarkSeaGreen = 0x00000021,
            DarkSlateBlue = 0x00000022,
            DarkSlateGray = 0x00000023,
            DarkTurquoise = 0x00000024,
            DarkViolet = 0x00000025,
            DeepPink = 0x00000026,
            DeepSkyBlue = 0x00000027,
            DimGray = 0x00000028,
            DodgerBlue = 0x00000029,
            Firebrick = 0x0000002A,
            FloralWhite = 0x0000002B,
            ForestGreen = 0x0000002C,
            Fuchsia = 0x0000002D,
            Gainsboro = 0x0000002E,
            GhostWhite = 0x0000002F,
            Gold = 0x00000030,
            Goldenrod = 0x00000031,
            Gray = 0x00000032,
            Green = 0x00000033,
            GreenYellow = 0x00000034,
            Honeydew = 0x00000035,
            HotPink = 0x00000036,
            IndianRed = 0x00000037,
            Indigo = 0x00000038,
            Ivory = 0x00000039,
            Khaki = 0x0000003A,
            Lavender = 0x0000003B,
            LavenderBlush = 0x0000003C,
            LawnGreen = 0x0000003D,
            LemonChiffon = 0x0000003E,
            LightBlue = 0x0000003F,
            LightCoral = 0x00000040,
            LightCyan = 0x00000041,
            LightGoldenrodYellow = 0x00000042,
            LightGray = 0x00000043,
            LightGreen = 0x00000044,
            LightPink = 0x00000045,
            LightSalmon = 0x00000046,
            LightSeaGreen = 0x00000047,
            LightSkyBlue = 0x00000048,
            LightSlateGray = 0x00000049,
            LightSteelBlue = 0x0000004A,
            LightYellow = 0x0000004B,
            Lime = 0x0000004C,
            LimeGreen = 0x0000004D,
            Linen = 0x0000004E,
            Magenta = 0x0000004F,
            Maroon = 0x00000050,
            MediumAquamarine = 0x00000051,
            MediumBlue = 0x00000052,
            MediumOrchid = 0x00000053,
            MediumPurple = 0x00000054,
            MediumSeaGreen = 0x00000055,
            MediumSlateBlue = 0x00000056,
            MediumSpringGreen = 0x00000057,
            MediumTurquoise = 0x00000058,
            MediumVioletRed = 0x00000059,
            MidnightBlue = 0x0000005A,
            MintCream = 0x0000005B,
            MistyRose = 0x0000005C,
            Moccasin = 0x0000005D,
            NavajoWhite = 0x0000005E,
            Navy = 0x0000005F,
            OldLace = 0x00000060,
            Olive = 0x00000061,
            OliveDrab = 0x00000062,
            Orange = 0x00000063,
            OrangeRed = 0x00000064,
            Orchid = 0x00000065,
            PaleGoldenrod = 0x00000066,
            PaleGreen = 0x00000067,
            PaleTurquoise = 0x00000068,
            PaleVioletRed = 0x00000069,
            PapayaWhip = 0x0000006A,
            PeachPuff = 0x0000006B,
            Peru = 0x0000006C,
            Pink = 0x0000006D,
            Plum = 0x0000006E,
            PowderBlue = 0x0000006F,
            Purple = 0x00000070,
            Red = 0x00000071,
            RosyBrown = 0x00000072,
            RoyalBlue = 0x00000073,
            SaddleBrown = 0x00000074,
            Salmon = 0x00000075,
            SandyBrown = 0x00000076,
            SeaGreen = 0x00000077,
            SeaShell = 0x00000078,
            Sienna = 0x00000079,
            Silver = 0x0000007A,
            SkyBlue = 0x0000007B,
            SlateBlue = 0x0000007C,
            SlateGray = 0x0000007D,
            Snow = 0x0000007E,
            SpringGreen = 0x0000007F,
            SteelBlue = 0x00000080,
            Tan = 0x00000081,
            Teal = 0x00000082,
            Thistle = 0x00000083,
            Tomato = 0x00000084,
            Transparent = 0x00000085,
            Turquoise = 0x00000086,
            Violet = 0x00000087,
            Wheat = 0x00000088,
            White = 0x00000089,
            WhiteSmoke = 0x0000008A,
            Yellow = 0x0000008B,
            YellowGreen = 0x0000008C
        };
    }
}

namespace System
{
    namespace Drawing
    {
        enum class KnownColor : unsigned int
        {
            ActiveBorder = 0x00000001,
            ActiveCaption = 0x00000002,
            ActiveCaptionText = 0x00000003,
            AppWorkspace = 0x00000004,
            Control = 0x00000005,
            ControlDark = 0x00000006,
            ControlDarkDark = 0x00000007,
            ControlLight = 0x00000008,
            ControlLightLight = 0x00000009,
            ControlText = 0x0000000A,
            Desktop = 0x0000000B,
            GrayText = 0x0000000C,
            Highlight = 0x0000000D,
            HighlightText = 0x0000000E,
            HotTrack = 0x0000000F,
            InactiveBorder = 0x00000010,
            InactiveCaption = 0x00000011,
            InactiveCaptionText = 0x00000012,
            Info = 0x00000013,
            InfoText = 0x00000014,
            Menu = 0x00000015,
            MenuText = 0x00000016,
            ScrollBar = 0x00000017,
            Window = 0x00000018,
            WindowFrame = 0x00000019,
            WindowText = 0x0000001A,
            Transparent = 0x0000001B,
            AliceBlue = 0x0000001C,
            AntiqueWhite = 0x0000001D,
            Aqua = 0x0000001E,
            Aquamarine = 0x0000001F,
            Azure = 0x00000020,
            Beige = 0x00000021,
            Bisque = 0x00000022,
            Black = 0x00000023,
            BlanchedAlmond = 0x00000024,
            Blue = 0x00000025,
            BlueViolet = 0x00000026,
            Brown = 0x00000027,
            BurlyWood = 0x00000028,
            CadetBlue = 0x00000029,
            Chartreuse = 0x0000002A,
            Chocolate = 0x0000002B,
            Coral = 0x0000002C,
            CornflowerBlue = 0x0000002D,
            Cornsilk = 0x0000002E,
            Crimson = 0x0000002F,
            Cyan = 0x00000030,
            DarkBlue = 0x00000031,
            DarkCyan = 0x00000032,
            DarkGoldenrod = 0x00000033,
            DarkGray = 0x00000034,
            DarkGreen = 0x00000035,
            DarkKhaki = 0x00000036,
            DarkMagenta = 0x00000037,
            DarkOliveGreen = 0x00000038,
            DarkOrange = 0x00000039,
            DarkOrchid = 0x0000003A,
            DarkRed = 0x0000003B,
            DarkSalmon = 0x0000003C,
            DarkSeaGreen = 0x0000003D,
            DarkSlateBlue = 0x0000003E,
            DarkSlateGray = 0x0000003F,
            DarkTurquoise = 0x00000040,
            DarkViolet = 0x00000041,
            DeepPink = 0x00000042,
            DeepSkyBlue = 0x00000043,
            DimGray = 0x00000044,
            DodgerBlue = 0x00000045,
            Firebrick = 0x00000046,
            FloralWhite = 0x00000047,
            ForestGreen = 0x00000048,
            Fuchsia = 0x00000049,
            Gainsboro = 0x0000004A,
            GhostWhite = 0x0000004B,
            Gold = 0x0000004C,
            Goldenrod = 0x0000004D,
            Gray = 0x0000004E,
            Green = 0x0000004F,
            GreenYellow = 0x00000050,
            Honeydew = 0x00000051,
            HotPink = 0x00000052,
            IndianRed = 0x00000053,
            Indigo = 0x00000054,
            Ivory = 0x00000055,
            Khaki = 0x00000056,
            Lavender = 0x00000057,
            LavenderBlush = 0x00000058,
            LawnGreen = 0x00000059,
            LemonChiffon = 0x0000005A,
            LightBlue = 0x0000005B,
            LightCoral = 0x0000005C,
            LightCyan = 0x0000005D,
            LightGoldenrodYellow = 0x0000005E,
            LightGray = 0x0000005F,
            LightGreen = 0x00000060,
            LightPink = 0x00000061,
            LightSalmon = 0x00000062,
            LightSeaGreen = 0x00000063,
            LightSkyBlue = 0x00000064,
            LightSlateGray = 0x00000065,
            LightSteelBlue = 0x00000066,
            LightYellow = 0x00000067,
            Lime = 0x00000068,
            LimeGreen = 0x00000069,
            Linen = 0x0000006A,
            Magenta = 0x0000006B,
            Maroon = 0x0000006C,
            MediumAquamarine = 0x0000006D,
            MediumBlue = 0x0000006E,
            MediumOrchid = 0x0000006F,
            MediumPurple = 0x00000070,
            MediumSeaGreen = 0x00000071,
            MediumSlateBlue = 0x00000072,
            MediumSpringGreen = 0x00000073,
            MediumTurquoise = 0x00000074,
            MediumVioletRed = 0x00000075,
            MidnightBlue = 0x00000076,
            MintCream = 0x00000077,
            MistyRose = 0x00000078,
            Moccasin = 0x00000079,
            NavajoWhite = 0x0000007A,
            Navy = 0x0000007B,
            OldLace = 0x0000007C,
            Olive = 0x0000007D,
            OliveDrab = 0x0000007E,
            Orange = 0x0000007F,
            OrangeRed = 0x00000080,
            Orchid = 0x00000081,
            PaleGoldenrod = 0x00000082,
            PaleGreen = 0x00000083,
            PaleTurquoise = 0x00000084,
            PaleVioletRed = 0x00000085,
            PapayaWhip = 0x00000086,
            PeachPuff = 0x00000087,
            Peru = 0x00000088,
            Pink = 0x00000089,
            Plum = 0x0000008A,
            PowderBlue = 0x0000008B,
            Purple = 0x0000008C,
            Red = 0x0000008D,
            RosyBrown = 0x0000008E,
            RoyalBlue = 0x0000008F,
            SaddleBrown = 0x00000090,
            Salmon = 0x00000091,
            SandyBrown = 0x00000092,
            SeaGreen = 0x00000093,
            SeaShell = 0x00000094,
            Sienna = 0x00000095,
            Silver = 0x00000096,
            SkyBlue = 0x00000097,
            SlateBlue = 0x00000098,
            SlateGray = 0x00000099,
            Snow = 0x0000009A,
            SpringGreen = 0x0000009B,
            SteelBlue = 0x0000009C,
            Tan = 0x0000009D,
            Teal = 0x0000009E,
            Thistle = 0x0000009F,
            Tomato = 0x000000A0,
            Turquoise = 0x000000A1,
            Violet = 0x000000A2,
            Wheat = 0x000000A3,
            White = 0x000000A4,
            WhiteSmoke = 0x000000A5,
            Yellow = 0x000000A6,
            YellowGreen = 0x000000A7,
            ButtonFace = 0x000000A8,
            ButtonHighlight = 0x000000A9,
            ButtonShadow = 0x000000AA,
            GradientActiveCaption = 0x000000AB,
            GradientInactiveCaption = 0x000000AC,
            MenuBar = 0x000000AD,
            MenuHighlight = 0x000000AE
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XColorSpace : unsigned int
        {
            Rgb = 0x00000000,
            Cmyk = 0x00000001,
            GrayScale = 0x00000002
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XFontStyle : unsigned int
        {
            Regular = 0x00000000,
            Bold = 0x00000001,
            Italic = 0x00000002,
            BoldItalic = 0x00000003,
            Underline = 0x00000004,
            Strikeout = 0x00000008
        };
        DEFINE_ENUM_FLAG_OPERATORS(XFontStyle)
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XGraphicsUnit : unsigned int
        {
            Point = 0x00000000,
            Inch = 0x00000001,
            Millimeter = 0x00000002,
            Centimeter = 0x00000003,
            Presentation = 0x00000004
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XPageDirection : unsigned int
        {
            Downwards = 0x00000000,
            Upwards = 0x00000001
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XGraphicsPdfPageOptions : unsigned int
        {
            Append = 0x00000000,
            Prepend = 0x00000001,
            Replace = 0x00000002
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XFillMode : unsigned int
        {
            Alternate = 0x00000000,
            Winding = 0x00000001
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XSmoothingMode : unsigned int
        {
            Invalid = 0xFFFFFFFF,
            Default = 0x00000000,
            HighSpeed = 0x00000001,
            HighQuality = 0x00000002,
            None = 0x00000003,
            AntiAlias = 0x00000004
        };
        DEFINE_ENUM_FLAG_OPERATORS(XSmoothingMode)
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XMatrixOrder : unsigned int
        {
            Prepend = 0x00000000,
            Append = 0x00000001
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XSweepDirection : unsigned int
        {
            Counterclockwise = 0x00000000,
            Clockwise = 0x00000001
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XLinearGradientMode : unsigned int
        {
            Horizontal = 0x00000000,
            Vertical = 0x00000001,
            ForwardDiagonal = 0x00000002,
            BackwardDiagonal = 0x00000003
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XLineJoin : unsigned int
        {
            Miter = 0x00000000,
            Round = 0x00000001,
            Bevel = 0x00000002
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XLineCap : unsigned int
        {
            Flat = 0x00000000,
            Round = 0x00000001,
            Square = 0x00000002
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XDashStyle : unsigned int
        {
            Solid = 0x00000000,
            Dash = 0x00000001,
            Dot = 0x00000002,
            DashDot = 0x00000003,
            DashDotDot = 0x00000004,
            Custom = 0x00000005
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XStringAlignment : unsigned int
        {
            Near = 0x00000000,
            Center = 0x00000001,
            Far = 0x00000002
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XLineAlignment : unsigned int
        {
            Near = 0x00000000,
            Center = 0x00000001,
            Far = 0x00000002,
            BaseLine = 0x00000003
        };
    }
}

namespace PdfSharp
{
    namespace Drawing
    {
        enum class XStyleSimulations : unsigned int
        {
            None = 0x00000000,
            BoldSimulation = 0x00000001,
            ItalicSimulation = 0x00000002,
            BoldItalicSimulation = 0x00000003
        };
        DEFINE_ENUM_FLAG_OPERATORS(XStyleSimulations)
    }
}

namespace System
{
    namespace Windows
    {
        namespace Forms
        {
            enum class BorderStyle : unsigned int
            {
None = 0x00000000,
FixedSingle = 0x00000001,
Fixed3D = 0x00000002
            };
        }
    }
}

namespace PdfSharp
{
    namespace Forms
    {
        enum class Zoom : unsigned int
        {
            Mininum = 0x0000000A,
            Maximum = 0x00000320,
            Percent800 = 0x00000320,
            Percent600 = 0x00000258,
            Percent400 = 0x00000190,
            Percent200 = 0x000000C8,
            Percent150 = 0x00000096,
            Percent100 = 0x00000064,
            Percent75 = 0x0000004B,
            Percent50 = 0x00000032,
            Percent25 = 0x00000019,
            Percent10 = 0x0000000A,
            BestFit = 0xFFFFFFFF,
            TextFit = 0xFFFFFFFE,
            FullPage = 0xFFFFFFFD,
            OriginalSize = 0xFFFFFFFC
        };
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        enum class VCF : unsigned int
        {
            None = 0x00000000,
            Create = 0x00000001,
            CreateIndirect = 0x00000002
        };
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace AcroForms
        {
            enum class PdfAcroFieldFlags : unsigned int
            {
ReadOnly = 0x00000001,
Required = 0x00000002,
NoExport = 0x00000004,
Pushbutton = 0x00010000,
Radio = 0x00008000,
NoToggleToOff = 0x00004000,
Multiline = 0x00001000,
Password = 0x00002000,
FileSelect = 0x00100000,
DoNotSpellCheckTextField = 0x00400000,
DoNotScroll = 0x00800000,
Combo = 0x00020000,
Edit = 0x00040000,
Sort = 0x00080000,
MultiSelect = 0x00200000,
DoNotSpellCheckChoiseField = 0x00400000
            };
            DEFINE_ENUM_FLAG_OPERATORS(PdfAcroFieldFlags)
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Annotations
        {
            enum class PdfAnnotationFlags : unsigned int
            {
Invisible = 0x00000001,
Hidden = 0x00000002,
Print = 0x00000004,
NoZoom = 0x00000008,
NoRotate = 0x00000010,
NoView = 0x00000020,
ReadOnly = 0x00000040,
Locked = 0x00000080,
ToggleNoView = 0x00000100
            };
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Annotations
        {
            enum class PdfRubberStampAnnotationIcon : unsigned int
            {
NoIcon = 0x00000000,
Approved = 0x00000001,
AsIs = 0x00000002,
Confidential = 0x00000003,
Departmental = 0x00000004,
Draft = 0x00000005,
Experimental = 0x00000006,
Expired = 0x00000007,
Final = 0x00000008,
ForComment = 0x00000009,
ForPublicRelease = 0x0000000A,
NotApproved = 0x0000000B,
NotForPublicRelease = 0x0000000C,
Sold = 0x0000000D,
TopSecret = 0x0000000E
            };
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Annotations
        {
            enum class PdfTextAnnotationIcon : unsigned int
            {
NoIcon = 0x00000000,
Comment = 0x00000001,
Help = 0x00000002,
Insert = 0x00000003,
Key = 0x00000004,
NewParagraph = 0x00000005,
Note = 0x00000006,
Paragraph = 0x00000007
            };
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
enum class CStringType : unsigned int
{
    String = 0x00000000,
    HexString = 0x00000001,
    UnicodeString = 0x00000002,
    UnicodeHexString = 0x00000003,
    Dictionary = 0x00000004
};
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
enum class OpCodeName : unsigned int
{
    Dictionary = 0x00000000,
    b = 0x00000001,
    B = 0x00000002,
    bx = 0x00000003,
    Bx = 0x00000004,
    BDC = 0x00000005,
    BI = 0x00000006,
    BMC = 0x00000007,
    BT = 0x00000008,
    BX = 0x00000009,
    c = 0x0000000A,
    cm = 0x0000000B,
    CS = 0x0000000C,
    cs = 0x0000000D,
    d = 0x0000000E,
    d0 = 0x0000000F,
    d1 = 0x00000010,
    Do = 0x00000011,
    DP = 0x00000012,
    EI = 0x00000013,
    EMC = 0x00000014,
    ET = 0x00000015,
    EX = 0x00000016,
    f = 0x00000017,
    F = 0x00000018,
    fx = 0x00000019,
    G = 0x0000001A,
    g = 0x0000001B,
    gs = 0x0000001C,
    h = 0x0000001D,
    i = 0x0000001E,
    ID = 0x0000001F,
    j = 0x00000020,
    J = 0x00000021,
    K = 0x00000022,
    k = 0x00000023,
    l = 0x00000024,
    m = 0x00000025,
    M = 0x00000026,
    MP = 0x00000027,
    n = 0x00000028,
    q = 0x00000029,
    Q = 0x0000002A,
    re = 0x0000002B,
    RG = 0x0000002C,
    rg = 0x0000002D,
    ri = 0x0000002E,
    s = 0x0000002F,
    S = 0x00000030,
    SC = 0x00000031,
    sc = 0x00000032,
    SCN = 0x00000033,
    scn = 0x00000034,
    sh = 0x00000035,
    Tx = 0x00000036,
    Tc = 0x00000037,
    Td = 0x00000038,
    TD = 0x00000039,
    Tf = 0x0000003A,
    Tj = 0x0000003B,
    TJ = 0x0000003C,
    TL = 0x0000003D,
    Tm = 0x0000003E,
    Tr = 0x0000003F,
    Ts = 0x00000040,
    Tw = 0x00000041,
    Tz = 0x00000042,
    v = 0x00000043,
    w = 0x00000044,
    W = 0x00000045,
    Wx = 0x00000046,
    y = 0x00000047,
    QuoteSingle = 0x00000048,
    QuoteDbl = 0x00000049
};
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            namespace Objects
            {
enum class OpCodeFlags : unsigned int
{
    None = 0x00000000,
    TextOut = 0x00000001
};
DEFINE_ENUM_FLAG_OPERATORS(OpCodeFlags)
            }
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Content
        {
            enum class CSymbol : unsigned int
            {
None = 0x00000000,
Comment = 0x00000001,
Integer = 0x00000002,
Real = 0x00000003,
String = 0x00000004,
HexString = 0x00000005,
UnicodeString = 0x00000006,
UnicodeHexString = 0x00000007,
Name = 0x00000008,
Operator = 0x00000009,
BeginArray = 0x0000000A,
EndArray = 0x0000000B,
Dictionary = 0x0000000C,
Eof = 0x0000000D,
Error = 0xFFFFFFFF
            };
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        enum class PdfFlateEncodeMode : unsigned int
        {
            Default = 0x00000000,
            BestSpeed = 0x00000001,
            BestCompression = 0x00000002
        };
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace IO
        {
            enum class Symbol : unsigned int
            {
None = 0x00000000,
Comment = 0x00000001,
Null = 0x00000002,
Integer = 0x00000003,
UInteger = 0x00000004,
Real = 0x00000005,
Boolean = 0x00000006,
String = 0x00000007,
HexString = 0x00000008,
UnicodeString = 0x00000009,
UnicodeHexString = 0x0000000A,
Name = 0x0000000B,
Keyword = 0x0000000C,
BeginStream = 0x0000000D,
EndStream = 0x0000000E,
BeginArray = 0x0000000F,
EndArray = 0x00000010,
BeginDictionary = 0x00000011,
EndDictionary = 0x00000012,
Obj = 0x00000013,
EndObj = 0x00000014,
R = 0x00000015,
XRef = 0x00000016,
Trailer = 0x00000017,
StartXRef = 0x00000018,
Eof = 0x00000019
            };
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace IO
        {
            enum class PdfDocumentOpenMode : unsigned int
            {
Modify = 0x00000000,
Import = 0x00000001,
ReadOnly = 0x00000002,
InformationOnly = 0x00000003
            };
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace Security
        {
            enum class PdfDocumentSecurityLevel : unsigned int
            {
None = 0x00000000,
Encrypted40Bit = 0x00000001,
Encrypted128Bit = 0x00000002
            };
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        namespace IO
        {
            enum class PasswordValidity : unsigned int
            {
Invalid = 0x00000000,
UserPassword = 0x00000001,
OwnerPassword = 0x00000002
            };
        }
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        enum class PdfCustomValueCompressionMode : unsigned int
        {
            Default = 0x00000000,
            Uncompressed = 0x00000001,
            Compressed = 0x00000002
        };
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        enum class PdfPageLayout : unsigned int
        {
            SinglePage = 0x00000000,
            OneColumn = 0x00000001,
            TwoColumnLeft = 0x00000002,
            TwoColumnRight = 0x00000003,
            TwoPageLeft = 0x00000004,
            TwoPageRight = 0x00000005
        };
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        enum class PdfPageMode : unsigned int
        {
            UseNone = 0x00000000,
            UseOutlines = 0x00000001,
            UseThumbs = 0x00000002,
            FullScreen = 0x00000003,
            UseOC = 0x00000004,
            UseAttachments = 0x00000005
        };
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        enum class PdfColorMode : unsigned int
        {
            Undefined = 0x00000000,
            Rgb = 0x00000001,
            Cmyk = 0x00000002
        };
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        enum class PdfUseFlateDecoderForJpegImages : unsigned int
        {
            Automatic = 0x00000000,
            Never = 0x00000001,
            Always = 0x00000002
        };
    }
}

namespace System
{
    enum class TypeCode : unsigned int
    {
        Empty = 0x00000000,
        Object = 0x00000001,
        DBNull = 0x00000002,
        Boolean = 0x00000003,
        Char = 0x00000004,
        SByte = 0x00000005,
        Byte = 0x00000006,
        Int16 = 0x00000007,
        UInt16 = 0x00000008,
        Int32 = 0x00000009,
        UInt32 = 0x0000000A,
        Int64 = 0x0000000B,
        UInt64 = 0x0000000C,
        Single = 0x0000000D,
        Double = 0x0000000E,
        Decimal = 0x0000000F,
        DateTime = 0x00000010,
        String = 0x00000012
    };
}

namespace PdfSharp
{
    namespace Pdf
    {
        enum class PdfOutlineStyle : unsigned int
        {
            Regular = 0x00000000,
            Italic = 0x00000001,
            Bold = 0x00000002,
            BoldItalic = 0x00000003
        };
        DEFINE_ENUM_FLAG_OPERATORS(PdfOutlineStyle)
    }
}

namespace PdfSharp
{
    namespace Pdf
    {
        enum class PdfPageDestinationType : unsigned int
        {
            Xyz = 0x00000000,
            Fit = 0x00000001,
            FitH = 0x00000002,
            FitV = 0x00000003,
            FitR = 0x00000004,
            FitB = 0x00000005,
            FitBH = 0x00000006,
            FitBV = 0x00000007
        };
    }
}

namespace PdfSharp
{
    enum class PageOrientation : unsigned int
    {
        Portrait = 0x00000000,
        Landscape = 0x00000001
    };
}

namespace PdfSharp
{
    enum class PageSize : unsigned int
    {
        Undefined = 0x00000000,
        A0 = 0x00000001,
        A1 = 0x00000002,
        A2 = 0x00000003,
        A3 = 0x00000004,
        A4 = 0x00000005,
        A5 = 0x00000006,
        RA0 = 0x00000007,
        RA1 = 0x00000008,
        RA2 = 0x00000009,
        RA3 = 0x0000000A,
        RA4 = 0x0000000B,
        RA5 = 0x0000000C,
        B0 = 0x0000000D,
        B1 = 0x0000000E,
        B2 = 0x0000000F,
        B3 = 0x00000010,
        B4 = 0x00000011,
        B5 = 0x00000012,
        Quarto = 0x00000064,
        Foolscap = 0x00000065,
        Executive = 0x00000066,
        GovernmentLetter = 0x00000067,
        Letter = 0x00000068,
        Legal = 0x00000069,
        Ledger = 0x0000006A,
        Tabloid = 0x0000006B,
        Post = 0x0000006C,
        Crown = 0x0000006D,
        LargePost = 0x0000006E,
        Demy = 0x0000006F,
        Medium = 0x00000070,
        Royal = 0x00000071,
        Elephant = 0x00000072,
        DoubleDemy = 0x00000073,
        QuadDemy = 0x00000074,
        STMT = 0x00000075,
        Folio = 0x00000078,
        Statement = 0x00000079,
        Size10x14 = 0x0000007A
    };
}

namespace PdfSharp
{
    namespace Pdf
    {
        enum class PdfStringEncoding : unsigned int
        {
            RawEncoding = 0x00000000,
            StandardEncoding = 0x00000001,
            PDFDocEncoding = 0x00000002,
            WinAnsiEncoding = 0x00000003,
            MacRomanEncoding = 0x00000005,
            MacExpertEncoding = 0x00000005,
            Unicode = 0x00000006
        };
        DEFINE_ENUM_FLAG_OPERATORS(PdfStringEncoding)
    }
}

namespace System
{
    namespace Reflection
    {
        enum class BindingFlags : unsigned int
        {
            Default = 0x00000000,
            IgnoreCase = 0x00000001,
            DeclaredOnly = 0x00000002,
            Instance = 0x00000004,
            Static = 0x00000008,
            Public = 0x00000010,
            NonPublic = 0x00000020,
            FlattenHierarchy = 0x00000040,
            InvokeMethod = 0x00000100,
            CreateInstance = 0x00000200,
            GetField = 0x00000400,
            SetField = 0x00000800,
            GetProperty = 0x00001000,
            SetProperty = 0x00002000,
            PutDispProperty = 0x00004000,
            PutRefDispProperty = 0x00008000,
            ExactBinding = 0x00010000,
            SuppressChangeType = 0x00020000,
            OptionalParamBinding = 0x00040000,
            IgnoreReturn = 0x01000000
        };
        DEFINE_ENUM_FLAG_OPERATORS(BindingFlags)
    }
}

namespace System
{
    namespace Reflection
    {
        enum class TypeAttributes : unsigned int
        {
            VisibilityMask = 0x00000007,
            NotPublic = 0x00000000,
            Public = 0x00000001,
            NestedPublic = 0x00000002,
            NestedPrivate = 0x00000003,
            NestedFamily = 0x00000004,
            NestedAssembly = 0x00000005,
            NestedFamANDAssem = 0x00000006,
            NestedFamORAssem = 0x00000007,
            LayoutMask = 0x00000018,
            AutoLayout = 0x00000000,
            SequentialLayout = 0x00000008,
            ExplicitLayout = 0x00000010,
            ClassSemanticsMask = 0x00000020,
            Class = 0x00000000,
            Interface = 0x00000020,
            Abstract = 0x00000080,
            Sealed = 0x00000100,
            SpecialName = 0x00000400,
            Import = 0x00001000,
            Serializable = 0x00002000,
            WindowsRuntime = 0x00004000,
            StringFormatMask = 0x00030000,
            AnsiClass = 0x00000000,
            UnicodeClass = 0x00010000,
            AutoClass = 0x00020000,
            CustomFormatClass = 0x00030000,
            CustomFormatMask = 0x00C00000,
            BeforeFieldInit = 0x00100000,
            ReservedMask = 0x00040800,
            RTSpecialName = 0x00000800,
            HasSecurity = 0x00040000
        };
        DEFINE_ENUM_FLAG_OPERATORS(TypeAttributes)
    }
}

namespace System
{
    namespace Reflection
    {
        enum class GenericParameterAttributes : unsigned int
        {
            None = 0x00000000,
            VarianceMask = 0x00000003,
            Covariant = 0x00000001,
            Contravariant = 0x00000002,
            SpecialConstraintMask = 0x0000001C,
            ReferenceTypeConstraint = 0x00000004,
            NotNullableValueTypeConstraint = 0x00000008,
            DefaultConstructorConstraint = 0x00000010
        };
        DEFINE_ENUM_FLAG_OPERATORS(GenericParameterAttributes)
    }
}

namespace System
{
    namespace Reflection
    {
        enum class MemberTypes : unsigned int
        {
            Constructor = 0x00000001,
            Event = 0x00000002,
            Field = 0x00000004,
            Method = 0x00000008,
            Property = 0x00000010,
            TypeInfo = 0x00000020,
            Custom = 0x00000040,
            NestedType = 0x00000080,
            All = 0x000000BF
        };
        DEFINE_ENUM_FLAG_OPERATORS(MemberTypes)
    }
}

namespace System
{
    namespace IO
    {
        enum class SeekOrigin : unsigned int
        {
            Begin = 0x00000000,
            Current = 0x00000001,
            End = 0x00000002
        };
    }
}

namespace System
{
    namespace Drawing
    {
        namespace Imaging
        {
            enum class PixelFormat : unsigned int
            {
Indexed = 0x00010000,
Gdi = 0x00020000,
Alpha = 0x00040000,
PAlpha = 0x00080000,
Extended = 0x00100000,
Canonical = 0x00200000,
Undefined = 0x00000000,
DontCare = 0x00000000,
Format1bppIndexed = 0x00030101,
Format4bppIndexed = 0x00030402,
Format8bppIndexed = 0x00030803,
Format16bppGrayScale = 0x00101004,
Format16bppRgb555 = 0x00021005,
Format16bppRgb565 = 0x00021006,
Format16bppArgb1555 = 0x00061007,
Format24bppRgb = 0x00021808,
Format32bppRgb = 0x00022009,
Format32bppArgb = 0x0026200A,
Format32bppPArgb = 0x000E200B,
Format48bppRgb = 0x0010300C,
Format64bppArgb = 0x0034400D,
Format64bppPArgb = 0x001C400E,
Max = 0x0000000F
            };
        }
    }
}

namespace System
{
    namespace Drawing
    {
        enum class GraphicsUnit : unsigned int
        {
            World = 0x00000000,
            Display = 0x00000001,
            Pixel = 0x00000002,
            Point = 0x00000003,
            Inch = 0x00000004,
            Document = 0x00000005,
            Millimeter = 0x00000006
        };
    }
}

namespace System
{
    namespace Drawing
    {
        enum class RotateFlipType : unsigned int
        {
            RotateNoneFlipNone = 0x00000000,
            Rotate90FlipNone = 0x00000001,
            Rotate180FlipNone = 0x00000002,
            Rotate270FlipNone = 0x00000003,
            RotateNoneFlipX = 0x00000004,
            Rotate90FlipX = 0x00000005,
            Rotate180FlipX = 0x00000006,
            Rotate270FlipX = 0x00000007,
            RotateNoneFlipY = 0x00000006,
            Rotate90FlipY = 0x00000007,
            Rotate180FlipY = 0x00000004,
            Rotate270FlipY = 0x00000005,
            RotateNoneFlipXY = 0x00000002,
            Rotate90FlipXY = 0x00000003,
            Rotate180FlipXY = 0x00000000,
            Rotate270FlipXY = 0x00000001
        };
    }
}

namespace System
{
    namespace Globalization
    {
        enum class CultureTypes : unsigned int
        {
            NeutralCultures = 0x00000001,
            SpecificCultures = 0x00000002,
            InstalledWin32Cultures = 0x00000004,
            AllCultures = 0x00000007,
            UserCustomCulture = 0x00000008,
            ReplacementCultures = 0x00000010,
            WindowsOnlyCultures = 0x00000020,
            FrameworkCultures = 0x00000040
        };
        DEFINE_ENUM_FLAG_OPERATORS(CultureTypes)
    }
}

namespace System
{
    namespace Drawing
    {
        namespace Text
        {
            enum class GenericFontFamilies : unsigned int
            {
Serif = 0x00000000,
SansSerif = 0x00000001,
Monospace = 0x00000002
            };
        }
    }
}

namespace System
{
    namespace Drawing
    {
        enum class FontStyle : unsigned int
        {
            Regular = 0x00000000,
            Bold = 0x00000001,
            Italic = 0x00000002,
            Underline = 0x00000004,
            Strikeout = 0x00000008
        };
        DEFINE_ENUM_FLAG_OPERATORS(FontStyle)
    }
}

namespace System
{
    namespace Drawing
    {
        namespace Drawing2D
        {
            enum class FlushIntention : unsigned int
            {
Flush = 0x00000000,
Sync = 0x00000001
            };
        }
    }
}

namespace System
{
    namespace Drawing
    {
        namespace Drawing2D
        {
            enum class CompositingMode : unsigned int
            {
SourceOver = 0x00000000,
SourceCopy = 0x00000001
            };
        }
    }
}

namespace System
{
    namespace Drawing
    {
        namespace Drawing2D
        {
            enum class CompositingQuality : unsigned int
            {
Invalid = 0xFFFFFFFF,
Default = 0x00000000,
HighSpeed = 0x00000001,
HighQuality = 0x00000002,
GammaCorrected = 0x00000003,
AssumeLinear = 0x00000004
            };
        }
    }
}

namespace System
{
    namespace Drawing
    {
        namespace Text
        {
            enum class TextRenderingHint : unsigned int
            {
SystemDefault = 0x00000000,
SingleBitPerPixelGridFit = 0x00000001,
SingleBitPerPixel = 0x00000002,
AntiAliasGridFit = 0x00000003,
AntiAlias = 0x00000004,
ClearTypeGridFit = 0x00000005
            };
        }
    }
}

namespace System
{
    namespace Drawing
    {
        namespace Drawing2D
        {
            enum class SmoothingMode : unsigned int
            {
Invalid = 0xFFFFFFFF,
Default = 0x00000000,
HighSpeed = 0x00000001,
HighQuality = 0x00000002,
None = 0x00000003,
AntiAlias = 0x00000004
            };
        }
    }
}

namespace System
{
    namespace Drawing
    {
        namespace Drawing2D
        {
            enum class PixelOffsetMode : unsigned int
            {
Invalid = 0xFFFFFFFF,
Default = 0x00000000,
HighSpeed = 0x00000001,
HighQuality = 0x00000002,
None = 0x00000003,
Half = 0x00000004
            };
        }
    }
}

namespace System
{
    namespace Drawing
    {
        namespace Drawing2D
        {
            enum class InterpolationMode : unsigned int
            {
Invalid = 0xFFFFFFFF,
Default = 0x00000000,
Low = 0x00000001,
High = 0x00000002,
Bilinear = 0x00000003,
Bicubic = 0x00000004,
NearestNeighbor = 0x00000005,
HighQualityBilinear = 0x00000006,
HighQualityBicubic = 0x00000007
            };
        }
    }
}

namespace System
{
    namespace Drawing
    {
        enum class CopyPixelOperation : unsigned int
        {
            Blackness = 0x00000042,
            CaptureBlt = 0x40000000,
            DestinationInvert = 0x00550009,
            MergeCopy = 0x00C000CA,
            MergePaint = 0x00BB0226,
            NoMirrorBitmap = 0x80000000,
            NotSourceCopy = 0x00330008,
            NotSourceErase = 0x001100A6,
            PatCopy = 0x00F00021,
            PatInvert = 0x005A0049,
            PatPaint = 0x00FB0A09,
            SourceAnd = 0x008800C6,
            SourceCopy = 0x00CC0020,
            SourceErase = 0x00440328,
            SourceInvert = 0x00660046,
            SourcePaint = 0x00EE0086,
            Whiteness = 0x00FF0062
        };
    }
}

namespace System
{
    namespace Drawing
    {
        namespace Drawing2D
        {
            enum class MatrixOrder : unsigned int
            {
Prepend = 0x00000000,
Append = 0x00000001
            };
        }
    }
}

namespace System
{
    namespace Drawing
    {
        namespace Drawing2D
        {
            enum class CoordinateSpace : unsigned int
            {
World = 0x00000000,
Page = 0x00000001,
Device = 0x00000002
            };
        }
    }
}

namespace System
{
    namespace Drawing
    {
        namespace Drawing2D
        {
            enum class CombineMode : unsigned int
            {
Replace = 0x00000000,
Intersect = 0x00000001,
Union = 0x00000002,
Xor = 0x00000003,
Exclude = 0x00000004,
Complement = 0x00000005
            };
        }
    }
}

namespace System
{
    namespace Drawing
    {
        namespace Drawing2D
        {
            enum class FillMode : unsigned int
            {
Alternate = 0x00000000,
Winding = 0x00000001
            };
        }
    }
}

namespace System
{
    enum class DateTimeKind : unsigned int
    {
        Unspecified = 0x00000000,
        Utc = 0x00000001,
        Local = 0x00000002
    };
}

namespace System
{
    enum class DayOfWeek : unsigned int
    {
        Sunday = 0x00000000,
        Monday = 0x00000001,
        Tuesday = 0x00000002,
        Wednesday = 0x00000003,
        Thursday = 0x00000004,
        Friday = 0x00000005,
        Saturday = 0x00000006
    };
}

namespace PdfSharp
{
    namespace Pdf
    {
        enum class PdfReadingDirection : unsigned int
        {
            LeftToRight = 0x00000000,
            RightToLeft = 0x00000001
        };
    }
}






///////////////////////////////////////////////////////////////////////////////
// 
// C++ class Object for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace System
{
    class Object
    {

    public:

        PDFSHARPGDIBRIDGE_API Object();

        PDFSHARPGDIBRIDGE_API Object(int value);

        PDFSHARPGDIBRIDGE_API Object(unsigned int value);

        PDFSHARPGDIBRIDGE_API Object(short int value);

        PDFSHARPGDIBRIDGE_API Object(unsigned short int value);

        PDFSHARPGDIBRIDGE_API Object(__int64 value);

        PDFSHARPGDIBRIDGE_API Object(unsigned __int64 value);

        PDFSHARPGDIBRIDGE_API Object(wchar_t value);

        PDFSHARPGDIBRIDGE_API Object(unsigned char value);

        PDFSHARPGDIBRIDGE_API Object(bool value);

        PDFSHARPGDIBRIDGE_API Object(float value);

        PDFSHARPGDIBRIDGE_API Object(double value);

        PDFSHARPGDIBRIDGE_API Object(const wchar_t * value);

        PDFSHARPGDIBRIDGE_API Object(xinterop::Decimal value);

        PDFSHARPGDIBRIDGE_API virtual ~Object();

        #ifdef GetHashCode
        #pragma push_macro("GetHashCode")
        #undef GetHashCode
        #define XINTEROP_GetHashCode
        #endif

        PDFSHARPGDIBRIDGE_API int GetHashCode();

        #ifdef XINTEROP_GetHashCode
        #pragma pop_macro("GetHashCode")
        #endif



        #ifdef ToString
        #pragma push_macro("ToString")
        #undef ToString
        #define XINTEROP_ToString
        #endif

        PDFSHARPGDIBRIDGE_API std::wstring ToString();

        #ifdef XINTEROP_ToString
        #pragma pop_macro("ToString")
        #endif



        #ifdef Equals
        #pragma push_macro("Equals")
        #undef Equals
        #define XINTEROP_Equals
        #endif

        PDFSHARPGDIBRIDGE_API bool Equals(class System::Object * obj);

        #ifdef XINTEROP_Equals
        #pragma pop_macro("Equals")
        #endif



        #ifdef GetType
        #pragma push_macro("GetType")
        #undef GetType
        #define XINTEROP_GetType
        #endif

        PDFSHARPGDIBRIDGE_API std::shared_ptr<class System::Type> GetType();

        #ifdef XINTEROP_GetType
        #pragma pop_macro("GetType")
        #endif



        #ifdef ReferenceEquals
        #pragma push_macro("ReferenceEquals")
        #undef ReferenceEquals
        #define XINTEROP_ReferenceEquals
        #endif

        PDFSHARPGDIBRIDGE_API static bool ReferenceEquals(class System::Object * objA, class System::Object * objB);

        #ifdef XINTEROP_ReferenceEquals
        #pragma pop_macro("ReferenceEquals")
        #endif



        #ifdef Equals
        #pragma push_macro("Equals")
        #undef Equals
        #define XINTEROP_Equals
        #endif

        PDFSHARPGDIBRIDGE_API static bool Equals(class System::Object * objA, class System::Object * objB);

        #ifdef XINTEROP_Equals
        #pragma pop_macro("Equals")
        #endif




        #ifdef xIsNull
        #undef xIsNull
        #endif

        PDFSHARPGDIBRIDGE_API bool xIsNull();

        #ifdef xIsNotNull
        #undef xIsNotNull
        #endif

        PDFSHARPGDIBRIDGE_API bool xIsNotNull();


    private:
        void* reserved1;
        bool reserved2;
        bool reserved3;
    };
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class CodeBase for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class CodeBase : public System::Object
            {

            public:

PDFSHARPGDIBRIDGE_API virtual ~CodeBase();

#ifdef get_Size
#pragma push_macro("get_Size")
#undef get_Size
#define XINTEROP_get_Size
#endif

PDFSHARPGDIBRIDGE_API std::shared_ptr<class PdfSharp::Drawing::XSize> get_Size();

#ifdef XINTEROP_get_Size
#pragma pop_macro("get_Size")
#endif



// Simulates .NET property.
__declspec(property(get = get_Size, put = set_Size)) std::shared_ptr<class PdfSharp::Drawing::XSize> Size;



#ifdef set_Size
#pragma push_macro("set_Size")
#undef set_Size
#define XINTEROP_set_Size
#endif

PDFSHARPGDIBRIDGE_API void set_Size(class PdfSharp::Drawing::XSize * value);

#ifdef XINTEROP_set_Size
#pragma pop_macro("set_Size")
#endif



#ifdef get_Text
#pragma push_macro("get_Text")
#undef get_Text
#define XINTEROP_get_Text
#endif

PDFSHARPGDIBRIDGE_API std::wstring get_Text();

#ifdef XINTEROP_get_Text
#pragma pop_macro("get_Text")
#endif



// Simulates .NET property.
__declspec(property(get = get_Text, put = set_Text)) std::wstring Text;



#ifdef set_Text
#pragma push_macro("set_Text")
#undef set_Text
#define XINTEROP_set_Text
#endif

PDFSHARPGDIBRIDGE_API void set_Text(const wchar_t * value);

#ifdef XINTEROP_set_Text
#pragma pop_macro("set_Text")
#endif



#ifdef get_Anchor
#pragma push_macro("get_Anchor")
#undef get_Anchor
#define XINTEROP_get_Anchor
#endif

PDFSHARPGDIBRIDGE_API enum class PdfSharp::Drawing::BarCodes::AnchorType get_Anchor();

#ifdef XINTEROP_get_Anchor
#pragma pop_macro("get_Anchor")
#endif



// Simulates .NET property.
__declspec(property(get = get_Anchor, put = set_Anchor)) enum class PdfSharp::Drawing::BarCodes::AnchorType Anchor;



#ifdef set_Anchor
#pragma push_macro("set_Anchor")
#undef set_Anchor
#define XINTEROP_set_Anchor
#endif

PDFSHARPGDIBRIDGE_API void set_Anchor(enum class PdfSharp::Drawing::BarCodes::AnchorType value);

#ifdef XINTEROP_set_Anchor
#pragma pop_macro("set_Anchor")
#endif



#ifdef get_Direction
#pragma push_macro("get_Direction")
#undef get_Direction
#define XINTEROP_get_Direction
#endif

PDFSHARPGDIBRIDGE_API enum class PdfSharp::Drawing::BarCodes::CodeDirection get_Direction();

#ifdef XINTEROP_get_Direction
#pragma pop_macro("get_Direction")
#endif



// Simulates .NET property.
__declspec(property(get = get_Direction, put = set_Direction)) enum class PdfSharp::Drawing::BarCodes::CodeDirection Direction;



#ifdef set_Direction
#pragma push_macro("set_Direction")
#undef set_Direction
#define XINTEROP_set_Direction
#endif

PDFSHARPGDIBRIDGE_API void set_Direction(enum class PdfSharp::Drawing::BarCodes::CodeDirection value);

#ifdef XINTEROP_set_Direction
#pragma pop_macro("set_Direction")
#endif



#ifdef CalcDistance
#pragma push_macro("CalcDistance")
#undef CalcDistance
#define XINTEROP_CalcDistance
#endif

PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XVector> CalcDistance(enum class PdfSharp::Drawing::BarCodes::AnchorType oldType, enum class PdfSharp::Drawing::BarCodes::AnchorType newType, class PdfSharp::Drawing::XSize * size);

#ifdef XINTEROP_CalcDistance
#pragma pop_macro("CalcDistance")
#endif



#ifdef ToCodeBase
#pragma push_macro("ToCodeBase")
#undef ToCodeBase
#define XINTEROP_ToCodeBase
#endif

PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::BarCodes::CodeBase> ToCodeBase(class System::Object * value);

#ifdef XINTEROP_ToCodeBase
#pragma pop_macro("ToCodeBase")
#endif



            };
        }
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class BarCode for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class BarCode : public PdfSharp::Drawing::BarCodes::CodeBase
            {

            public:

PDFSHARPGDIBRIDGE_API virtual ~BarCode();

#ifdef FromType
#pragma push_macro("FromType")
#undef FromType
#define XINTEROP_FromType
#endif

PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::BarCodes::BarCode> FromType(enum class PdfSharp::Drawing::BarCodes::CodeType type, const wchar_t * text, class PdfSharp::Drawing::XSize * size, enum class PdfSharp::Drawing::BarCodes::CodeDirection direction);

#ifdef XINTEROP_FromType
#pragma pop_macro("FromType")
#endif



#ifdef FromType
#pragma push_macro("FromType")
#undef FromType
#define XINTEROP_FromType
#endif

PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::BarCodes::BarCode> FromType(enum class PdfSharp::Drawing::BarCodes::CodeType type, const wchar_t * text, class PdfSharp::Drawing::XSize * size);

#ifdef XINTEROP_FromType
#pragma pop_macro("FromType")
#endif



#ifdef FromType
#pragma push_macro("FromType")
#undef FromType
#define XINTEROP_FromType
#endif

PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::BarCodes::BarCode> FromType(enum class PdfSharp::Drawing::BarCodes::CodeType type, const wchar_t * text);

#ifdef XINTEROP_FromType
#pragma pop_macro("FromType")
#endif



#ifdef FromType
#pragma push_macro("FromType")
#undef FromType
#define XINTEROP_FromType
#endif

PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::BarCodes::BarCode> FromType(enum class PdfSharp::Drawing::BarCodes::CodeType type);

#ifdef XINTEROP_FromType
#pragma pop_macro("FromType")
#endif



#ifdef get_WideNarrowRatio
#pragma push_macro("get_WideNarrowRatio")
#undef get_WideNarrowRatio
#define XINTEROP_get_WideNarrowRatio
#endif

PDFSHARPGDIBRIDGE_API double get_WideNarrowRatio();

#ifdef XINTEROP_get_WideNarrowRatio
#pragma pop_macro("get_WideNarrowRatio")
#endif



// Simulates .NET property.
__declspec(property(get = get_WideNarrowRatio, put = set_WideNarrowRatio)) double WideNarrowRatio;



#ifdef set_WideNarrowRatio
#pragma push_macro("set_WideNarrowRatio")
#undef set_WideNarrowRatio
#define XINTEROP_set_WideNarrowRatio
#endif

PDFSHARPGDIBRIDGE_API void set_WideNarrowRatio(double value);

#ifdef XINTEROP_set_WideNarrowRatio
#pragma pop_macro("set_WideNarrowRatio")
#endif



#ifdef get_TextLocation
#pragma push_macro("get_TextLocation")
#undef get_TextLocation
#define XINTEROP_get_TextLocation
#endif

PDFSHARPGDIBRIDGE_API enum class PdfSharp::Drawing::BarCodes::TextLocation get_TextLocation();

#ifdef XINTEROP_get_TextLocation
#pragma pop_macro("get_TextLocation")
#endif



// Simulates .NET property.
__declspec(property(get = get_TextLocation, put = set_TextLocation)) enum class PdfSharp::Drawing::BarCodes::TextLocation TextLocation;



#ifdef set_TextLocation
#pragma push_macro("set_TextLocation")
#undef set_TextLocation
#define XINTEROP_set_TextLocation
#endif

PDFSHARPGDIBRIDGE_API void set_TextLocation(enum class PdfSharp::Drawing::BarCodes::TextLocation value);

#ifdef XINTEROP_set_TextLocation
#pragma pop_macro("set_TextLocation")
#endif



#ifdef get_DataLength
#pragma push_macro("get_DataLength")
#undef get_DataLength
#define XINTEROP_get_DataLength
#endif

PDFSHARPGDIBRIDGE_API int get_DataLength();

#ifdef XINTEROP_get_DataLength
#pragma pop_macro("get_DataLength")
#endif



// Simulates .NET property.
__declspec(property(get = get_DataLength, put = set_DataLength)) int DataLength;



#ifdef set_DataLength
#pragma push_macro("set_DataLength")
#undef set_DataLength
#define XINTEROP_set_DataLength
#endif

PDFSHARPGDIBRIDGE_API void set_DataLength(int value);

#ifdef XINTEROP_set_DataLength
#pragma pop_macro("set_DataLength")
#endif



#ifdef get_StartChar
#pragma push_macro("get_StartChar")
#undef get_StartChar
#define XINTEROP_get_StartChar
#endif

PDFSHARPGDIBRIDGE_API wchar_t get_StartChar();

#ifdef XINTEROP_get_StartChar
#pragma pop_macro("get_StartChar")
#endif



// Simulates .NET property.
__declspec(property(get = get_StartChar, put = set_StartChar)) wchar_t StartChar;



#ifdef set_StartChar
#pragma push_macro("set_StartChar")
#undef set_StartChar
#define XINTEROP_set_StartChar
#endif

PDFSHARPGDIBRIDGE_API void set_StartChar(wchar_t value);

#ifdef XINTEROP_set_StartChar
#pragma pop_macro("set_StartChar")
#endif



#ifdef get_EndChar
#pragma push_macro("get_EndChar")
#undef get_EndChar
#define XINTEROP_get_EndChar
#endif

PDFSHARPGDIBRIDGE_API wchar_t get_EndChar();

#ifdef XINTEROP_get_EndChar
#pragma pop_macro("get_EndChar")
#endif



// Simulates .NET property.
__declspec(property(get = get_EndChar, put = set_EndChar)) wchar_t EndChar;



#ifdef set_EndChar
#pragma push_macro("set_EndChar")
#undef set_EndChar
#define XINTEROP_set_EndChar
#endif

PDFSHARPGDIBRIDGE_API void set_EndChar(wchar_t value);

#ifdef XINTEROP_set_EndChar
#pragma pop_macro("set_EndChar")
#endif



#ifdef get_TurboBit
#pragma push_macro("get_TurboBit")
#undef get_TurboBit
#define XINTEROP_get_TurboBit
#endif

PDFSHARPGDIBRIDGE_API bool get_TurboBit();

#ifdef XINTEROP_get_TurboBit
#pragma pop_macro("get_TurboBit")
#endif



// Simulates .NET property.
__declspec(property(get = get_TurboBit, put = set_TurboBit)) bool TurboBit;



#ifdef set_TurboBit
#pragma push_macro("set_TurboBit")
#undef set_TurboBit
#define XINTEROP_set_TurboBit
#endif

PDFSHARPGDIBRIDGE_API void set_TurboBit(bool value);

#ifdef XINTEROP_set_TurboBit
#pragma pop_macro("set_TurboBit")
#endif



#ifdef ToBarCode
#pragma push_macro("ToBarCode")
#undef ToBarCode
#define XINTEROP_ToBarCode
#endif

PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::BarCodes::BarCode> ToBarCode(class System::Object * value);

#ifdef XINTEROP_ToBarCode
#pragma pop_macro("ToBarCode")
#endif



            };
        }
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class ThickThinBarCode for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class ThickThinBarCode : public PdfSharp::Drawing::BarCodes::BarCode
            {

            public:

PDFSHARPGDIBRIDGE_API virtual ~ThickThinBarCode();

#ifdef ToThickThinBarCode
#pragma push_macro("ToThickThinBarCode")
#undef ToThickThinBarCode
#define XINTEROP_ToThickThinBarCode
#endif

PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::BarCodes::ThickThinBarCode> ToThickThinBarCode(class System::Object * value);

#ifdef XINTEROP_ToThickThinBarCode
#pragma pop_macro("ToThickThinBarCode")
#endif



            };
        }
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class Code2of5Interleaved for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class Code2of5Interleaved : public PdfSharp::Drawing::BarCodes::ThickThinBarCode
            {

            public:

PDFSHARPGDIBRIDGE_API Code2of5Interleaved();

PDFSHARPGDIBRIDGE_API Code2of5Interleaved(const wchar_t * code);

PDFSHARPGDIBRIDGE_API Code2of5Interleaved(const wchar_t * code, class PdfSharp::Drawing::XSize * size);

PDFSHARPGDIBRIDGE_API Code2of5Interleaved(const wchar_t * code, class PdfSharp::Drawing::XSize * size, enum class PdfSharp::Drawing::BarCodes::CodeDirection direction);

PDFSHARPGDIBRIDGE_API virtual ~Code2of5Interleaved();

#ifdef ToCode2of5Interleaved
#pragma push_macro("ToCode2of5Interleaved")
#undef ToCode2of5Interleaved
#define XINTEROP_ToCode2of5Interleaved
#endif

PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::BarCodes::Code2of5Interleaved> ToCode2of5Interleaved(class System::Object * value);

#ifdef XINTEROP_ToCode2of5Interleaved
#pragma pop_macro("ToCode2of5Interleaved")
#endif



            };
        }
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class Code3of9Standard for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class Code3of9Standard : public PdfSharp::Drawing::BarCodes::ThickThinBarCode
            {

            public:

PDFSHARPGDIBRIDGE_API Code3of9Standard();

PDFSHARPGDIBRIDGE_API Code3of9Standard(const wchar_t * code);

PDFSHARPGDIBRIDGE_API Code3of9Standard(const wchar_t * code, class PdfSharp::Drawing::XSize * size);

PDFSHARPGDIBRIDGE_API Code3of9Standard(const wchar_t * code, class PdfSharp::Drawing::XSize * size, enum class PdfSharp::Drawing::BarCodes::CodeDirection direction);

PDFSHARPGDIBRIDGE_API virtual ~Code3of9Standard();

#ifdef ToCode3of9Standard
#pragma push_macro("ToCode3of9Standard")
#undef ToCode3of9Standard
#define XINTEROP_ToCode3of9Standard
#endif

PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::BarCodes::Code3of9Standard> ToCode3of9Standard(class System::Object * value);

#ifdef XINTEROP_ToCode3of9Standard
#pragma pop_macro("ToCode3of9Standard")
#endif



            };
        }
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class CodeOmr for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class CodeOmr : public PdfSharp::Drawing::BarCodes::BarCode
            {

            public:

PDFSHARPGDIBRIDGE_API CodeOmr(const wchar_t * text, class PdfSharp::Drawing::XSize * size, enum class PdfSharp::Drawing::BarCodes::CodeDirection direction);

PDFSHARPGDIBRIDGE_API virtual ~CodeOmr();

#ifdef get_SynchronizeCode
#pragma push_macro("get_SynchronizeCode")
#undef get_SynchronizeCode
#define XINTEROP_get_SynchronizeCode
#endif

PDFSHARPGDIBRIDGE_API bool get_SynchronizeCode();

#ifdef XINTEROP_get_SynchronizeCode
#pragma pop_macro("get_SynchronizeCode")
#endif



// Simulates .NET property.
__declspec(property(get = get_SynchronizeCode, put = set_SynchronizeCode)) bool SynchronizeCode;



#ifdef set_SynchronizeCode
#pragma push_macro("set_SynchronizeCode")
#undef set_SynchronizeCode
#define XINTEROP_set_SynchronizeCode
#endif

PDFSHARPGDIBRIDGE_API void set_SynchronizeCode(bool value);

#ifdef XINTEROP_set_SynchronizeCode
#pragma pop_macro("set_SynchronizeCode")
#endif



#ifdef get_MakerDistance
#pragma push_macro("get_MakerDistance")
#undef get_MakerDistance
#define XINTEROP_get_MakerDistance
#endif

PDFSHARPGDIBRIDGE_API double get_MakerDistance();

#ifdef XINTEROP_get_MakerDistance
#pragma pop_macro("get_MakerDistance")
#endif



// Simulates .NET property.
__declspec(property(get = get_MakerDistance, put = set_MakerDistance)) double MakerDistance;



#ifdef set_MakerDistance
#pragma push_macro("set_MakerDistance")
#undef set_MakerDistance
#define XINTEROP_set_MakerDistance
#endif

PDFSHARPGDIBRIDGE_API void set_MakerDistance(double value);

#ifdef XINTEROP_set_MakerDistance
#pragma pop_macro("set_MakerDistance")
#endif



#ifdef get_MakerThickness
#pragma push_macro("get_MakerThickness")
#undef get_MakerThickness
#define XINTEROP_get_MakerThickness
#endif

PDFSHARPGDIBRIDGE_API double get_MakerThickness();

#ifdef XINTEROP_get_MakerThickness
#pragma pop_macro("get_MakerThickness")
#endif



// Simulates .NET property.
__declspec(property(get = get_MakerThickness, put = set_MakerThickness)) double MakerThickness;



#ifdef set_MakerThickness
#pragma push_macro("set_MakerThickness")
#undef set_MakerThickness
#define XINTEROP_set_MakerThickness
#endif

PDFSHARPGDIBRIDGE_API void set_MakerThickness(double value);

#ifdef XINTEROP_set_MakerThickness
#pragma pop_macro("set_MakerThickness")
#endif



#ifdef ToCodeOmr
#pragma push_macro("ToCodeOmr")
#undef ToCodeOmr
#define XINTEROP_ToCodeOmr
#endif

PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::BarCodes::CodeOmr> ToCodeOmr(class System::Object * value);

#ifdef XINTEROP_ToCodeOmr
#pragma pop_macro("ToCodeOmr")
#endif



            };
        }
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class MatrixCode for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class MatrixCode : public PdfSharp::Drawing::BarCodes::CodeBase
            {

            public:

PDFSHARPGDIBRIDGE_API virtual ~MatrixCode();

#ifdef get_Encoding
#pragma push_macro("get_Encoding")
#undef get_Encoding
#define XINTEROP_get_Encoding
#endif

PDFSHARPGDIBRIDGE_API std::wstring get_Encoding();

#ifdef XINTEROP_get_Encoding
#pragma pop_macro("get_Encoding")
#endif



// Simulates .NET property.
__declspec(property(get = get_Encoding, put = set_Encoding)) std::wstring Encoding;



#ifdef set_Encoding
#pragma push_macro("set_Encoding")
#undef set_Encoding
#define XINTEROP_set_Encoding
#endif

PDFSHARPGDIBRIDGE_API void set_Encoding(const wchar_t * value);

#ifdef XINTEROP_set_Encoding
#pragma pop_macro("set_Encoding")
#endif



#ifdef get_Columns
#pragma push_macro("get_Columns")
#undef get_Columns
#define XINTEROP_get_Columns
#endif

PDFSHARPGDIBRIDGE_API int get_Columns();

#ifdef XINTEROP_get_Columns
#pragma pop_macro("get_Columns")
#endif



// Simulates .NET property.
__declspec(property(get = get_Columns, put = set_Columns)) int Columns;



#ifdef set_Columns
#pragma push_macro("set_Columns")
#undef set_Columns
#define XINTEROP_set_Columns
#endif

PDFSHARPGDIBRIDGE_API void set_Columns(int value);

#ifdef XINTEROP_set_Columns
#pragma pop_macro("set_Columns")
#endif



#ifdef get_Rows
#pragma push_macro("get_Rows")
#undef get_Rows
#define XINTEROP_get_Rows
#endif

PDFSHARPGDIBRIDGE_API int get_Rows();

#ifdef XINTEROP_get_Rows
#pragma pop_macro("get_Rows")
#endif



// Simulates .NET property.
__declspec(property(get = get_Rows, put = set_Rows)) int Rows;



#ifdef set_Rows
#pragma push_macro("set_Rows")
#undef set_Rows
#define XINTEROP_set_Rows
#endif

PDFSHARPGDIBRIDGE_API void set_Rows(int value);

#ifdef XINTEROP_set_Rows
#pragma pop_macro("set_Rows")
#endif



#ifdef get_Text
#pragma push_macro("get_Text")
#undef get_Text
#define XINTEROP_get_Text
#endif

PDFSHARPGDIBRIDGE_API std::wstring get_Text();

#ifdef XINTEROP_get_Text
#pragma pop_macro("get_Text")
#endif



// Simulates .NET property.
__declspec(property(get = get_Text, put = set_Text)) std::wstring Text;



#ifdef set_Text
#pragma push_macro("set_Text")
#undef set_Text
#define XINTEROP_set_Text
#endif

PDFSHARPGDIBRIDGE_API void set_Text(const wchar_t * value);

#ifdef XINTEROP_set_Text
#pragma pop_macro("set_Text")
#endif



#ifdef ToMatrixCode
#pragma push_macro("ToMatrixCode")
#undef ToMatrixCode
#define XINTEROP_ToMatrixCode
#endif

PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::BarCodes::MatrixCode> ToMatrixCode(class System::Object * value);

#ifdef XINTEROP_ToMatrixCode
#pragma pop_macro("ToMatrixCode")
#endif



            };
        }
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class CodeDataMatrix for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        namespace BarCodes
        {
            class CodeDataMatrix : public PdfSharp::Drawing::BarCodes::MatrixCode
            {

            public:

PDFSHARPGDIBRIDGE_API CodeDataMatrix();

PDFSHARPGDIBRIDGE_API CodeDataMatrix(const wchar_t * code, int length);

PDFSHARPGDIBRIDGE_API CodeDataMatrix(const wchar_t * code, int length, class PdfSharp::Drawing::XSize * size);

PDFSHARPGDIBRIDGE_API CodeDataMatrix(const wchar_t * code, enum class PdfSharp::Drawing::BarCodes::DataMatrixEncoding dmEncoding, int length, class PdfSharp::Drawing::XSize * size);

PDFSHARPGDIBRIDGE_API CodeDataMatrix(const wchar_t * code, int rows, int columns);

PDFSHARPGDIBRIDGE_API CodeDataMatrix(const wchar_t * code, int rows, int columns, class PdfSharp::Drawing::XSize * size);

PDFSHARPGDIBRIDGE_API CodeDataMatrix(const wchar_t * code, enum class PdfSharp::Drawing::BarCodes::DataMatrixEncoding dmEncoding, int rows, int columns, class PdfSharp::Drawing::XSize * size);

PDFSHARPGDIBRIDGE_API CodeDataMatrix(const wchar_t * code, int rows, int columns, int quietZone);

PDFSHARPGDIBRIDGE_API CodeDataMatrix(const wchar_t * code, const wchar_t * encoding, int rows, int columns, int quietZone, class PdfSharp::Drawing::XSize * size);

PDFSHARPGDIBRIDGE_API virtual ~CodeDataMatrix();

#ifdef SetEncoding
#pragma push_macro("SetEncoding")
#undef SetEncoding
#define XINTEROP_SetEncoding
#endif

PDFSHARPGDIBRIDGE_API void SetEncoding(enum class PdfSharp::Drawing::BarCodes::DataMatrixEncoding dmEncoding);

#ifdef XINTEROP_SetEncoding
#pragma pop_macro("SetEncoding")
#endif



#ifdef get_QuietZone
#pragma push_macro("get_QuietZone")
#undef get_QuietZone
#define XINTEROP_get_QuietZone
#endif

PDFSHARPGDIBRIDGE_API int get_QuietZone();

#ifdef XINTEROP_get_QuietZone
#pragma pop_macro("get_QuietZone")
#endif



// Simulates .NET property.
__declspec(property(get = get_QuietZone, put = set_QuietZone)) int QuietZone;



#ifdef set_QuietZone
#pragma push_macro("set_QuietZone")
#undef set_QuietZone
#define XINTEROP_set_QuietZone
#endif

PDFSHARPGDIBRIDGE_API void set_QuietZone(int value);

#ifdef XINTEROP_set_QuietZone
#pragma pop_macro("set_QuietZone")
#endif



#ifdef ToCodeDataMatrix
#pragma push_macro("ToCodeDataMatrix")
#undef ToCodeDataMatrix
#define XINTEROP_ToCodeDataMatrix
#endif

PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::BarCodes::CodeDataMatrix> ToCodeDataMatrix(class System::Object * value);

#ifdef XINTEROP_ToCodeDataMatrix
#pragma pop_macro("ToCodeDataMatrix")
#endif



            };
        }
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class XTextFormatter for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        namespace Layout
        {
            class XTextFormatter : public System::Object
            {

            public:

PDFSHARPGDIBRIDGE_API XTextFormatter(class PdfSharp::Drawing::XGraphics * gfx);

PDFSHARPGDIBRIDGE_API virtual ~XTextFormatter();

#ifdef get_Text
#pragma push_macro("get_Text")
#undef get_Text
#define XINTEROP_get_Text
#endif

PDFSHARPGDIBRIDGE_API std::wstring get_Text();

#ifdef XINTEROP_get_Text
#pragma pop_macro("get_Text")
#endif



// Simulates .NET property.
__declspec(property(get = get_Text, put = set_Text)) std::wstring Text;



#ifdef set_Text
#pragma push_macro("set_Text")
#undef set_Text
#define XINTEROP_set_Text
#endif

PDFSHARPGDIBRIDGE_API void set_Text(const wchar_t * value);

#ifdef XINTEROP_set_Text
#pragma pop_macro("set_Text")
#endif



#ifdef get_Font
#pragma push_macro("get_Font")
#undef get_Font
#define XINTEROP_get_Font
#endif

PDFSHARPGDIBRIDGE_API std::shared_ptr<class PdfSharp::Drawing::XFont> get_Font();

#ifdef XINTEROP_get_Font
#pragma pop_macro("get_Font")
#endif



// Simulates .NET property.
__declspec(property(get = get_Font, put = set_Font)) std::shared_ptr<class PdfSharp::Drawing::XFont> Font;



#ifdef set_Font
#pragma push_macro("set_Font")
#undef set_Font
#define XINTEROP_set_Font
#endif

PDFSHARPGDIBRIDGE_API void set_Font(class PdfSharp::Drawing::XFont * value);

#ifdef XINTEROP_set_Font
#pragma pop_macro("set_Font")
#endif



#ifdef get_LayoutRectangle
#pragma push_macro("get_LayoutRectangle")
#undef get_LayoutRectangle
#define XINTEROP_get_LayoutRectangle
#endif

PDFSHARPGDIBRIDGE_API std::shared_ptr<class PdfSharp::Drawing::XRect> get_LayoutRectangle();

#ifdef XINTEROP_get_LayoutRectangle
#pragma pop_macro("get_LayoutRectangle")
#endif



// Simulates .NET property.
__declspec(property(get = get_LayoutRectangle, put = set_LayoutRectangle)) std::shared_ptr<class PdfSharp::Drawing::XRect> LayoutRectangle;



#ifdef set_LayoutRectangle
#pragma push_macro("set_LayoutRectangle")
#undef set_LayoutRectangle
#define XINTEROP_set_LayoutRectangle
#endif

PDFSHARPGDIBRIDGE_API void set_LayoutRectangle(class PdfSharp::Drawing::XRect * value);

#ifdef XINTEROP_set_LayoutRectangle
#pragma pop_macro("set_LayoutRectangle")
#endif



#ifdef get_Alignment
#pragma push_macro("get_Alignment")
#undef get_Alignment
#define XINTEROP_get_Alignment
#endif

PDFSHARPGDIBRIDGE_API enum class PdfSharp::Drawing::Layout::XParagraphAlignment get_Alignment();

#ifdef XINTEROP_get_Alignment
#pragma pop_macro("get_Alignment")
#endif



// Simulates .NET property.
__declspec(property(get = get_Alignment, put = set_Alignment)) enum class PdfSharp::Drawing::Layout::XParagraphAlignment Alignment;



#ifdef set_Alignment
#pragma push_macro("set_Alignment")
#undef set_Alignment
#define XINTEROP_set_Alignment
#endif

PDFSHARPGDIBRIDGE_API void set_Alignment(enum class PdfSharp::Drawing::Layout::XParagraphAlignment value);

#ifdef XINTEROP_set_Alignment
#pragma pop_macro("set_Alignment")
#endif



#ifdef DrawString
#pragma push_macro("DrawString")
#undef DrawString
#define XINTEROP_DrawString
#endif

PDFSHARPGDIBRIDGE_API void DrawString(const wchar_t * text, class PdfSharp::Drawing::XFont * font, class PdfSharp::Drawing::XBrush * brush, class PdfSharp::Drawing::XRect * layoutRectangle);

#ifdef XINTEROP_DrawString
#pragma pop_macro("DrawString")
#endif



#ifdef DrawString
#pragma push_macro("DrawString")
#undef DrawString
#define XINTEROP_DrawString
#endif

PDFSHARPGDIBRIDGE_API void DrawString(const wchar_t * text, class PdfSharp::Drawing::XFont * font, class PdfSharp::Drawing::XBrush * brush, class PdfSharp::Drawing::XRect * layoutRectangle, class PdfSharp::Drawing::XStringFormat * format);

#ifdef XINTEROP_DrawString
#pragma pop_macro("DrawString")
#endif



#ifdef ToXTextFormatter
#pragma push_macro("ToXTextFormatter")
#undef ToXTextFormatter
#define XINTEROP_ToXTextFormatter
#endif

PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::Layout::XTextFormatter> ToXTextFormatter(class System::Object * value);

#ifdef XINTEROP_ToXTextFormatter
#pragma pop_macro("ToXTextFormatter")
#endif



            };
        }
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class XPdfFontOptions for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        class XPdfFontOptions : public System::Object
        {

        public:

            PDFSHARPGDIBRIDGE_API XPdfFontOptions(enum class PdfSharp::Pdf::PdfFontEncoding encoding);

            PDFSHARPGDIBRIDGE_API virtual ~XPdfFontOptions();

            #ifdef get_FontEmbedding
            #pragma push_macro("get_FontEmbedding")
            #undef get_FontEmbedding
            #define XINTEROP_get_FontEmbedding
            #endif

            PDFSHARPGDIBRIDGE_API enum class PdfSharp::Pdf::PdfFontEmbedding get_FontEmbedding();

            #ifdef XINTEROP_get_FontEmbedding
            #pragma pop_macro("get_FontEmbedding")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_FontEmbedding)) enum class PdfSharp::Pdf::PdfFontEmbedding FontEmbedding;



            #ifdef get_FontEncoding
            #pragma push_macro("get_FontEncoding")
            #undef get_FontEncoding
            #define XINTEROP_get_FontEncoding
            #endif

            PDFSHARPGDIBRIDGE_API enum class PdfSharp::Pdf::PdfFontEncoding get_FontEncoding();

            #ifdef XINTEROP_get_FontEncoding
            #pragma pop_macro("get_FontEncoding")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_FontEncoding)) enum class PdfSharp::Pdf::PdfFontEncoding FontEncoding;



            #ifdef get_WinAnsiDefault
            #pragma push_macro("get_WinAnsiDefault")
            #undef get_WinAnsiDefault
            #define XINTEROP_get_WinAnsiDefault
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XPdfFontOptions> get_WinAnsiDefault();

            #ifdef XINTEROP_get_WinAnsiDefault
            #pragma pop_macro("get_WinAnsiDefault")
            #endif



            #ifdef get_UnicodeDefault
            #pragma push_macro("get_UnicodeDefault")
            #undef get_UnicodeDefault
            #define XINTEROP_get_UnicodeDefault
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XPdfFontOptions> get_UnicodeDefault();

            #ifdef XINTEROP_get_UnicodeDefault
            #pragma pop_macro("get_UnicodeDefault")
            #endif



            #ifdef ToXPdfFontOptions
            #pragma push_macro("ToXPdfFontOptions")
            #undef ToXPdfFontOptions
            #define XINTEROP_ToXPdfFontOptions
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XPdfFontOptions> ToXPdfFontOptions(class System::Object * value);

            #ifdef XINTEROP_ToXPdfFontOptions
            #pragma pop_macro("ToXPdfFontOptions")
            #endif



        };
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class XBitmapDecoder for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        class XBitmapDecoder : public System::Object
        {

        public:

            PDFSHARPGDIBRIDGE_API virtual ~XBitmapDecoder();

            #ifdef GetPngDecoder
            #pragma push_macro("GetPngDecoder")
            #undef GetPngDecoder
            #define XINTEROP_GetPngDecoder
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XBitmapDecoder> GetPngDecoder();

            #ifdef XINTEROP_GetPngDecoder
            #pragma pop_macro("GetPngDecoder")
            #endif



            #ifdef ToXBitmapDecoder
            #pragma push_macro("ToXBitmapDecoder")
            #undef ToXBitmapDecoder
            #define XINTEROP_ToXBitmapDecoder
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XBitmapDecoder> ToXBitmapDecoder(class System::Object * value);

            #ifdef XINTEROP_ToXBitmapDecoder
            #pragma pop_macro("ToXBitmapDecoder")
            #endif



        };
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class XBitmapEncoder for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        class XBitmapEncoder : public System::Object
        {

        public:

            PDFSHARPGDIBRIDGE_API virtual ~XBitmapEncoder();

            #ifdef GetPngEncoder
            #pragma push_macro("GetPngEncoder")
            #undef GetPngEncoder
            #define XINTEROP_GetPngEncoder
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XBitmapEncoder> GetPngEncoder();

            #ifdef XINTEROP_GetPngEncoder
            #pragma pop_macro("GetPngEncoder")
            #endif



            #ifdef get_Source
            #pragma push_macro("get_Source")
            #undef get_Source
            #define XINTEROP_get_Source
            #endif

            PDFSHARPGDIBRIDGE_API std::shared_ptr<class PdfSharp::Drawing::XBitmapSource> get_Source();

            #ifdef XINTEROP_get_Source
            #pragma pop_macro("get_Source")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_Source, put = set_Source)) std::shared_ptr<class PdfSharp::Drawing::XBitmapSource> Source;



            #ifdef set_Source
            #pragma push_macro("set_Source")
            #undef set_Source
            #define XINTEROP_set_Source
            #endif

            PDFSHARPGDIBRIDGE_API void set_Source(class PdfSharp::Drawing::XBitmapSource * value);

            #ifdef XINTEROP_set_Source
            #pragma pop_macro("set_Source")
            #endif



            #ifdef Save
            #pragma push_macro("Save")
            #undef Save
            #define XINTEROP_Save
            #endif

            PDFSHARPGDIBRIDGE_API void Save(class System::IO::Stream * stream);

            #ifdef XINTEROP_Save
            #pragma pop_macro("Save")
            #endif



            #ifdef ToXBitmapEncoder
            #pragma push_macro("ToXBitmapEncoder")
            #undef ToXBitmapEncoder
            #define XINTEROP_ToXBitmapEncoder
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XBitmapEncoder> ToXBitmapEncoder(class System::Object * value);

            #ifdef XINTEROP_ToXBitmapEncoder
            #pragma pop_macro("ToXBitmapEncoder")
            #endif



        };
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class XImage for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        class XImage : public System::Object
        {

        public:

            PDFSHARPGDIBRIDGE_API virtual ~XImage();

            #ifdef FromGdiPlusImage
            #pragma push_macro("FromGdiPlusImage")
            #undef FromGdiPlusImage
            #define XINTEROP_FromGdiPlusImage
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XImage> FromGdiPlusImage(class System::Drawing::Image * image);

            #ifdef XINTEROP_FromGdiPlusImage
            #pragma pop_macro("FromGdiPlusImage")
            #endif



            #ifdef FromFile
            #pragma push_macro("FromFile")
            #undef FromFile
            #define XINTEROP_FromFile
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XImage> FromFile(const wchar_t * path);

            #ifdef XINTEROP_FromFile
            #pragma pop_macro("FromFile")
            #endif



            #ifdef FromStream
            #pragma push_macro("FromStream")
            #undef FromStream
            #define XINTEROP_FromStream
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XImage> FromStream(class System::IO::Stream * stream);

            #ifdef XINTEROP_FromStream
            #pragma pop_macro("FromStream")
            #endif



            #ifdef ExistsFile
            #pragma push_macro("ExistsFile")
            #undef ExistsFile
            #define XINTEROP_ExistsFile
            #endif

            PDFSHARPGDIBRIDGE_API static bool ExistsFile(const wchar_t * path);

            #ifdef XINTEROP_ExistsFile
            #pragma pop_macro("ExistsFile")
            #endif



            #ifdef Dispose
            #pragma push_macro("Dispose")
            #undef Dispose
            #define XINTEROP_Dispose
            #endif

            PDFSHARPGDIBRIDGE_API void Dispose();

            #ifdef XINTEROP_Dispose
            #pragma pop_macro("Dispose")
            #endif



            #ifdef get_PointWidth
            #pragma push_macro("get_PointWidth")
            #undef get_PointWidth
            #define XINTEROP_get_PointWidth
            #endif

            PDFSHARPGDIBRIDGE_API double get_PointWidth();

            #ifdef XINTEROP_get_PointWidth
            #pragma pop_macro("get_PointWidth")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_PointWidth)) double PointWidth;



            #ifdef get_PointHeight
            #pragma push_macro("get_PointHeight")
            #undef get_PointHeight
            #define XINTEROP_get_PointHeight
            #endif

            PDFSHARPGDIBRIDGE_API double get_PointHeight();

            #ifdef XINTEROP_get_PointHeight
            #pragma pop_macro("get_PointHeight")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_PointHeight)) double PointHeight;



            #ifdef get_PixelWidth
            #pragma push_macro("get_PixelWidth")
            #undef get_PixelWidth
            #define XINTEROP_get_PixelWidth
            #endif

            PDFSHARPGDIBRIDGE_API int get_PixelWidth();

            #ifdef XINTEROP_get_PixelWidth
            #pragma pop_macro("get_PixelWidth")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_PixelWidth)) int PixelWidth;



            #ifdef get_PixelHeight
            #pragma push_macro("get_PixelHeight")
            #undef get_PixelHeight
            #define XINTEROP_get_PixelHeight
            #endif

            PDFSHARPGDIBRIDGE_API int get_PixelHeight();

            #ifdef XINTEROP_get_PixelHeight
            #pragma pop_macro("get_PixelHeight")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_PixelHeight)) int PixelHeight;



            #ifdef get_Size
            #pragma push_macro("get_Size")
            #undef get_Size
            #define XINTEROP_get_Size
            #endif

            PDFSHARPGDIBRIDGE_API std::shared_ptr<class PdfSharp::Drawing::XSize> get_Size();

            #ifdef XINTEROP_get_Size
            #pragma pop_macro("get_Size")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_Size)) std::shared_ptr<class PdfSharp::Drawing::XSize> Size;



            #ifdef get_HorizontalResolution
            #pragma push_macro("get_HorizontalResolution")
            #undef get_HorizontalResolution
            #define XINTEROP_get_HorizontalResolution
            #endif

            PDFSHARPGDIBRIDGE_API double get_HorizontalResolution();

            #ifdef XINTEROP_get_HorizontalResolution
            #pragma pop_macro("get_HorizontalResolution")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_HorizontalResolution)) double HorizontalResolution;



            #ifdef get_VerticalResolution
            #pragma push_macro("get_VerticalResolution")
            #undef get_VerticalResolution
            #define XINTEROP_get_VerticalResolution
            #endif

            PDFSHARPGDIBRIDGE_API double get_VerticalResolution();

            #ifdef XINTEROP_get_VerticalResolution
            #pragma pop_macro("get_VerticalResolution")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_VerticalResolution)) double VerticalResolution;



            #ifdef get_Interpolate
            #pragma push_macro("get_Interpolate")
            #undef get_Interpolate
            #define XINTEROP_get_Interpolate
            #endif

            PDFSHARPGDIBRIDGE_API bool get_Interpolate();

            #ifdef XINTEROP_get_Interpolate
            #pragma pop_macro("get_Interpolate")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_Interpolate, put = set_Interpolate)) bool Interpolate;



            #ifdef set_Interpolate
            #pragma push_macro("set_Interpolate")
            #undef set_Interpolate
            #define XINTEROP_set_Interpolate
            #endif

            PDFSHARPGDIBRIDGE_API void set_Interpolate(bool value);

            #ifdef XINTEROP_set_Interpolate
            #pragma pop_macro("set_Interpolate")
            #endif



            #ifdef get_Format
            #pragma push_macro("get_Format")
            #undef get_Format
            #define XINTEROP_get_Format
            #endif

            PDFSHARPGDIBRIDGE_API std::shared_ptr<class PdfSharp::Drawing::XImageFormat> get_Format();

            #ifdef XINTEROP_get_Format
            #pragma pop_macro("get_Format")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_Format)) std::shared_ptr<class PdfSharp::Drawing::XImageFormat> Format;



            #ifdef ToXImage
            #pragma push_macro("ToXImage")
            #undef ToXImage
            #define XINTEROP_ToXImage
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XImage> ToXImage(class System::Object * value);

            #ifdef XINTEROP_ToXImage
            #pragma pop_macro("ToXImage")
            #endif



        };
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class XBitmapSource for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        class XBitmapSource : public PdfSharp::Drawing::XImage
        {

        public:

            PDFSHARPGDIBRIDGE_API virtual ~XBitmapSource();

            #ifdef ToXBitmapSource
            #pragma push_macro("ToXBitmapSource")
            #undef ToXBitmapSource
            #define XINTEROP_ToXBitmapSource
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XBitmapSource> ToXBitmapSource(class System::Object * value);

            #ifdef XINTEROP_ToXBitmapSource
            #pragma pop_macro("ToXBitmapSource")
            #endif



        };
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class XBitmapImage for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        class XBitmapImage : public PdfSharp::Drawing::XBitmapSource
        {

        public:

            PDFSHARPGDIBRIDGE_API virtual ~XBitmapImage();

            #ifdef CreateBitmap
            #pragma push_macro("CreateBitmap")
            #undef CreateBitmap
            #define XINTEROP_CreateBitmap
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XBitmapSource> CreateBitmap(int width, int height);

            #ifdef XINTEROP_CreateBitmap
            #pragma pop_macro("CreateBitmap")
            #endif



            #ifdef ToXBitmapImage
            #pragma push_macro("ToXBitmapImage")
            #undef ToXBitmapImage
            #define XINTEROP_ToXBitmapImage
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XBitmapImage> ToXBitmapImage(class System::Object * value);

            #ifdef XINTEROP_ToXBitmapImage
            #pragma pop_macro("ToXBitmapImage")
            #endif



        };
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class XForm for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        class XForm : public PdfSharp::Drawing::XImage
        {

        public:

            PDFSHARPGDIBRIDGE_API XForm(class PdfSharp::Drawing::XGraphics * gfx, class PdfSharp::Drawing::XSize * size);

            PDFSHARPGDIBRIDGE_API XForm(class PdfSharp::Drawing::XGraphics * gfx, class PdfSharp::Drawing::XUnit * width, class PdfSharp::Drawing::XUnit * height);

            PDFSHARPGDIBRIDGE_API XForm(class PdfSharp::Pdf::PdfDocument * document, class PdfSharp::Drawing::XRect * viewBox);

            PDFSHARPGDIBRIDGE_API XForm(class PdfSharp::Pdf::PdfDocument * document, class PdfSharp::Drawing::XSize * size);

            PDFSHARPGDIBRIDGE_API XForm(class PdfSharp::Pdf::PdfDocument * document, class PdfSharp::Drawing::XUnit * width, class PdfSharp::Drawing::XUnit * height);

            PDFSHARPGDIBRIDGE_API virtual ~XForm();

            #ifdef DrawingFinished
            #pragma push_macro("DrawingFinished")
            #undef DrawingFinished
            #define XINTEROP_DrawingFinished
            #endif

            PDFSHARPGDIBRIDGE_API void DrawingFinished();

            #ifdef XINTEROP_DrawingFinished
            #pragma pop_macro("DrawingFinished")
            #endif



            #ifdef get_ViewBox
            #pragma push_macro("get_ViewBox")
            #undef get_ViewBox
            #define XINTEROP_get_ViewBox
            #endif

            PDFSHARPGDIBRIDGE_API std::shared_ptr<class PdfSharp::Drawing::XRect> get_ViewBox();

            #ifdef XINTEROP_get_ViewBox
            #pragma pop_macro("get_ViewBox")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_ViewBox)) std::shared_ptr<class PdfSharp::Drawing::XRect> ViewBox;



            #ifdef get_BoundingBox
            #pragma push_macro("get_BoundingBox")
            #undef get_BoundingBox
            #define XINTEROP_get_BoundingBox
            #endif

            PDFSHARPGDIBRIDGE_API std::shared_ptr<class PdfSharp::Drawing::XRect> get_BoundingBox();

            #ifdef XINTEROP_get_BoundingBox
            #pragma pop_macro("get_BoundingBox")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_BoundingBox, put = set_BoundingBox)) std::shared_ptr<class PdfSharp::Drawing::XRect> BoundingBox;



            #ifdef set_BoundingBox
            #pragma push_macro("set_BoundingBox")
            #undef set_BoundingBox
            #define XINTEROP_set_BoundingBox
            #endif

            PDFSHARPGDIBRIDGE_API void set_BoundingBox(class PdfSharp::Drawing::XRect * value);

            #ifdef XINTEROP_set_BoundingBox
            #pragma pop_macro("set_BoundingBox")
            #endif



            #ifdef get_Transform
            #pragma push_macro("get_Transform")
            #undef get_Transform
            #define XINTEROP_get_Transform
            #endif

            PDFSHARPGDIBRIDGE_API std::shared_ptr<class PdfSharp::Drawing::XMatrix> get_Transform();

            #ifdef XINTEROP_get_Transform
            #pragma pop_macro("get_Transform")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_Transform, put = set_Transform)) std::shared_ptr<class PdfSharp::Drawing::XMatrix> Transform;



            #ifdef set_Transform
            #pragma push_macro("set_Transform")
            #undef set_Transform
            #define XINTEROP_set_Transform
            #endif

            PDFSHARPGDIBRIDGE_API void set_Transform(class PdfSharp::Drawing::XMatrix * value);

            #ifdef XINTEROP_set_Transform
            #pragma pop_macro("set_Transform")
            #endif



            #ifdef ToXForm
            #pragma push_macro("ToXForm")
            #undef ToXForm
            #define XINTEROP_ToXForm
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XForm> ToXForm(class System::Object * value);

            #ifdef XINTEROP_ToXForm
            #pragma pop_macro("ToXForm")
            #endif



        };
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class XPdfForm for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        class XPdfForm : public PdfSharp::Drawing::XForm
        {

        public:

            PDFSHARPGDIBRIDGE_API virtual ~XPdfForm();

            #ifdef FromFile
            #pragma push_macro("FromFile")
            #undef FromFile
            #define XINTEROP_FromFile
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XPdfForm> FromFile(const wchar_t * path);

            #ifdef XINTEROP_FromFile
            #pragma pop_macro("FromFile")
            #endif



            #ifdef FromStream
            #pragma push_macro("FromStream")
            #undef FromStream
            #define XINTEROP_FromStream
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XPdfForm> FromStream(class System::IO::Stream * stream);

            #ifdef XINTEROP_FromStream
            #pragma pop_macro("FromStream")
            #endif



            #ifdef get_PlaceHolder
            #pragma push_macro("get_PlaceHolder")
            #undef get_PlaceHolder
            #define XINTEROP_get_PlaceHolder
            #endif

            PDFSHARPGDIBRIDGE_API std::shared_ptr<class PdfSharp::Drawing::XImage> get_PlaceHolder();

            #ifdef XINTEROP_get_PlaceHolder
            #pragma pop_macro("get_PlaceHolder")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_PlaceHolder, put = set_PlaceHolder)) std::shared_ptr<class PdfSharp::Drawing::XImage> PlaceHolder;



            #ifdef set_PlaceHolder
            #pragma push_macro("set_PlaceHolder")
            #undef set_PlaceHolder
            #define XINTEROP_set_PlaceHolder
            #endif

            PDFSHARPGDIBRIDGE_API void set_PlaceHolder(class PdfSharp::Drawing::XImage * value);

            #ifdef XINTEROP_set_PlaceHolder
            #pragma pop_macro("set_PlaceHolder")
            #endif



            #ifdef get_Page
            #pragma push_macro("get_Page")
            #undef get_Page
            #define XINTEROP_get_Page
            #endif

            PDFSHARPGDIBRIDGE_API std::shared_ptr<class PdfSharp::Pdf::PdfPage> get_Page();

            #ifdef XINTEROP_get_Page
            #pragma pop_macro("get_Page")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_Page)) std::shared_ptr<class PdfSharp::Pdf::PdfPage> Page;



            #ifdef get_PageCount
            #pragma push_macro("get_PageCount")
            #undef get_PageCount
            #define XINTEROP_get_PageCount
            #endif

            PDFSHARPGDIBRIDGE_API int get_PageCount();

            #ifdef XINTEROP_get_PageCount
            #pragma pop_macro("get_PageCount")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_PageCount)) int PageCount;



            #ifdef get_PageNumber
            #pragma push_macro("get_PageNumber")
            #undef get_PageNumber
            #define XINTEROP_get_PageNumber
            #endif

            PDFSHARPGDIBRIDGE_API int get_PageNumber();

            #ifdef XINTEROP_get_PageNumber
            #pragma pop_macro("get_PageNumber")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_PageNumber, put = set_PageNumber)) int PageNumber;



            #ifdef set_PageNumber
            #pragma push_macro("set_PageNumber")
            #undef set_PageNumber
            #define XINTEROP_set_PageNumber
            #endif

            PDFSHARPGDIBRIDGE_API void set_PageNumber(int value);

            #ifdef XINTEROP_set_PageNumber
            #pragma pop_macro("set_PageNumber")
            #endif



            #ifdef get_PageIndex
            #pragma push_macro("get_PageIndex")
            #undef get_PageIndex
            #define XINTEROP_get_PageIndex
            #endif

            PDFSHARPGDIBRIDGE_API int get_PageIndex();

            #ifdef XINTEROP_get_PageIndex
            #pragma pop_macro("get_PageIndex")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_PageIndex, put = set_PageIndex)) int PageIndex;



            #ifdef set_PageIndex
            #pragma push_macro("set_PageIndex")
            #undef set_PageIndex
            #define XINTEROP_set_PageIndex
            #endif

            PDFSHARPGDIBRIDGE_API void set_PageIndex(int value);

            #ifdef XINTEROP_set_PageIndex
            #pragma pop_macro("set_PageIndex")
            #endif



            #ifdef ExtractPageNumber
            #pragma push_macro("ExtractPageNumber")
            #undef ExtractPageNumber
            #define XINTEROP_ExtractPageNumber
            #endif

            PDFSHARPGDIBRIDGE_API static std::wstring ExtractPageNumber(const wchar_t * path, int & pageNumber);

            #ifdef XINTEROP_ExtractPageNumber
            #pragma pop_macro("ExtractPageNumber")
            #endif



            #ifdef ToXPdfForm
            #pragma push_macro("ToXPdfForm")
            #undef ToXPdfForm
            #define XINTEROP_ToXPdfForm
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XPdfForm> ToXPdfForm(class System::Object * value);

            #ifdef XINTEROP_ToXPdfForm
            #pragma pop_macro("ToXPdfForm")
            #endif



        };
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class XBrush for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        class XBrush : public System::Object
        {

        public:

            PDFSHARPGDIBRIDGE_API virtual ~XBrush();

            #ifdef ToXBrush
            #pragma push_macro("ToXBrush")
            #undef ToXBrush
            #define XINTEROP_ToXBrush
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XBrush> ToXBrush(class System::Object * value);

            #ifdef XINTEROP_ToXBrush
            #pragma pop_macro("ToXBrush")
            #endif



        };
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class XLinearGradientBrush for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        class XLinearGradientBrush : public PdfSharp::Drawing::XBrush
        {

        public:

            PDFSHARPGDIBRIDGE_API XLinearGradientBrush(class System::Drawing::Point * point1, class System::Drawing::Point * point2, class PdfSharp::Drawing::XColor * color1, class PdfSharp::Drawing::XColor * color2);

            PDFSHARPGDIBRIDGE_API XLinearGradientBrush(class System::Drawing::PointF * point1, class System::Drawing::PointF * point2, class PdfSharp::Drawing::XColor * color1, class PdfSharp::Drawing::XColor * color2);

            PDFSHARPGDIBRIDGE_API XLinearGradientBrush(class PdfSharp::Drawing::XPoint * point1, class PdfSharp::Drawing::XPoint * point2, class PdfSharp::Drawing::XColor * color1, class PdfSharp::Drawing::XColor * color2);

            PDFSHARPGDIBRIDGE_API XLinearGradientBrush(class System::Drawing::Rectangle * rect, class PdfSharp::Drawing::XColor * color1, class PdfSharp::Drawing::XColor * color2, enum class PdfSharp::Drawing::XLinearGradientMode linearGradientMode);

            PDFSHARPGDIBRIDGE_API XLinearGradientBrush(class System::Drawing::RectangleF * rect, class PdfSharp::Drawing::XColor * color1, class PdfSharp::Drawing::XColor * color2, enum class PdfSharp::Drawing::XLinearGradientMode linearGradientMode);

            PDFSHARPGDIBRIDGE_API XLinearGradientBrush(class PdfSharp::Drawing::XRect * rect, class PdfSharp::Drawing::XColor * color1, class PdfSharp::Drawing::XColor * color2, enum class PdfSharp::Drawing::XLinearGradientMode linearGradientMode);

            PDFSHARPGDIBRIDGE_API virtual ~XLinearGradientBrush();

            #ifdef get_Transform
            #pragma push_macro("get_Transform")
            #undef get_Transform
            #define XINTEROP_get_Transform
            #endif

            PDFSHARPGDIBRIDGE_API std::shared_ptr<class PdfSharp::Drawing::XMatrix> get_Transform();

            #ifdef XINTEROP_get_Transform
            #pragma pop_macro("get_Transform")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_Transform, put = set_Transform)) std::shared_ptr<class PdfSharp::Drawing::XMatrix> Transform;



            #ifdef set_Transform
            #pragma push_macro("set_Transform")
            #undef set_Transform
            #define XINTEROP_set_Transform
            #endif

            PDFSHARPGDIBRIDGE_API void set_Transform(class PdfSharp::Drawing::XMatrix * value);

            #ifdef XINTEROP_set_Transform
            #pragma pop_macro("set_Transform")
            #endif



            #ifdef TranslateTransform
            #pragma push_macro("TranslateTransform")
            #undef TranslateTransform
            #define XINTEROP_TranslateTransform
            #endif

            PDFSHARPGDIBRIDGE_API void TranslateTransform(double dx, double dy);

            #ifdef XINTEROP_TranslateTransform
            #pragma pop_macro("TranslateTransform")
            #endif



            #ifdef TranslateTransform
            #pragma push_macro("TranslateTransform")
            #undef TranslateTransform
            #define XINTEROP_TranslateTransform
            #endif

            PDFSHARPGDIBRIDGE_API void TranslateTransform(double dx, double dy, enum class PdfSharp::Drawing::XMatrixOrder order);

            #ifdef XINTEROP_TranslateTransform
            #pragma pop_macro("TranslateTransform")
            #endif



            #ifdef ScaleTransform
            #pragma push_macro("ScaleTransform")
            #undef ScaleTransform
            #define XINTEROP_ScaleTransform
            #endif

            PDFSHARPGDIBRIDGE_API void ScaleTransform(double sx, double sy);

            #ifdef XINTEROP_ScaleTransform
            #pragma pop_macro("ScaleTransform")
            #endif



            #ifdef ScaleTransform
            #pragma push_macro("ScaleTransform")
            #undef ScaleTransform
            #define XINTEROP_ScaleTransform
            #endif

            PDFSHARPGDIBRIDGE_API void ScaleTransform(double sx, double sy, enum class PdfSharp::Drawing::XMatrixOrder order);

            #ifdef XINTEROP_ScaleTransform
            #pragma pop_macro("ScaleTransform")
            #endif



            #ifdef RotateTransform
            #pragma push_macro("RotateTransform")
            #undef RotateTransform
            #define XINTEROP_RotateTransform
            #endif

            PDFSHARPGDIBRIDGE_API void RotateTransform(double angle);

            #ifdef XINTEROP_RotateTransform
            #pragma pop_macro("RotateTransform")
            #endif



            #ifdef RotateTransform
            #pragma push_macro("RotateTransform")
            #undef RotateTransform
            #define XINTEROP_RotateTransform
            #endif

            PDFSHARPGDIBRIDGE_API void RotateTransform(double angle, enum class PdfSharp::Drawing::XMatrixOrder order);

            #ifdef XINTEROP_RotateTransform
            #pragma pop_macro("RotateTransform")
            #endif



            #ifdef MultiplyTransform
            #pragma push_macro("MultiplyTransform")
            #undef MultiplyTransform
            #define XINTEROP_MultiplyTransform
            #endif

            PDFSHARPGDIBRIDGE_API void MultiplyTransform(class PdfSharp::Drawing::XMatrix * matrix);

            #ifdef XINTEROP_MultiplyTransform
            #pragma pop_macro("MultiplyTransform")
            #endif



            #ifdef MultiplyTransform
            #pragma push_macro("MultiplyTransform")
            #undef MultiplyTransform
            #define XINTEROP_MultiplyTransform
            #endif

            PDFSHARPGDIBRIDGE_API void MultiplyTransform(class PdfSharp::Drawing::XMatrix * matrix, enum class PdfSharp::Drawing::XMatrixOrder order);

            #ifdef XINTEROP_MultiplyTransform
            #pragma pop_macro("MultiplyTransform")
            #endif



            #ifdef ResetTransform
            #pragma push_macro("ResetTransform")
            #undef ResetTransform
            #define XINTEROP_ResetTransform
            #endif

            PDFSHARPGDIBRIDGE_API void ResetTransform();

            #ifdef XINTEROP_ResetTransform
            #pragma pop_macro("ResetTransform")
            #endif



            #ifdef ToXLinearGradientBrush
            #pragma push_macro("ToXLinearGradientBrush")
            #undef ToXLinearGradientBrush
            #define XINTEROP_ToXLinearGradientBrush
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XLinearGradientBrush> ToXLinearGradientBrush(class System::Object * value);

            #ifdef XINTEROP_ToXLinearGradientBrush
            #pragma pop_macro("ToXLinearGradientBrush")
            #endif



        };
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class XSolidBrush for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        class XSolidBrush : public PdfSharp::Drawing::XBrush
        {

        public:

            PDFSHARPGDIBRIDGE_API XSolidBrush();

            PDFSHARPGDIBRIDGE_API XSolidBrush(class PdfSharp::Drawing::XColor * color);

            PDFSHARPGDIBRIDGE_API XSolidBrush(class PdfSharp::Drawing::XSolidBrush * brush);

            PDFSHARPGDIBRIDGE_API virtual ~XSolidBrush();

            #ifdef get_Color
            #pragma push_macro("get_Color")
            #undef get_Color
            #define XINTEROP_get_Color
            #endif

            PDFSHARPGDIBRIDGE_API std::shared_ptr<class PdfSharp::Drawing::XColor> get_Color();

            #ifdef XINTEROP_get_Color
            #pragma pop_macro("get_Color")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_Color, put = set_Color)) std::shared_ptr<class PdfSharp::Drawing::XColor> Color;



            #ifdef set_Color
            #pragma push_macro("set_Color")
            #undef set_Color
            #define XINTEROP_set_Color
            #endif

            PDFSHARPGDIBRIDGE_API void set_Color(class PdfSharp::Drawing::XColor * value);

            #ifdef XINTEROP_set_Color
            #pragma pop_macro("set_Color")
            #endif



            #ifdef get_Overprint
            #pragma push_macro("get_Overprint")
            #undef get_Overprint
            #define XINTEROP_get_Overprint
            #endif

            PDFSHARPGDIBRIDGE_API bool get_Overprint();

            #ifdef XINTEROP_get_Overprint
            #pragma pop_macro("get_Overprint")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_Overprint, put = set_Overprint)) bool Overprint;



            #ifdef set_Overprint
            #pragma push_macro("set_Overprint")
            #undef set_Overprint
            #define XINTEROP_set_Overprint
            #endif

            PDFSHARPGDIBRIDGE_API void set_Overprint(bool value);

            #ifdef XINTEROP_set_Overprint
            #pragma pop_macro("set_Overprint")
            #endif



            #ifdef ToXSolidBrush
            #pragma push_macro("ToXSolidBrush")
            #undef ToXSolidBrush
            #define XINTEROP_ToXSolidBrush
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> ToXSolidBrush(class System::Object * value);

            #ifdef XINTEROP_ToXSolidBrush
            #pragma pop_macro("ToXSolidBrush")
            #endif



        };
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class XBrushes for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        class XBrushes : public System::Object
        {

        public:

            #ifdef get_AliceBlue
            #pragma push_macro("get_AliceBlue")
            #undef get_AliceBlue
            #define XINTEROP_get_AliceBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_AliceBlue();

            #ifdef XINTEROP_get_AliceBlue
            #pragma pop_macro("get_AliceBlue")
            #endif



            #ifdef get_AntiqueWhite
            #pragma push_macro("get_AntiqueWhite")
            #undef get_AntiqueWhite
            #define XINTEROP_get_AntiqueWhite
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_AntiqueWhite();

            #ifdef XINTEROP_get_AntiqueWhite
            #pragma pop_macro("get_AntiqueWhite")
            #endif



            #ifdef get_Aqua
            #pragma push_macro("get_Aqua")
            #undef get_Aqua
            #define XINTEROP_get_Aqua
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Aqua();

            #ifdef XINTEROP_get_Aqua
            #pragma pop_macro("get_Aqua")
            #endif



            #ifdef get_Aquamarine
            #pragma push_macro("get_Aquamarine")
            #undef get_Aquamarine
            #define XINTEROP_get_Aquamarine
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Aquamarine();

            #ifdef XINTEROP_get_Aquamarine
            #pragma pop_macro("get_Aquamarine")
            #endif



            #ifdef get_Azure
            #pragma push_macro("get_Azure")
            #undef get_Azure
            #define XINTEROP_get_Azure
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Azure();

            #ifdef XINTEROP_get_Azure
            #pragma pop_macro("get_Azure")
            #endif



            #ifdef get_Beige
            #pragma push_macro("get_Beige")
            #undef get_Beige
            #define XINTEROP_get_Beige
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Beige();

            #ifdef XINTEROP_get_Beige
            #pragma pop_macro("get_Beige")
            #endif



            #ifdef get_Bisque
            #pragma push_macro("get_Bisque")
            #undef get_Bisque
            #define XINTEROP_get_Bisque
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Bisque();

            #ifdef XINTEROP_get_Bisque
            #pragma pop_macro("get_Bisque")
            #endif



            #ifdef get_Black
            #pragma push_macro("get_Black")
            #undef get_Black
            #define XINTEROP_get_Black
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Black();

            #ifdef XINTEROP_get_Black
            #pragma pop_macro("get_Black")
            #endif



            #ifdef get_BlanchedAlmond
            #pragma push_macro("get_BlanchedAlmond")
            #undef get_BlanchedAlmond
            #define XINTEROP_get_BlanchedAlmond
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_BlanchedAlmond();

            #ifdef XINTEROP_get_BlanchedAlmond
            #pragma pop_macro("get_BlanchedAlmond")
            #endif



            #ifdef get_Blue
            #pragma push_macro("get_Blue")
            #undef get_Blue
            #define XINTEROP_get_Blue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Blue();

            #ifdef XINTEROP_get_Blue
            #pragma pop_macro("get_Blue")
            #endif



            #ifdef get_BlueViolet
            #pragma push_macro("get_BlueViolet")
            #undef get_BlueViolet
            #define XINTEROP_get_BlueViolet
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_BlueViolet();

            #ifdef XINTEROP_get_BlueViolet
            #pragma pop_macro("get_BlueViolet")
            #endif



            #ifdef get_Brown
            #pragma push_macro("get_Brown")
            #undef get_Brown
            #define XINTEROP_get_Brown
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Brown();

            #ifdef XINTEROP_get_Brown
            #pragma pop_macro("get_Brown")
            #endif



            #ifdef get_BurlyWood
            #pragma push_macro("get_BurlyWood")
            #undef get_BurlyWood
            #define XINTEROP_get_BurlyWood
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_BurlyWood();

            #ifdef XINTEROP_get_BurlyWood
            #pragma pop_macro("get_BurlyWood")
            #endif



            #ifdef get_CadetBlue
            #pragma push_macro("get_CadetBlue")
            #undef get_CadetBlue
            #define XINTEROP_get_CadetBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_CadetBlue();

            #ifdef XINTEROP_get_CadetBlue
            #pragma pop_macro("get_CadetBlue")
            #endif



            #ifdef get_Chartreuse
            #pragma push_macro("get_Chartreuse")
            #undef get_Chartreuse
            #define XINTEROP_get_Chartreuse
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Chartreuse();

            #ifdef XINTEROP_get_Chartreuse
            #pragma pop_macro("get_Chartreuse")
            #endif



            #ifdef get_Chocolate
            #pragma push_macro("get_Chocolate")
            #undef get_Chocolate
            #define XINTEROP_get_Chocolate
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Chocolate();

            #ifdef XINTEROP_get_Chocolate
            #pragma pop_macro("get_Chocolate")
            #endif



            #ifdef get_Coral
            #pragma push_macro("get_Coral")
            #undef get_Coral
            #define XINTEROP_get_Coral
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Coral();

            #ifdef XINTEROP_get_Coral
            #pragma pop_macro("get_Coral")
            #endif



            #ifdef get_CornflowerBlue
            #pragma push_macro("get_CornflowerBlue")
            #undef get_CornflowerBlue
            #define XINTEROP_get_CornflowerBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_CornflowerBlue();

            #ifdef XINTEROP_get_CornflowerBlue
            #pragma pop_macro("get_CornflowerBlue")
            #endif



            #ifdef get_Cornsilk
            #pragma push_macro("get_Cornsilk")
            #undef get_Cornsilk
            #define XINTEROP_get_Cornsilk
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Cornsilk();

            #ifdef XINTEROP_get_Cornsilk
            #pragma pop_macro("get_Cornsilk")
            #endif



            #ifdef get_Crimson
            #pragma push_macro("get_Crimson")
            #undef get_Crimson
            #define XINTEROP_get_Crimson
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Crimson();

            #ifdef XINTEROP_get_Crimson
            #pragma pop_macro("get_Crimson")
            #endif



            #ifdef get_Cyan
            #pragma push_macro("get_Cyan")
            #undef get_Cyan
            #define XINTEROP_get_Cyan
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Cyan();

            #ifdef XINTEROP_get_Cyan
            #pragma pop_macro("get_Cyan")
            #endif



            #ifdef get_DarkBlue
            #pragma push_macro("get_DarkBlue")
            #undef get_DarkBlue
            #define XINTEROP_get_DarkBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkBlue();

            #ifdef XINTEROP_get_DarkBlue
            #pragma pop_macro("get_DarkBlue")
            #endif



            #ifdef get_DarkCyan
            #pragma push_macro("get_DarkCyan")
            #undef get_DarkCyan
            #define XINTEROP_get_DarkCyan
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkCyan();

            #ifdef XINTEROP_get_DarkCyan
            #pragma pop_macro("get_DarkCyan")
            #endif



            #ifdef get_DarkGoldenrod
            #pragma push_macro("get_DarkGoldenrod")
            #undef get_DarkGoldenrod
            #define XINTEROP_get_DarkGoldenrod
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkGoldenrod();

            #ifdef XINTEROP_get_DarkGoldenrod
            #pragma pop_macro("get_DarkGoldenrod")
            #endif



            #ifdef get_DarkGray
            #pragma push_macro("get_DarkGray")
            #undef get_DarkGray
            #define XINTEROP_get_DarkGray
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkGray();

            #ifdef XINTEROP_get_DarkGray
            #pragma pop_macro("get_DarkGray")
            #endif



            #ifdef get_DarkGreen
            #pragma push_macro("get_DarkGreen")
            #undef get_DarkGreen
            #define XINTEROP_get_DarkGreen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkGreen();

            #ifdef XINTEROP_get_DarkGreen
            #pragma pop_macro("get_DarkGreen")
            #endif



            #ifdef get_DarkKhaki
            #pragma push_macro("get_DarkKhaki")
            #undef get_DarkKhaki
            #define XINTEROP_get_DarkKhaki
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkKhaki();

            #ifdef XINTEROP_get_DarkKhaki
            #pragma pop_macro("get_DarkKhaki")
            #endif



            #ifdef get_DarkMagenta
            #pragma push_macro("get_DarkMagenta")
            #undef get_DarkMagenta
            #define XINTEROP_get_DarkMagenta
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkMagenta();

            #ifdef XINTEROP_get_DarkMagenta
            #pragma pop_macro("get_DarkMagenta")
            #endif



            #ifdef get_DarkOliveGreen
            #pragma push_macro("get_DarkOliveGreen")
            #undef get_DarkOliveGreen
            #define XINTEROP_get_DarkOliveGreen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkOliveGreen();

            #ifdef XINTEROP_get_DarkOliveGreen
            #pragma pop_macro("get_DarkOliveGreen")
            #endif



            #ifdef get_DarkOrange
            #pragma push_macro("get_DarkOrange")
            #undef get_DarkOrange
            #define XINTEROP_get_DarkOrange
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkOrange();

            #ifdef XINTEROP_get_DarkOrange
            #pragma pop_macro("get_DarkOrange")
            #endif



            #ifdef get_DarkOrchid
            #pragma push_macro("get_DarkOrchid")
            #undef get_DarkOrchid
            #define XINTEROP_get_DarkOrchid
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkOrchid();

            #ifdef XINTEROP_get_DarkOrchid
            #pragma pop_macro("get_DarkOrchid")
            #endif



            #ifdef get_DarkRed
            #pragma push_macro("get_DarkRed")
            #undef get_DarkRed
            #define XINTEROP_get_DarkRed
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkRed();

            #ifdef XINTEROP_get_DarkRed
            #pragma pop_macro("get_DarkRed")
            #endif



            #ifdef get_DarkSalmon
            #pragma push_macro("get_DarkSalmon")
            #undef get_DarkSalmon
            #define XINTEROP_get_DarkSalmon
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkSalmon();

            #ifdef XINTEROP_get_DarkSalmon
            #pragma pop_macro("get_DarkSalmon")
            #endif



            #ifdef get_DarkSeaGreen
            #pragma push_macro("get_DarkSeaGreen")
            #undef get_DarkSeaGreen
            #define XINTEROP_get_DarkSeaGreen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkSeaGreen();

            #ifdef XINTEROP_get_DarkSeaGreen
            #pragma pop_macro("get_DarkSeaGreen")
            #endif



            #ifdef get_DarkSlateBlue
            #pragma push_macro("get_DarkSlateBlue")
            #undef get_DarkSlateBlue
            #define XINTEROP_get_DarkSlateBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkSlateBlue();

            #ifdef XINTEROP_get_DarkSlateBlue
            #pragma pop_macro("get_DarkSlateBlue")
            #endif



            #ifdef get_DarkSlateGray
            #pragma push_macro("get_DarkSlateGray")
            #undef get_DarkSlateGray
            #define XINTEROP_get_DarkSlateGray
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkSlateGray();

            #ifdef XINTEROP_get_DarkSlateGray
            #pragma pop_macro("get_DarkSlateGray")
            #endif



            #ifdef get_DarkTurquoise
            #pragma push_macro("get_DarkTurquoise")
            #undef get_DarkTurquoise
            #define XINTEROP_get_DarkTurquoise
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkTurquoise();

            #ifdef XINTEROP_get_DarkTurquoise
            #pragma pop_macro("get_DarkTurquoise")
            #endif



            #ifdef get_DarkViolet
            #pragma push_macro("get_DarkViolet")
            #undef get_DarkViolet
            #define XINTEROP_get_DarkViolet
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DarkViolet();

            #ifdef XINTEROP_get_DarkViolet
            #pragma pop_macro("get_DarkViolet")
            #endif



            #ifdef get_DeepPink
            #pragma push_macro("get_DeepPink")
            #undef get_DeepPink
            #define XINTEROP_get_DeepPink
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DeepPink();

            #ifdef XINTEROP_get_DeepPink
            #pragma pop_macro("get_DeepPink")
            #endif



            #ifdef get_DeepSkyBlue
            #pragma push_macro("get_DeepSkyBlue")
            #undef get_DeepSkyBlue
            #define XINTEROP_get_DeepSkyBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DeepSkyBlue();

            #ifdef XINTEROP_get_DeepSkyBlue
            #pragma pop_macro("get_DeepSkyBlue")
            #endif



            #ifdef get_DimGray
            #pragma push_macro("get_DimGray")
            #undef get_DimGray
            #define XINTEROP_get_DimGray
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DimGray();

            #ifdef XINTEROP_get_DimGray
            #pragma pop_macro("get_DimGray")
            #endif



            #ifdef get_DodgerBlue
            #pragma push_macro("get_DodgerBlue")
            #undef get_DodgerBlue
            #define XINTEROP_get_DodgerBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_DodgerBlue();

            #ifdef XINTEROP_get_DodgerBlue
            #pragma pop_macro("get_DodgerBlue")
            #endif



            #ifdef get_Firebrick
            #pragma push_macro("get_Firebrick")
            #undef get_Firebrick
            #define XINTEROP_get_Firebrick
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Firebrick();

            #ifdef XINTEROP_get_Firebrick
            #pragma pop_macro("get_Firebrick")
            #endif



            #ifdef get_FloralWhite
            #pragma push_macro("get_FloralWhite")
            #undef get_FloralWhite
            #define XINTEROP_get_FloralWhite
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_FloralWhite();

            #ifdef XINTEROP_get_FloralWhite
            #pragma pop_macro("get_FloralWhite")
            #endif



            #ifdef get_ForestGreen
            #pragma push_macro("get_ForestGreen")
            #undef get_ForestGreen
            #define XINTEROP_get_ForestGreen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_ForestGreen();

            #ifdef XINTEROP_get_ForestGreen
            #pragma pop_macro("get_ForestGreen")
            #endif



            #ifdef get_Fuchsia
            #pragma push_macro("get_Fuchsia")
            #undef get_Fuchsia
            #define XINTEROP_get_Fuchsia
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Fuchsia();

            #ifdef XINTEROP_get_Fuchsia
            #pragma pop_macro("get_Fuchsia")
            #endif



            #ifdef get_Gainsboro
            #pragma push_macro("get_Gainsboro")
            #undef get_Gainsboro
            #define XINTEROP_get_Gainsboro
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Gainsboro();

            #ifdef XINTEROP_get_Gainsboro
            #pragma pop_macro("get_Gainsboro")
            #endif



            #ifdef get_GhostWhite
            #pragma push_macro("get_GhostWhite")
            #undef get_GhostWhite
            #define XINTEROP_get_GhostWhite
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_GhostWhite();

            #ifdef XINTEROP_get_GhostWhite
            #pragma pop_macro("get_GhostWhite")
            #endif



            #ifdef get_Gold
            #pragma push_macro("get_Gold")
            #undef get_Gold
            #define XINTEROP_get_Gold
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Gold();

            #ifdef XINTEROP_get_Gold
            #pragma pop_macro("get_Gold")
            #endif



            #ifdef get_Goldenrod
            #pragma push_macro("get_Goldenrod")
            #undef get_Goldenrod
            #define XINTEROP_get_Goldenrod
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Goldenrod();

            #ifdef XINTEROP_get_Goldenrod
            #pragma pop_macro("get_Goldenrod")
            #endif



            #ifdef get_Gray
            #pragma push_macro("get_Gray")
            #undef get_Gray
            #define XINTEROP_get_Gray
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Gray();

            #ifdef XINTEROP_get_Gray
            #pragma pop_macro("get_Gray")
            #endif



            #ifdef get_Green
            #pragma push_macro("get_Green")
            #undef get_Green
            #define XINTEROP_get_Green
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Green();

            #ifdef XINTEROP_get_Green
            #pragma pop_macro("get_Green")
            #endif



            #ifdef get_GreenYellow
            #pragma push_macro("get_GreenYellow")
            #undef get_GreenYellow
            #define XINTEROP_get_GreenYellow
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_GreenYellow();

            #ifdef XINTEROP_get_GreenYellow
            #pragma pop_macro("get_GreenYellow")
            #endif



            #ifdef get_Honeydew
            #pragma push_macro("get_Honeydew")
            #undef get_Honeydew
            #define XINTEROP_get_Honeydew
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Honeydew();

            #ifdef XINTEROP_get_Honeydew
            #pragma pop_macro("get_Honeydew")
            #endif



            #ifdef get_HotPink
            #pragma push_macro("get_HotPink")
            #undef get_HotPink
            #define XINTEROP_get_HotPink
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_HotPink();

            #ifdef XINTEROP_get_HotPink
            #pragma pop_macro("get_HotPink")
            #endif



            #ifdef get_IndianRed
            #pragma push_macro("get_IndianRed")
            #undef get_IndianRed
            #define XINTEROP_get_IndianRed
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_IndianRed();

            #ifdef XINTEROP_get_IndianRed
            #pragma pop_macro("get_IndianRed")
            #endif



            #ifdef get_Indigo
            #pragma push_macro("get_Indigo")
            #undef get_Indigo
            #define XINTEROP_get_Indigo
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Indigo();

            #ifdef XINTEROP_get_Indigo
            #pragma pop_macro("get_Indigo")
            #endif



            #ifdef get_Ivory
            #pragma push_macro("get_Ivory")
            #undef get_Ivory
            #define XINTEROP_get_Ivory
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Ivory();

            #ifdef XINTEROP_get_Ivory
            #pragma pop_macro("get_Ivory")
            #endif



            #ifdef get_Khaki
            #pragma push_macro("get_Khaki")
            #undef get_Khaki
            #define XINTEROP_get_Khaki
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Khaki();

            #ifdef XINTEROP_get_Khaki
            #pragma pop_macro("get_Khaki")
            #endif



            #ifdef get_Lavender
            #pragma push_macro("get_Lavender")
            #undef get_Lavender
            #define XINTEROP_get_Lavender
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Lavender();

            #ifdef XINTEROP_get_Lavender
            #pragma pop_macro("get_Lavender")
            #endif



            #ifdef get_LavenderBlush
            #pragma push_macro("get_LavenderBlush")
            #undef get_LavenderBlush
            #define XINTEROP_get_LavenderBlush
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LavenderBlush();

            #ifdef XINTEROP_get_LavenderBlush
            #pragma pop_macro("get_LavenderBlush")
            #endif



            #ifdef get_LawnGreen
            #pragma push_macro("get_LawnGreen")
            #undef get_LawnGreen
            #define XINTEROP_get_LawnGreen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LawnGreen();

            #ifdef XINTEROP_get_LawnGreen
            #pragma pop_macro("get_LawnGreen")
            #endif



            #ifdef get_LemonChiffon
            #pragma push_macro("get_LemonChiffon")
            #undef get_LemonChiffon
            #define XINTEROP_get_LemonChiffon
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LemonChiffon();

            #ifdef XINTEROP_get_LemonChiffon
            #pragma pop_macro("get_LemonChiffon")
            #endif



            #ifdef get_LightBlue
            #pragma push_macro("get_LightBlue")
            #undef get_LightBlue
            #define XINTEROP_get_LightBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LightBlue();

            #ifdef XINTEROP_get_LightBlue
            #pragma pop_macro("get_LightBlue")
            #endif



            #ifdef get_LightCoral
            #pragma push_macro("get_LightCoral")
            #undef get_LightCoral
            #define XINTEROP_get_LightCoral
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LightCoral();

            #ifdef XINTEROP_get_LightCoral
            #pragma pop_macro("get_LightCoral")
            #endif



            #ifdef get_LightCyan
            #pragma push_macro("get_LightCyan")
            #undef get_LightCyan
            #define XINTEROP_get_LightCyan
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LightCyan();

            #ifdef XINTEROP_get_LightCyan
            #pragma pop_macro("get_LightCyan")
            #endif



            #ifdef get_LightGoldenrodYellow
            #pragma push_macro("get_LightGoldenrodYellow")
            #undef get_LightGoldenrodYellow
            #define XINTEROP_get_LightGoldenrodYellow
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LightGoldenrodYellow();

            #ifdef XINTEROP_get_LightGoldenrodYellow
            #pragma pop_macro("get_LightGoldenrodYellow")
            #endif



            #ifdef get_LightGray
            #pragma push_macro("get_LightGray")
            #undef get_LightGray
            #define XINTEROP_get_LightGray
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LightGray();

            #ifdef XINTEROP_get_LightGray
            #pragma pop_macro("get_LightGray")
            #endif



            #ifdef get_LightGreen
            #pragma push_macro("get_LightGreen")
            #undef get_LightGreen
            #define XINTEROP_get_LightGreen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LightGreen();

            #ifdef XINTEROP_get_LightGreen
            #pragma pop_macro("get_LightGreen")
            #endif



            #ifdef get_LightPink
            #pragma push_macro("get_LightPink")
            #undef get_LightPink
            #define XINTEROP_get_LightPink
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LightPink();

            #ifdef XINTEROP_get_LightPink
            #pragma pop_macro("get_LightPink")
            #endif



            #ifdef get_LightSalmon
            #pragma push_macro("get_LightSalmon")
            #undef get_LightSalmon
            #define XINTEROP_get_LightSalmon
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LightSalmon();

            #ifdef XINTEROP_get_LightSalmon
            #pragma pop_macro("get_LightSalmon")
            #endif



            #ifdef get_LightSeaGreen
            #pragma push_macro("get_LightSeaGreen")
            #undef get_LightSeaGreen
            #define XINTEROP_get_LightSeaGreen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LightSeaGreen();

            #ifdef XINTEROP_get_LightSeaGreen
            #pragma pop_macro("get_LightSeaGreen")
            #endif



            #ifdef get_LightSkyBlue
            #pragma push_macro("get_LightSkyBlue")
            #undef get_LightSkyBlue
            #define XINTEROP_get_LightSkyBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LightSkyBlue();

            #ifdef XINTEROP_get_LightSkyBlue
            #pragma pop_macro("get_LightSkyBlue")
            #endif



            #ifdef get_LightSlateGray
            #pragma push_macro("get_LightSlateGray")
            #undef get_LightSlateGray
            #define XINTEROP_get_LightSlateGray
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LightSlateGray();

            #ifdef XINTEROP_get_LightSlateGray
            #pragma pop_macro("get_LightSlateGray")
            #endif



            #ifdef get_LightSteelBlue
            #pragma push_macro("get_LightSteelBlue")
            #undef get_LightSteelBlue
            #define XINTEROP_get_LightSteelBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LightSteelBlue();

            #ifdef XINTEROP_get_LightSteelBlue
            #pragma pop_macro("get_LightSteelBlue")
            #endif



            #ifdef get_LightYellow
            #pragma push_macro("get_LightYellow")
            #undef get_LightYellow
            #define XINTEROP_get_LightYellow
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LightYellow();

            #ifdef XINTEROP_get_LightYellow
            #pragma pop_macro("get_LightYellow")
            #endif



            #ifdef get_Lime
            #pragma push_macro("get_Lime")
            #undef get_Lime
            #define XINTEROP_get_Lime
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Lime();

            #ifdef XINTEROP_get_Lime
            #pragma pop_macro("get_Lime")
            #endif



            #ifdef get_LimeGreen
            #pragma push_macro("get_LimeGreen")
            #undef get_LimeGreen
            #define XINTEROP_get_LimeGreen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_LimeGreen();

            #ifdef XINTEROP_get_LimeGreen
            #pragma pop_macro("get_LimeGreen")
            #endif



            #ifdef get_Linen
            #pragma push_macro("get_Linen")
            #undef get_Linen
            #define XINTEROP_get_Linen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Linen();

            #ifdef XINTEROP_get_Linen
            #pragma pop_macro("get_Linen")
            #endif



            #ifdef get_Magenta
            #pragma push_macro("get_Magenta")
            #undef get_Magenta
            #define XINTEROP_get_Magenta
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Magenta();

            #ifdef XINTEROP_get_Magenta
            #pragma pop_macro("get_Magenta")
            #endif



            #ifdef get_Maroon
            #pragma push_macro("get_Maroon")
            #undef get_Maroon
            #define XINTEROP_get_Maroon
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Maroon();

            #ifdef XINTEROP_get_Maroon
            #pragma pop_macro("get_Maroon")
            #endif



            #ifdef get_MediumAquamarine
            #pragma push_macro("get_MediumAquamarine")
            #undef get_MediumAquamarine
            #define XINTEROP_get_MediumAquamarine
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_MediumAquamarine();

            #ifdef XINTEROP_get_MediumAquamarine
            #pragma pop_macro("get_MediumAquamarine")
            #endif



            #ifdef get_MediumBlue
            #pragma push_macro("get_MediumBlue")
            #undef get_MediumBlue
            #define XINTEROP_get_MediumBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_MediumBlue();

            #ifdef XINTEROP_get_MediumBlue
            #pragma pop_macro("get_MediumBlue")
            #endif



            #ifdef get_MediumOrchid
            #pragma push_macro("get_MediumOrchid")
            #undef get_MediumOrchid
            #define XINTEROP_get_MediumOrchid
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_MediumOrchid();

            #ifdef XINTEROP_get_MediumOrchid
            #pragma pop_macro("get_MediumOrchid")
            #endif



            #ifdef get_MediumPurple
            #pragma push_macro("get_MediumPurple")
            #undef get_MediumPurple
            #define XINTEROP_get_MediumPurple
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_MediumPurple();

            #ifdef XINTEROP_get_MediumPurple
            #pragma pop_macro("get_MediumPurple")
            #endif



            #ifdef get_MediumSeaGreen
            #pragma push_macro("get_MediumSeaGreen")
            #undef get_MediumSeaGreen
            #define XINTEROP_get_MediumSeaGreen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_MediumSeaGreen();

            #ifdef XINTEROP_get_MediumSeaGreen
            #pragma pop_macro("get_MediumSeaGreen")
            #endif



            #ifdef get_MediumSlateBlue
            #pragma push_macro("get_MediumSlateBlue")
            #undef get_MediumSlateBlue
            #define XINTEROP_get_MediumSlateBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_MediumSlateBlue();

            #ifdef XINTEROP_get_MediumSlateBlue
            #pragma pop_macro("get_MediumSlateBlue")
            #endif



            #ifdef get_MediumSpringGreen
            #pragma push_macro("get_MediumSpringGreen")
            #undef get_MediumSpringGreen
            #define XINTEROP_get_MediumSpringGreen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_MediumSpringGreen();

            #ifdef XINTEROP_get_MediumSpringGreen
            #pragma pop_macro("get_MediumSpringGreen")
            #endif



            #ifdef get_MediumTurquoise
            #pragma push_macro("get_MediumTurquoise")
            #undef get_MediumTurquoise
            #define XINTEROP_get_MediumTurquoise
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_MediumTurquoise();

            #ifdef XINTEROP_get_MediumTurquoise
            #pragma pop_macro("get_MediumTurquoise")
            #endif



            #ifdef get_MediumVioletRed
            #pragma push_macro("get_MediumVioletRed")
            #undef get_MediumVioletRed
            #define XINTEROP_get_MediumVioletRed
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_MediumVioletRed();

            #ifdef XINTEROP_get_MediumVioletRed
            #pragma pop_macro("get_MediumVioletRed")
            #endif



            #ifdef get_MidnightBlue
            #pragma push_macro("get_MidnightBlue")
            #undef get_MidnightBlue
            #define XINTEROP_get_MidnightBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_MidnightBlue();

            #ifdef XINTEROP_get_MidnightBlue
            #pragma pop_macro("get_MidnightBlue")
            #endif



            #ifdef get_MintCream
            #pragma push_macro("get_MintCream")
            #undef get_MintCream
            #define XINTEROP_get_MintCream
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_MintCream();

            #ifdef XINTEROP_get_MintCream
            #pragma pop_macro("get_MintCream")
            #endif



            #ifdef get_MistyRose
            #pragma push_macro("get_MistyRose")
            #undef get_MistyRose
            #define XINTEROP_get_MistyRose
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_MistyRose();

            #ifdef XINTEROP_get_MistyRose
            #pragma pop_macro("get_MistyRose")
            #endif



            #ifdef get_Moccasin
            #pragma push_macro("get_Moccasin")
            #undef get_Moccasin
            #define XINTEROP_get_Moccasin
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Moccasin();

            #ifdef XINTEROP_get_Moccasin
            #pragma pop_macro("get_Moccasin")
            #endif



            #ifdef get_NavajoWhite
            #pragma push_macro("get_NavajoWhite")
            #undef get_NavajoWhite
            #define XINTEROP_get_NavajoWhite
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_NavajoWhite();

            #ifdef XINTEROP_get_NavajoWhite
            #pragma pop_macro("get_NavajoWhite")
            #endif



            #ifdef get_Navy
            #pragma push_macro("get_Navy")
            #undef get_Navy
            #define XINTEROP_get_Navy
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Navy();

            #ifdef XINTEROP_get_Navy
            #pragma pop_macro("get_Navy")
            #endif



            #ifdef get_OldLace
            #pragma push_macro("get_OldLace")
            #undef get_OldLace
            #define XINTEROP_get_OldLace
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_OldLace();

            #ifdef XINTEROP_get_OldLace
            #pragma pop_macro("get_OldLace")
            #endif



            #ifdef get_Olive
            #pragma push_macro("get_Olive")
            #undef get_Olive
            #define XINTEROP_get_Olive
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Olive();

            #ifdef XINTEROP_get_Olive
            #pragma pop_macro("get_Olive")
            #endif



            #ifdef get_OliveDrab
            #pragma push_macro("get_OliveDrab")
            #undef get_OliveDrab
            #define XINTEROP_get_OliveDrab
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_OliveDrab();

            #ifdef XINTEROP_get_OliveDrab
            #pragma pop_macro("get_OliveDrab")
            #endif



            #ifdef get_Orange
            #pragma push_macro("get_Orange")
            #undef get_Orange
            #define XINTEROP_get_Orange
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Orange();

            #ifdef XINTEROP_get_Orange
            #pragma pop_macro("get_Orange")
            #endif



            #ifdef get_OrangeRed
            #pragma push_macro("get_OrangeRed")
            #undef get_OrangeRed
            #define XINTEROP_get_OrangeRed
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_OrangeRed();

            #ifdef XINTEROP_get_OrangeRed
            #pragma pop_macro("get_OrangeRed")
            #endif



            #ifdef get_Orchid
            #pragma push_macro("get_Orchid")
            #undef get_Orchid
            #define XINTEROP_get_Orchid
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Orchid();

            #ifdef XINTEROP_get_Orchid
            #pragma pop_macro("get_Orchid")
            #endif



            #ifdef get_PaleGoldenrod
            #pragma push_macro("get_PaleGoldenrod")
            #undef get_PaleGoldenrod
            #define XINTEROP_get_PaleGoldenrod
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_PaleGoldenrod();

            #ifdef XINTEROP_get_PaleGoldenrod
            #pragma pop_macro("get_PaleGoldenrod")
            #endif



            #ifdef get_PaleGreen
            #pragma push_macro("get_PaleGreen")
            #undef get_PaleGreen
            #define XINTEROP_get_PaleGreen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_PaleGreen();

            #ifdef XINTEROP_get_PaleGreen
            #pragma pop_macro("get_PaleGreen")
            #endif



            #ifdef get_PaleTurquoise
            #pragma push_macro("get_PaleTurquoise")
            #undef get_PaleTurquoise
            #define XINTEROP_get_PaleTurquoise
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_PaleTurquoise();

            #ifdef XINTEROP_get_PaleTurquoise
            #pragma pop_macro("get_PaleTurquoise")
            #endif



            #ifdef get_PaleVioletRed
            #pragma push_macro("get_PaleVioletRed")
            #undef get_PaleVioletRed
            #define XINTEROP_get_PaleVioletRed
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_PaleVioletRed();

            #ifdef XINTEROP_get_PaleVioletRed
            #pragma pop_macro("get_PaleVioletRed")
            #endif



            #ifdef get_PapayaWhip
            #pragma push_macro("get_PapayaWhip")
            #undef get_PapayaWhip
            #define XINTEROP_get_PapayaWhip
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_PapayaWhip();

            #ifdef XINTEROP_get_PapayaWhip
            #pragma pop_macro("get_PapayaWhip")
            #endif



            #ifdef get_PeachPuff
            #pragma push_macro("get_PeachPuff")
            #undef get_PeachPuff
            #define XINTEROP_get_PeachPuff
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_PeachPuff();

            #ifdef XINTEROP_get_PeachPuff
            #pragma pop_macro("get_PeachPuff")
            #endif



            #ifdef get_Peru
            #pragma push_macro("get_Peru")
            #undef get_Peru
            #define XINTEROP_get_Peru
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Peru();

            #ifdef XINTEROP_get_Peru
            #pragma pop_macro("get_Peru")
            #endif



            #ifdef get_Pink
            #pragma push_macro("get_Pink")
            #undef get_Pink
            #define XINTEROP_get_Pink
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Pink();

            #ifdef XINTEROP_get_Pink
            #pragma pop_macro("get_Pink")
            #endif



            #ifdef get_Plum
            #pragma push_macro("get_Plum")
            #undef get_Plum
            #define XINTEROP_get_Plum
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Plum();

            #ifdef XINTEROP_get_Plum
            #pragma pop_macro("get_Plum")
            #endif



            #ifdef get_PowderBlue
            #pragma push_macro("get_PowderBlue")
            #undef get_PowderBlue
            #define XINTEROP_get_PowderBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_PowderBlue();

            #ifdef XINTEROP_get_PowderBlue
            #pragma pop_macro("get_PowderBlue")
            #endif



            #ifdef get_Purple
            #pragma push_macro("get_Purple")
            #undef get_Purple
            #define XINTEROP_get_Purple
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Purple();

            #ifdef XINTEROP_get_Purple
            #pragma pop_macro("get_Purple")
            #endif



            #ifdef get_Red
            #pragma push_macro("get_Red")
            #undef get_Red
            #define XINTEROP_get_Red
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Red();

            #ifdef XINTEROP_get_Red
            #pragma pop_macro("get_Red")
            #endif



            #ifdef get_RosyBrown
            #pragma push_macro("get_RosyBrown")
            #undef get_RosyBrown
            #define XINTEROP_get_RosyBrown
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_RosyBrown();

            #ifdef XINTEROP_get_RosyBrown
            #pragma pop_macro("get_RosyBrown")
            #endif



            #ifdef get_RoyalBlue
            #pragma push_macro("get_RoyalBlue")
            #undef get_RoyalBlue
            #define XINTEROP_get_RoyalBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_RoyalBlue();

            #ifdef XINTEROP_get_RoyalBlue
            #pragma pop_macro("get_RoyalBlue")
            #endif



            #ifdef get_SaddleBrown
            #pragma push_macro("get_SaddleBrown")
            #undef get_SaddleBrown
            #define XINTEROP_get_SaddleBrown
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_SaddleBrown();

            #ifdef XINTEROP_get_SaddleBrown
            #pragma pop_macro("get_SaddleBrown")
            #endif



            #ifdef get_Salmon
            #pragma push_macro("get_Salmon")
            #undef get_Salmon
            #define XINTEROP_get_Salmon
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Salmon();

            #ifdef XINTEROP_get_Salmon
            #pragma pop_macro("get_Salmon")
            #endif



            #ifdef get_SandyBrown
            #pragma push_macro("get_SandyBrown")
            #undef get_SandyBrown
            #define XINTEROP_get_SandyBrown
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_SandyBrown();

            #ifdef XINTEROP_get_SandyBrown
            #pragma pop_macro("get_SandyBrown")
            #endif



            #ifdef get_SeaGreen
            #pragma push_macro("get_SeaGreen")
            #undef get_SeaGreen
            #define XINTEROP_get_SeaGreen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_SeaGreen();

            #ifdef XINTEROP_get_SeaGreen
            #pragma pop_macro("get_SeaGreen")
            #endif



            #ifdef get_SeaShell
            #pragma push_macro("get_SeaShell")
            #undef get_SeaShell
            #define XINTEROP_get_SeaShell
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_SeaShell();

            #ifdef XINTEROP_get_SeaShell
            #pragma pop_macro("get_SeaShell")
            #endif



            #ifdef get_Sienna
            #pragma push_macro("get_Sienna")
            #undef get_Sienna
            #define XINTEROP_get_Sienna
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Sienna();

            #ifdef XINTEROP_get_Sienna
            #pragma pop_macro("get_Sienna")
            #endif



            #ifdef get_Silver
            #pragma push_macro("get_Silver")
            #undef get_Silver
            #define XINTEROP_get_Silver
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Silver();

            #ifdef XINTEROP_get_Silver
            #pragma pop_macro("get_Silver")
            #endif



            #ifdef get_SkyBlue
            #pragma push_macro("get_SkyBlue")
            #undef get_SkyBlue
            #define XINTEROP_get_SkyBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_SkyBlue();

            #ifdef XINTEROP_get_SkyBlue
            #pragma pop_macro("get_SkyBlue")
            #endif



            #ifdef get_SlateBlue
            #pragma push_macro("get_SlateBlue")
            #undef get_SlateBlue
            #define XINTEROP_get_SlateBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_SlateBlue();

            #ifdef XINTEROP_get_SlateBlue
            #pragma pop_macro("get_SlateBlue")
            #endif



            #ifdef get_SlateGray
            #pragma push_macro("get_SlateGray")
            #undef get_SlateGray
            #define XINTEROP_get_SlateGray
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_SlateGray();

            #ifdef XINTEROP_get_SlateGray
            #pragma pop_macro("get_SlateGray")
            #endif



            #ifdef get_Snow
            #pragma push_macro("get_Snow")
            #undef get_Snow
            #define XINTEROP_get_Snow
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Snow();

            #ifdef XINTEROP_get_Snow
            #pragma pop_macro("get_Snow")
            #endif



            #ifdef get_SpringGreen
            #pragma push_macro("get_SpringGreen")
            #undef get_SpringGreen
            #define XINTEROP_get_SpringGreen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_SpringGreen();

            #ifdef XINTEROP_get_SpringGreen
            #pragma pop_macro("get_SpringGreen")
            #endif



            #ifdef get_SteelBlue
            #pragma push_macro("get_SteelBlue")
            #undef get_SteelBlue
            #define XINTEROP_get_SteelBlue
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_SteelBlue();

            #ifdef XINTEROP_get_SteelBlue
            #pragma pop_macro("get_SteelBlue")
            #endif



            #ifdef get_Tan
            #pragma push_macro("get_Tan")
            #undef get_Tan
            #define XINTEROP_get_Tan
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Tan();

            #ifdef XINTEROP_get_Tan
            #pragma pop_macro("get_Tan")
            #endif



            #ifdef get_Teal
            #pragma push_macro("get_Teal")
            #undef get_Teal
            #define XINTEROP_get_Teal
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Teal();

            #ifdef XINTEROP_get_Teal
            #pragma pop_macro("get_Teal")
            #endif



            #ifdef get_Thistle
            #pragma push_macro("get_Thistle")
            #undef get_Thistle
            #define XINTEROP_get_Thistle
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Thistle();

            #ifdef XINTEROP_get_Thistle
            #pragma pop_macro("get_Thistle")
            #endif



            #ifdef get_Tomato
            #pragma push_macro("get_Tomato")
            #undef get_Tomato
            #define XINTEROP_get_Tomato
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Tomato();

            #ifdef XINTEROP_get_Tomato
            #pragma pop_macro("get_Tomato")
            #endif



            #ifdef get_Transparent
            #pragma push_macro("get_Transparent")
            #undef get_Transparent
            #define XINTEROP_get_Transparent
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Transparent();

            #ifdef XINTEROP_get_Transparent
            #pragma pop_macro("get_Transparent")
            #endif



            #ifdef get_Turquoise
            #pragma push_macro("get_Turquoise")
            #undef get_Turquoise
            #define XINTEROP_get_Turquoise
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Turquoise();

            #ifdef XINTEROP_get_Turquoise
            #pragma pop_macro("get_Turquoise")
            #endif



            #ifdef get_Violet
            #pragma push_macro("get_Violet")
            #undef get_Violet
            #define XINTEROP_get_Violet
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Violet();

            #ifdef XINTEROP_get_Violet
            #pragma pop_macro("get_Violet")
            #endif



            #ifdef get_Wheat
            #pragma push_macro("get_Wheat")
            #undef get_Wheat
            #define XINTEROP_get_Wheat
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Wheat();

            #ifdef XINTEROP_get_Wheat
            #pragma pop_macro("get_Wheat")
            #endif



            #ifdef get_White
            #pragma push_macro("get_White")
            #undef get_White
            #define XINTEROP_get_White
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_White();

            #ifdef XINTEROP_get_White
            #pragma pop_macro("get_White")
            #endif



            #ifdef get_WhiteSmoke
            #pragma push_macro("get_WhiteSmoke")
            #undef get_WhiteSmoke
            #define XINTEROP_get_WhiteSmoke
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_WhiteSmoke();

            #ifdef XINTEROP_get_WhiteSmoke
            #pragma pop_macro("get_WhiteSmoke")
            #endif



            #ifdef get_Yellow
            #pragma push_macro("get_Yellow")
            #undef get_Yellow
            #define XINTEROP_get_Yellow
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_Yellow();

            #ifdef XINTEROP_get_Yellow
            #pragma pop_macro("get_Yellow")
            #endif



            #ifdef get_YellowGreen
            #pragma push_macro("get_YellowGreen")
            #undef get_YellowGreen
            #define XINTEROP_get_YellowGreen
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XSolidBrush> get_YellowGreen();

            #ifdef XINTEROP_get_YellowGreen
            #pragma pop_macro("get_YellowGreen")
            #endif



        };
    }
}


///////////////////////////////////////////////////////////////////////////////
// 
// C++ class XColor for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace PdfSharp
{
    namespace Drawing
    {
        class XColor : public System::Object
        {

        public:

            PDFSHARPGDIBRIDGE_API XColor();

            PDFSHARPGDIBRIDGE_API virtual ~XColor();

            #ifdef FromArgb
            #pragma push_macro("FromArgb")
            #undef FromArgb
            #define XINTEROP_FromArgb
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> FromArgb(int argb);

            #ifdef XINTEROP_FromArgb
            #pragma pop_macro("FromArgb")
            #endif



            #ifdef FromArgb
            #pragma push_macro("FromArgb")
            #undef FromArgb
            #define XINTEROP_FromArgb
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> FromArgb(unsigned int argb);

            #ifdef XINTEROP_FromArgb
            #pragma pop_macro("FromArgb")
            #endif



            #ifdef FromArgb
            #pragma push_macro("FromArgb")
            #undef FromArgb
            #define XINTEROP_FromArgb
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> FromArgb(int red, int green, int blue);

            #ifdef XINTEROP_FromArgb
            #pragma pop_macro("FromArgb")
            #endif



            #ifdef FromArgb
            #pragma push_macro("FromArgb")
            #undef FromArgb
            #define XINTEROP_FromArgb
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> FromArgb(int alpha, int red, int green, int blue);

            #ifdef XINTEROP_FromArgb
            #pragma pop_macro("FromArgb")
            #endif



            #ifdef FromArgb
            #pragma push_macro("FromArgb")
            #undef FromArgb
            #define XINTEROP_FromArgb
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> FromArgb(class System::Drawing::Color * color);

            #ifdef XINTEROP_FromArgb
            #pragma pop_macro("FromArgb")
            #endif



            #ifdef FromArgb
            #pragma push_macro("FromArgb")
            #undef FromArgb
            #define XINTEROP_FromArgb
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> FromArgb(int alpha, class PdfSharp::Drawing::XColor * color);

            #ifdef XINTEROP_FromArgb
            #pragma pop_macro("FromArgb")
            #endif



            #ifdef FromArgb
            #pragma push_macro("FromArgb")
            #undef FromArgb
            #define XINTEROP_FromArgb
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> FromArgb(int alpha, class System::Drawing::Color * color);

            #ifdef XINTEROP_FromArgb
            #pragma pop_macro("FromArgb")
            #endif



            #ifdef FromCmyk
            #pragma push_macro("FromCmyk")
            #undef FromCmyk
            #define XINTEROP_FromCmyk
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> FromCmyk(double cyan, double magenta, double yellow, double black);

            #ifdef XINTEROP_FromCmyk
            #pragma pop_macro("FromCmyk")
            #endif



            #ifdef FromCmyk
            #pragma push_macro("FromCmyk")
            #undef FromCmyk
            #define XINTEROP_FromCmyk
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> FromCmyk(double alpha, double cyan, double magenta, double yellow, double black);

            #ifdef XINTEROP_FromCmyk
            #pragma pop_macro("FromCmyk")
            #endif



            #ifdef FromGrayScale
            #pragma push_macro("FromGrayScale")
            #undef FromGrayScale
            #define XINTEROP_FromGrayScale
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> FromGrayScale(double grayScale);

            #ifdef XINTEROP_FromGrayScale
            #pragma pop_macro("FromGrayScale")
            #endif



            #ifdef FromKnownColor
            #pragma push_macro("FromKnownColor")
            #undef FromKnownColor
            #define XINTEROP_FromKnownColor
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> FromKnownColor(enum class PdfSharp::Drawing::XKnownColor color);

            #ifdef XINTEROP_FromKnownColor
            #pragma pop_macro("FromKnownColor")
            #endif



            #ifdef FromKnownColor
            #pragma push_macro("FromKnownColor")
            #undef FromKnownColor
            #define XINTEROP_FromKnownColor
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> FromKnownColor(enum class System::Drawing::KnownColor color);

            #ifdef XINTEROP_FromKnownColor
            #pragma pop_macro("FromKnownColor")
            #endif



            #ifdef FromName
            #pragma push_macro("FromName")
            #undef FromName
            #define XINTEROP_FromName
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> FromName(const wchar_t * name);

            #ifdef XINTEROP_FromName
            #pragma pop_macro("FromName")
            #endif



            #ifdef get_ColorSpace
            #pragma push_macro("get_ColorSpace")
            #undef get_ColorSpace
            #define XINTEROP_get_ColorSpace
            #endif

            PDFSHARPGDIBRIDGE_API enum class PdfSharp::Drawing::XColorSpace get_ColorSpace();

            #ifdef XINTEROP_get_ColorSpace
            #pragma pop_macro("get_ColorSpace")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_ColorSpace, put = set_ColorSpace)) enum class PdfSharp::Drawing::XColorSpace ColorSpace;



            #ifdef set_ColorSpace
            #pragma push_macro("set_ColorSpace")
            #undef set_ColorSpace
            #define XINTEROP_set_ColorSpace
            #endif

            PDFSHARPGDIBRIDGE_API void set_ColorSpace(enum class PdfSharp::Drawing::XColorSpace value);

            #ifdef XINTEROP_set_ColorSpace
            #pragma pop_macro("set_ColorSpace")
            #endif



            #ifdef get_IsEmpty
            #pragma push_macro("get_IsEmpty")
            #undef get_IsEmpty
            #define XINTEROP_get_IsEmpty
            #endif

            PDFSHARPGDIBRIDGE_API bool get_IsEmpty();

            #ifdef XINTEROP_get_IsEmpty
            #pragma pop_macro("get_IsEmpty")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_IsEmpty)) bool IsEmpty;



            #ifdef ToGdiColor
            #pragma push_macro("ToGdiColor")
            #undef ToGdiColor
            #define XINTEROP_ToGdiColor
            #endif

            PDFSHARPGDIBRIDGE_API std::shared_ptr<class System::Drawing::Color> ToGdiColor();

            #ifdef XINTEROP_ToGdiColor
            #pragma pop_macro("ToGdiColor")
            #endif



            #ifdef get_IsKnownColor
            #pragma push_macro("get_IsKnownColor")
            #undef get_IsKnownColor
            #define XINTEROP_get_IsKnownColor
            #endif

            PDFSHARPGDIBRIDGE_API bool get_IsKnownColor();

            #ifdef XINTEROP_get_IsKnownColor
            #pragma pop_macro("get_IsKnownColor")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_IsKnownColor)) bool IsKnownColor;



            #ifdef GetHue
            #pragma push_macro("GetHue")
            #undef GetHue
            #define XINTEROP_GetHue
            #endif

            PDFSHARPGDIBRIDGE_API double GetHue();

            #ifdef XINTEROP_GetHue
            #pragma pop_macro("GetHue")
            #endif



            #ifdef GetSaturation
            #pragma push_macro("GetSaturation")
            #undef GetSaturation
            #define XINTEROP_GetSaturation
            #endif

            PDFSHARPGDIBRIDGE_API double GetSaturation();

            #ifdef XINTEROP_GetSaturation
            #pragma pop_macro("GetSaturation")
            #endif



            #ifdef GetBrightness
            #pragma push_macro("GetBrightness")
            #undef GetBrightness
            #define XINTEROP_GetBrightness
            #endif

            PDFSHARPGDIBRIDGE_API double GetBrightness();

            #ifdef XINTEROP_GetBrightness
            #pragma pop_macro("GetBrightness")
            #endif



            #ifdef get_A
            #pragma push_macro("get_A")
            #undef get_A
            #define XINTEROP_get_A
            #endif

            PDFSHARPGDIBRIDGE_API double get_A();

            #ifdef XINTEROP_get_A
            #pragma pop_macro("get_A")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_A, put = set_A)) double A;



            #ifdef set_A
            #pragma push_macro("set_A")
            #undef set_A
            #define XINTEROP_set_A
            #endif

            PDFSHARPGDIBRIDGE_API void set_A(double value);

            #ifdef XINTEROP_set_A
            #pragma pop_macro("set_A")
            #endif



            #ifdef get_R
            #pragma push_macro("get_R")
            #undef get_R
            #define XINTEROP_get_R
            #endif

            PDFSHARPGDIBRIDGE_API unsigned char get_R();

            #ifdef XINTEROP_get_R
            #pragma pop_macro("get_R")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_R, put = set_R)) unsigned char R;



            #ifdef set_R
            #pragma push_macro("set_R")
            #undef set_R
            #define XINTEROP_set_R
            #endif

            PDFSHARPGDIBRIDGE_API void set_R(unsigned char value);

            #ifdef XINTEROP_set_R
            #pragma pop_macro("set_R")
            #endif



            #ifdef get_G
            #pragma push_macro("get_G")
            #undef get_G
            #define XINTEROP_get_G
            #endif

            PDFSHARPGDIBRIDGE_API unsigned char get_G();

            #ifdef XINTEROP_get_G
            #pragma pop_macro("get_G")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_G, put = set_G)) unsigned char G;



            #ifdef set_G
            #pragma push_macro("set_G")
            #undef set_G
            #define XINTEROP_set_G
            #endif

            PDFSHARPGDIBRIDGE_API void set_G(unsigned char value);

            #ifdef XINTEROP_set_G
            #pragma pop_macro("set_G")
            #endif



            #ifdef get_B
            #pragma push_macro("get_B")
            #undef get_B
            #define XINTEROP_get_B
            #endif

            PDFSHARPGDIBRIDGE_API unsigned char get_B();

            #ifdef XINTEROP_get_B
            #pragma pop_macro("get_B")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_B, put = set_B)) unsigned char B;



            #ifdef set_B
            #pragma push_macro("set_B")
            #undef set_B
            #define XINTEROP_set_B
            #endif

            PDFSHARPGDIBRIDGE_API void set_B(unsigned char value);

            #ifdef XINTEROP_set_B
            #pragma pop_macro("set_B")
            #endif



            #ifdef get_C
            #pragma push_macro("get_C")
            #undef get_C
            #define XINTEROP_get_C
            #endif

            PDFSHARPGDIBRIDGE_API double get_C();

            #ifdef XINTEROP_get_C
            #pragma pop_macro("get_C")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_C, put = set_C)) double C;



            #ifdef set_C
            #pragma push_macro("set_C")
            #undef set_C
            #define XINTEROP_set_C
            #endif

            PDFSHARPGDIBRIDGE_API void set_C(double value);

            #ifdef XINTEROP_set_C
            #pragma pop_macro("set_C")
            #endif



            #ifdef get_M
            #pragma push_macro("get_M")
            #undef get_M
            #define XINTEROP_get_M
            #endif

            PDFSHARPGDIBRIDGE_API double get_M();

            #ifdef XINTEROP_get_M
            #pragma pop_macro("get_M")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_M, put = set_M)) double M;



            #ifdef set_M
            #pragma push_macro("set_M")
            #undef set_M
            #define XINTEROP_set_M
            #endif

            PDFSHARPGDIBRIDGE_API void set_M(double value);

            #ifdef XINTEROP_set_M
            #pragma pop_macro("set_M")
            #endif



            #ifdef get_Y
            #pragma push_macro("get_Y")
            #undef get_Y
            #define XINTEROP_get_Y
            #endif

            PDFSHARPGDIBRIDGE_API double get_Y();

            #ifdef XINTEROP_get_Y
            #pragma pop_macro("get_Y")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_Y, put = set_Y)) double Y;



            #ifdef set_Y
            #pragma push_macro("set_Y")
            #undef set_Y
            #define XINTEROP_set_Y
            #endif

            PDFSHARPGDIBRIDGE_API void set_Y(double value);

            #ifdef XINTEROP_set_Y
            #pragma pop_macro("set_Y")
            #endif



            #ifdef get_K
            #pragma push_macro("get_K")
            #undef get_K
            #define XINTEROP_get_K
            #endif

            PDFSHARPGDIBRIDGE_API double get_K();

            #ifdef XINTEROP_get_K
            #pragma pop_macro("get_K")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_K, put = set_K)) double K;



            #ifdef set_K
            #pragma push_macro("set_K")
            #undef set_K
            #define XINTEROP_set_K
            #endif

            PDFSHARPGDIBRIDGE_API void set_K(double value);

            #ifdef XINTEROP_set_K
            #pragma pop_macro("set_K")
            #endif



            #ifdef get_GS
            #pragma push_macro("get_GS")
            #undef get_GS
            #define XINTEROP_get_GS
            #endif

            PDFSHARPGDIBRIDGE_API double get_GS();

            #ifdef XINTEROP_get_GS
            #pragma pop_macro("get_GS")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_GS, put = set_GS)) double GS;



            #ifdef set_GS
            #pragma push_macro("set_GS")
            #undef set_GS
            #define XINTEROP_set_GS
            #endif

            PDFSHARPGDIBRIDGE_API void set_GS(double value);

            #ifdef XINTEROP_set_GS
            #pragma pop_macro("set_GS")
            #endif



            #ifdef get_RgbCmykG
            #pragma push_macro("get_RgbCmykG")
            #undef get_RgbCmykG
            #define XINTEROP_get_RgbCmykG
            #endif

            PDFSHARPGDIBRIDGE_API std::wstring get_RgbCmykG();

            #ifdef XINTEROP_get_RgbCmykG
            #pragma pop_macro("get_RgbCmykG")
            #endif



            // Simulates .NET property.
            __declspec(property(get = get_RgbCmykG, put = set_RgbCmykG)) std::wstring RgbCmykG;



            #ifdef set_RgbCmykG
            #pragma push_macro("set_RgbCmykG")
            #undef set_RgbCmykG
            #define XINTEROP_set_RgbCmykG
            #endif

            PDFSHARPGDIBRIDGE_API void set_RgbCmykG(const wchar_t * value);

            #ifdef XINTEROP_set_RgbCmykG
            #pragma pop_macro("set_RgbCmykG")
            #endif



            #ifdef get_Empty
            #pragma push_macro("get_Empty")
            #undef get_Empty
            #define XINTEROP_get_Empty
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> get_Empty();

            #ifdef XINTEROP_get_Empty
            #pragma pop_macro("get_Empty")
            #endif



            #ifdef set_Empty
            #pragma push_macro("set_Empty")
            #undef set_Empty
            #define XINTEROP_set_Empty
            #endif

            PDFSHARPGDIBRIDGE_API static void set_Empty(class PdfSharp::Drawing::XColor * value);

            #ifdef XINTEROP_set_Empty
            #pragma pop_macro("set_Empty")
            #endif



            #ifdef ToXColor
            #pragma push_macro("ToXColor")
            #undef ToXColor
            #define XINTEROP_ToXColor
            #endif

            PDFSHARPGDIBRIDGE_API static std::shared_ptr<class PdfSharp::Drawing::XColor> ToXColor(class System::Object * value);

            #ifdef XINTEROP_ToXColor
            #pragma pop_macro("ToXColor")
            #endif



        };
    }
}

Okay, let’s continue the topic by creating a HelloWorld PDF sample application in the next article.

The post Using PdfSharp, a .NET Library for Processing PDF from Native C++ appeared first on xInterop C++ .NET Bridge.

Enhanced SEHException Handling

$
0
0

The problem with SEHException

There is indeed a problem with SEHException handling.

Let’s see the definition of SEHException from the official online document.

The SEHException class handles SEH errors that are thrown from unmanaged code, but that have not been mapped to another .NET Framework exception. The SEHException class also corresponds to the HRESULT E_FAIL (0x80004005).

The .NET Framework often encounters unmanaged SEH exceptions that are automatically mapped to managed equivalents. There are two common unmanaged SEH exceptions:

  • STATUS_NO_MEMORY exceptions are automatically mapped to the OutOfMemoryException class.
  • STATUS_ACCESS_VIOLATION exceptions are automatically mapped as follows:
    • If legacyNullReferencePolicy is applied, all access violations are mapped to the NullReferenceException class.
    • If the address at which the read/write was attempted is not in JIT-compiled code, the exception is mapped to theAccessViolationException class.
    • If the address at which the read/write was attempted is in JIT-compiled code, but it is not in the OS Null partition area, the exception is mapped to the AccessViolationException class.
    • If there is no legacyNullReferencePolicy, and the address at which the read/write was attempted is in JIT-compiled code and in the OS Null partition area, the exception is mapped to the NullReferenceException class.

Any SEH exception that is not automatically mapped to a specific exception is mapped to the SEHException class by default.

What is the problem? Well, the problem is .NET does not tell what it is if it is not mapped to .NET exception. When a SEHException occurs, the message of the exception always reads “External component has thrown an exception”. It is not really useful and can not be used to determine what really happened.

Enhanced SEHException Handling

xInterop C++ .NET Bridge introduces a feature of parsing the current execution exception and creating a new type of EnhancedSEHException which is derived from SEHException. When calling a underlying native C++ method, it is always wrapped inside a try catch block so that an enhanced SEHException will be thrown when a SEHException is caught. An instance of EnhancedSEHException contains the real message passed from the native C++ DLL and the type of the object thrown.

public virtual int Add(int a, int b)
{
    try
    {
        var ___localReturnValue___ = this.delegateOfICalculator_AddDelegate(this.___ptrObject___, a, b);
        GC.KeepAlive(this);
        return ___localReturnValue___;
    }
    catch(SEHException exception)
    {
        // throw an enhanced SEH exception which may contain the error message of orignal C++ exception.
        throw EnhancedSEHExceptionManager.Create(exception);
    }
}

If you open xInterop C++ .NET Bridge, you can find a demo project called Enhanced SEH Exception Handling as shown below.

Step 1:

image

Step 2: Choose the options to create Exception Handling Sample project.

image

Step 3: The C# .NET Exception Handling Sample Project has been created.

image

image

Testing

I am showing the complete testing application C# file below. You may want to take a look into the details yourself or trying the sample project using xInterop C++ .NET Bridge.

// ----------------------------------------------------------------------------
// <copyright file="Program.cs" company="xInterop Software, LLC">
// Copyright (c) xInterop Software, LLC. All rights reserved.
// http://www.xinterop.com
// </copyright>
//
// NOTICE:  All information contained herein is, and remains the property of 
// xInterop Software, LLC, if any. The intellectual and technical concepts 
// contained herein are proprietary to xInterop Software, LLC and may be 
// covered by U.S. and Foreign Patents, patents in process, and are protected 
// by trade secret or copyright law. Dissemination of this information or 
// reproduction of this material is strictly forbidden unless prior written 
// permission is obtained from xInterop Software, LLC.
//
// Under no circumstances, the source code of this file can be re-distributed 
// to any third parties.
// ----------------------------------------------------------------------------

namespace ExceptionHandlingSample
{
    using System;
    using System.Runtime.InteropServices;
    using xInterop.Win32.StdLib;    

    // This is the C# wrapper library for the native C++ ExceptionHandling.dll. It supports AnyCPU, x86 and x64.
    // When both of the x86 and x64 version of the same C++ DLLs are available when creating the C# wrapper, 
    // the generated C# wrapper library can support AnyCPU.
    //
    // Warning
    //
    // If your compiler complains that the following assembly is missing when you build the project.
    // you may want to check the referecens of this project and make sure the correct version of 
    // xInterop.Win32.ExceptionHandling is referenced. Referencing a version with higher version of .NET framework
    // causes compiler errors as well.
    using xInterop.Win32.ExceptionHandling;

    class Program
    {
        ////////////////////////////////////////////////////////////////////////////////////////////////////////            
        //
        // Warning
        //
        // Please read carefully before you build the solution.
        //        
        // If you have not rebuilt xInterop.Win32.ExceptionHandling, the C# wrapper assembly is pre-built on a developer 
        // machine at xInterop Software, LLC and its license has not been activated yet, it is a trial version, 
        // it can not run on your local machine without the source code of xInterop.Win32.ExceptionHandling to be re-
        // generated on your local machine. You are required to build the source code and place them under the 
        // following directory. Any C# wrapper generated by a trail/evaluation version can only run on the same
        // machine where the C# wrapper was generated by the trial/evaluation version.
        // 
        // C:\Users\Sean\xInterop C++ .NET Bridge\Samples\.NET to C++ Bridge\ExceptionHandling\xInterop.Win32.ExceptionHandling
        //
        // Please refer to the help document of xInterop C++ .NET Bridge for details.
        //
        // You are very welcome to conact us by writing email to support@xinterop.com.
        //
        // You may also contact us at http://www.xinterop.com/index.php/contact
        //
        ////////////////////////////////////////////////////////////////////////////////////////////////////////        

        static void Main(string[] args)
        {
            // Register user's custom exception handlers for standard c++ exception which is derived from std::exception.
            EnhancedSEHExceptionManager.RegisterCustomExceptionHandler("CustomCppExceptionHandler", new EnhancedSEHExceptionCustomHandler(CppExceptionCustomHandler), true);

            // Register user's custom exception handlers for  non standard C++ exception which is NOT derived from std::exception.
            EnhancedSEHExceptionManager.RegisterCustomExceptionHandler("CustomNonCppExceptionHandler", new EnhancedSEHExceptionCustomHandler(NonCppExceptionCustomHandler), false);

            // Test Custom standard C++ exception.
            TestException(ThrownObjectType.CustomStandardCppException);

            // Test standard C++ exception.
            TestException(ThrownObjectType.StandardCppException);            

            // Test non standard C++ exception.
            TestException(ThrownObjectType.CustomNonStandardCppException);

            // Test throwing ANSI string.
            TestException(ThrownObjectType.AnsiString);

            // Test throwing std::string.
            TestException(ThrownObjectType.StdString);

            // Test throwing UNICODE string.
            TestException(ThrownObjectType.UnicodeString);

            // Test throwing std::wstring.
            TestException(ThrownObjectType.StdWString);

            // Test throwing integer.
            TestException(ThrownObjectType.Integer);

            Console.WriteLine("Press any key to exit...");
            Console.Read();
        }

        static void TestException(ThrownObjectType thrownObjectType)
        {
            Console.WriteLine();

            try
            {
                switch (thrownObjectType)
                {
                    case ThrownObjectType.CustomNonStandardCppException:
                        Console.WriteLine("Raising a custom non-standard C++ exception which is NOT derived from std::exception...");
                        SEHExceptionTester.ThrowCustomNonStandardCppException();
                        break;

                    case ThrownObjectType.CustomStandardCppException:
                        Console.WriteLine("Raising a custom standard C++ exception derived from std::exception...");
                        SEHExceptionTester.ThrowCustomStandardCppException();
                        break;

                    case ThrownObjectType.StandardCppException:
                        Console.WriteLine("Raising a standard C++ exception(std::exception)...");
                        SEHExceptionTester.ThrowStandardCppException();
                        break;

                    case ThrownObjectType.AnsiString:
                        Console.WriteLine("Raising C++ exception by throwing an ANSI string...");
                        SEHExceptionTester.ThrowString();
                        break;

                    case ThrownObjectType.StdString:
                        Console.WriteLine("Raising C++ exception by throwing a std::string...");
                        SEHExceptionTester.ThrowStdString();
                        break;

                    case ThrownObjectType.UnicodeString:
                        Console.WriteLine("Raising C++ exception by throwing a UNICODE string...");
                        SEHExceptionTester.ThrowUnicodeString();
                        break;

                    case ThrownObjectType.StdWString:
                        Console.WriteLine("Raising C++ exception by throwing a std::wstring...");
                        SEHExceptionTester.ThrowStdWString();
                        break;

                    case ThrownObjectType.Integer:
                        Console.WriteLine("Raising C++ exception by throwing an integer...");
                        SEHExceptionTester.ThrowInteger();
                        break;
                }
            }
            catch(SEHException exception)
            {
                // The Message of the exception carries meaningfull information which is exactly retrieved from the object thrown from the native C++ DLL.
                // The original Message is "external component has thrown an exception".
                Console.WriteLine("Exception was caught and error message is : {0}", exception.Message);
                Console.WriteLine();
            }
        }

        private static bool CppExceptionCustomHandler(ExceptionObject exceptionObject, out string message, ref ThrownObjectType thrownObjectType, out object tag)
        {
            message = null;            
            tag = null;

            int index;
            if(exceptionObject != null && exceptionObject.IsTypeOf("CustomNonStandardCppException", out index))
            {
                IntPtr ptrExceptionObject = exceptionObject.GetExceptionObjectPointer(index);
                if(ptrExceptionObject != IntPtr.Zero)
                {
                    CustomNonStandardCppException customNonStandardCppException = new CustomNonStandardCppException(ptrExceptionObject, IntPtr.Zero, false, false);
                    message = customNonStandardCppException.GetErrorMessage();
                    thrownObjectType = ThrownObjectType.CustomNonStandardCppException;
                    tag = customNonStandardCppException;
                    return true;
                }
            }

            return false;
        }

        private static bool NonCppExceptionCustomHandler(ExceptionObject exceptionObject, out string message, ref ThrownObjectType thrownObjectType, out object tag)
        {
            message = null;            
            tag = null;

            return false;
        }
    }
}

Running the application.

image

The post Enhanced SEHException Handling appeared first on xInterop C++ .NET Bridge.

Using PdfSharp for Processing PDF from Native C++ : Hello World Sample

$
0
0

The whole package of PdfSharp comes with lots of sample applications, one of them is the obligatory hello world sample which shows how to create a PDF document with one page and the text “Hello, World!” written in its center.

You can see the resulting PDF as shown below.

image

The following is the original C# console application of Hello World. The C# source code was released under MIT and it was written by Thomas Hövel.

using System.Diagnostics;
using PdfSharp.Drawing;
using PdfSharp.Pdf;

namespace HelloWorld
{
    // This sample is the obligatory Hello World program.
    class Program
    {
        static void Main()
        {
            // Create a new PDF document.
            var document = new PdfDocument();
            document.Info.Title = "Created with PDFsharp";

            // Create an empty page in this document.
            var page = document.AddPage();

            // Get an XGraphics object for drawing on this page.
            var gfx = XGraphics.FromPdfPage(page);

            // Draw two lines with a red default pen.
            var width = page.Width;
            var height = page.Height;
            gfx.DrawLine(XPens.Red, 0, 0, width, height);
            gfx.DrawLine(XPens.Red, width, 0, 0, height);

            // Draw a circle with a red pen which is 1.5 point thick.
            var r = width / 5;
            gfx.DrawEllipse(new XPen(XColors.Red, 1.5), XBrushes.White, new XRect(width / 2 - r, height / 2 - r, 2 * r, 2 * r));

            // Create a font.
            var font = new XFont("Times New Roman", 20, XFontStyle.BoldItalic);

            // Draw the text.
            gfx.DrawString("Hello, PDFsharp!", font, XBrushes.Black,
                new XRect(0, 0, page.Width, page.Height), XStringFormats.Center);

            // Save the document...
            const string filename = "HelloWorld_tempfile.pdf";
            document.Save(filename);

            // ...and start a viewer.
            Process.Start(filename);
        }
    }
}

In the previous article, we talked about how to use xInterop C++ .NET Bridge with Native C++ to .NET Bridge to generate the native C++ bridge DLL for PDFsharp .NET library assembly. In this Hello World example, we will need to use the native C++ bridge DLL PdbSharpgidBridge.DLL.

The following is the complete source code of the example.

// ----------------------------------------------------------------------------
// <copyright file="TestApp.cpp" company="xInterop Software, LLC">
// Copyright (c) 2016 xInterop Software, LLC. All rights reserved.
// http://www.xinterop.com
// </copyright>
//
// NOTICE:  All information contained herein is, and remains the property of 
// xInterop Software, LLC, if any. The intellectual and technical concepts 
// contained herein are proprietary to xInterop Software, LLC and may be 
// covered by U.S. and Foreign Patents, patents in process, and are protected 
// by trade secret or copyright law. Dissemination of this information or 
// reproduction of this material is strictly forbidden unless prior written 
// permission is obtained from xInterop Software, LLC. 
//
// This copyright header must be kept intact without any change under any circumstances.
//
// The source code of this file can NOT be re-distributed to any third parties
// unless certain OEM license has been arranged and written permission has been
// authorized by xInterop Software, LLC.
//
// ----------------------------------------------------------------------------

#include "stdafx.h"
#include <Ole2.h>

#include "../Native/Include/PdfSharpgdiBridge.h"

#ifdef _WIN64
#pragma comment(lib, "../Native/Lib/x64/PdfSharpgdiBridge.lib")
#else
#pragma comment(lib, "../Native/Lib/win32/PdfSharpgdiBridge.lib")
#endif


using namespace xinterop;
using namespace System::Diagnostics;
using namespace PdfSharp::Pdf;
using namespace PdfSharp::Drawing;


int _tmain(int argc, _TCHAR* argv[])
{
    ///////////////////////////////////////////////////////////////////////////////////////////////
    //
    // Notes:
    //
    // This file was created when "Load .NET bridge assembly automatically" option was turned on.
    //
    // The C# bridge assembly shall be loaded and initialized automatically when any c++     
    // class of the C++ bridge DLL is accessed.
    //
    // The C# bridge assembly can also be loaded and initialized by calling xiInitializeBridgeAssembly.
    //
    ///////////////////////////////////////////////////////////////////////////////////////////////

    CoInitializeEx(0, COINIT_APARTMENTTHREADED);

    ///////////////////////////////////////////////////////////////////////////////////////////////
    // Add your code here.
    ///////////////////////////////////////////////////////////////////////////////////////////////

    // Create a new PdfDocument instance.
    PdfDocument document;

    document.Info->Title = _T("Created with PDFsharp");

    // Create an empty page in this document.
    auto page = document.AddPage();

    // Get an XGraphics object for drawing on this page.
    auto gfx = XGraphics::FromPdfPage(page.get());

    // Draw two lines with a red default pen.
    auto width = page->Width;
    auto height = page->Height;
    gfx->DrawLine(XPens::get_Red().get(), 0, 0, width->Value, height->Value);
    gfx->DrawLine(XPens::get_Red().get(), width->Value, 0, 0, height->Value);

    // Draw a circle with a red pen which is 1.5 point thick.
    auto r = width->Value / 5;
    XRect rectForCircle(width->Value / 2 - r, height->Value / 2 - r, 2 * r, 2 * r);
    XPen pen(XColors::get_Red().get(), 1.5);
    gfx->DrawEllipse(&pen, XBrushes::get_White().get(), &rectForCircle);

    // Create a font.
    XFont font(_T("Times New Roman"), 20, XFontStyle::BoldItalic);

    // Draw the text.
    XRect rectForText(0, 0, page->Width->Value, page->Height->Value);
    gfx->DrawString(_T("Hello, PDFsharp!"), &font, XBrushes::get_Black().get(), &rectForText, XStringFormats::get_Center().get());

    // Save the document...    
    auto filename = _T("HelloWorld_tempfile.pdf");
    document.Save(filename);

    // ...and start a viewer.
    Process::Start(filename);

    ///////////////////////////////////////////////////////////////////////////////////////////////
    // End of your code.
    ///////////////////////////////////////////////////////////////////////////////////////////////

    CoUninitialize();

    exit(0);

    return 0;
}

The C++ code is very similar to the C# counterpart since we can simulate the C# property in the C++ code. Let’s go over the important steps before we can start calling the functions.

1. Include the header file for the native C++ Bridge DLL.

image

2. Reference the native C++ Bridge lib files.

image

3. Define all the required namespace inclusion.

image

There are a few things worth mentioning in the C++ code.

1. Define an instance of the C++ bridge class on the stack.

image

In the preceding screen-shot, the variable of document is created on the stack. It is simple, you certainly can create a pointer of an instance of PdfDocument by calling “new” and then release it later on.

2. Using properties.

image

In the preceding screen-shot, both Info and Title are properties. We are using them just like using the properties in the C# code.

3. System.Diagnostics.Process class

We also created the native C++ bridge class for the .NET class of Process, the screen-shot below shows how to use them.

image

The post Using PdfSharp for Processing PDF from Native C++ : Hello World Sample appeared first on xInterop C++ .NET Bridge.

Using PdfSharp for Processing PDF from Native C++ : Watermark Sample

$
0
0

The whole package of PdfSharp comes with lots of sample applications, one of them is watermark sample which shows three variations how to add a watermark to an existing PDF file.

You can see the resulting PDF as shown below.

image

image

image

The following is the original C# console application of Watermark sample. The C# source code was released under MIT and it was written by Thomas Hövel.

using System;
using System.Diagnostics;
using System.IO;
using PdfSharp.Drawing;
using PdfSharp.Pdf.IO;

namespace Watermark
{
    /// This sample shows three variations how to add a watermark text to an existing PDF file.
    class Program
    {
        static void Main()
        {
            const string watermark = "PDFsharp";
            const int emSize = 150;

            // Get a fresh copy of the sample PDF file.
            const string filename = "Portable Document Format.pdf";
            var file = Path.Combine(Directory.GetCurrentDirectory(), filename);
            File.Copy(Path.Combine("../../../../assets/PDFs/", filename), file, true);

            // Remove ReadOnly attribute from the copy.
            File.SetAttributes(file, File.GetAttributes(file) &amp; ~FileAttributes.ReadOnly);

            // Create the font for drawing the watermark.
            var font = new XFont("Times New Roman", emSize, XFontStyle.BoldItalic);

            // Open an existing document for editing and loop through its pages.
            var document = PdfReader.Open(filename);

            // Set version to PDF 1.4 (Acrobat 5) because we use transparency.
            if (document.Version &lt; 14)
                document.Version = 14;

            for (var idx = 0; idx &lt; document.Pages.Count; idx++)
            {
                var page = document.Pages[idx];

                switch (idx % 3)
                {
                    case 0:
                        {
                            // Variation 1: Draw a watermark as a text string.

                            // Get an XGraphics object for drawing beneath the existing content.
                            var gfx = XGraphics.FromPdfPage(page, XGraphicsPdfPageOptions.Prepend);

                            // Get the size (in points) of the text.
                            var size = gfx.MeasureString(watermark, font);

                            // Define a rotation transformation at the center of the page.
                            gfx.TranslateTransform(page.Width / 2, page.Height / 2);
                            gfx.RotateTransform(-Math.Atan(page.Height / page.Width) * 180 / Math.PI);
                            gfx.TranslateTransform(-page.Width / 2, -page.Height / 2);

                            // Create a string format.
                            var format = new XStringFormat();
                            format.Alignment = XStringAlignment.Near;
                            format.LineAlignment = XLineAlignment.Near;

                            // Create a dimmed red brush.
                            XBrush brush = new XSolidBrush(XColor.FromArgb(128, 255, 0, 0));

                            // Draw the string.
                            gfx.DrawString(watermark, font, brush,
                                new XPoint((page.Width - size.Width) / 2, (page.Height - size.Height) / 2),
                                format);
                        }
                        break;

                    case 1:
                        {
                            // Variation 2: Draw a watermark as an outlined graphical path.
                            // NYI: Does not work in Core build.

                            // Get an XGraphics object for drawing beneath the existing content.
                            var gfx = XGraphics.FromPdfPage(page, XGraphicsPdfPageOptions.Prepend);

                            // Get the size (in points) of the text.
                            var size = gfx.MeasureString(watermark, font);

                            // Define a rotation transformation at the center of the page.
                            gfx.TranslateTransform(page.Width / 2, page.Height / 2);
                            gfx.RotateTransform(-Math.Atan(page.Height / page.Width) * 180 / Math.PI);
                            gfx.TranslateTransform(-page.Width / 2, -page.Height / 2);

                            // Create a graphical path.
                            var path = new XGraphicsPath();

                            // Create a string format.
                            var format = new XStringFormat();
                            format.Alignment = XStringAlignment.Near;
                            format.LineAlignment = XLineAlignment.Near;

                            // Add the text to the path.
                            // AddString is not implemented in PDFsharp Core.
                            path.AddString(watermark, font.FontFamily, XFontStyle.BoldItalic, 150,
                            new XPoint((page.Width - size.Width) / 2, (page.Height - size.Height) / 2),
                                format);

                            // Create a dimmed red pen.
                            var pen = new XPen(XColor.FromArgb(128, 255, 0, 0), 2);

                            // Stroke the outline of the path.
                            gfx.DrawPath(pen, path);
                        }
                        break;

                    case 2:
                        {
                            // Variation 3: Draw a watermark as a transparent graphical path above text.
                            // NYI: Does not work in Core build.

                            // Get an XGraphics object for drawing above the existing content.
                            var gfx = XGraphics.FromPdfPage(page, XGraphicsPdfPageOptions.Append);

                            // Get the size (in points) of the text.
                            var size = gfx.MeasureString(watermark, font);

                            // Define a rotation transformation at the center of the page.
                            gfx.TranslateTransform(page.Width / 2, page.Height / 2);
                            gfx.RotateTransform(-Math.Atan(page.Height / page.Width) * 180 / Math.PI);
                            gfx.TranslateTransform(-page.Width / 2, -page.Height / 2);

                            // Create a graphical path.
                            var path = new XGraphicsPath();

                            // Create a string format.
                            var format = new XStringFormat();
                            format.Alignment = XStringAlignment.Near;
                            format.LineAlignment = XLineAlignment.Near;

                            // Add the text to the path.
                            // AddString is not implemented in PDFsharp Core.
                            path.AddString(watermark, font.FontFamily, XFontStyle.BoldItalic, 150,
                                new XPoint((page.Width - size.Width) / 2, (page.Height - size.Height) / 2),
                                format);

                            // Create a dimmed red pen and brush.
                            var pen = new XPen(XColor.FromArgb(50, 75, 0, 130), 3);
                            XBrush brush = new XSolidBrush(XColor.FromArgb(50, 106, 90, 205));

                            // Stroke the outline of the path.
                            gfx.DrawPath(pen, brush, path);
                        }
                        break;
                }
            }
            // Save the document...
            document.Save(filename);
            // ...and start a viewer
            Process.Start(filename);
        }
    }
}

In the previous article, we talked about how to use xInterop C++ .NET Bridge with Native C++ to .NET Bridge to generate the native C++ bridge DLL for PDFsharp .NET library assembly. In this Watermark example, we will need to use the native C++ bridge DLL PdbSharpgidBridge.DLL.

The following is the complete source code of the example.

// ----------------------------------------------------------------------------
// <copyright file="TestApp.cpp" company="xInterop Software, LLC">
// Copyright (c) 2016 xInterop Software, LLC. All rights reserved.
// http://www.xinterop.com
// </copyright>
//
// NOTICE:  All information contained herein is, and remains the property of 
// xInterop Software, LLC, if any. The intellectual and technical concepts 
// contained herein are proprietary to xInterop Software, LLC and may be 
// covered by U.S. and Foreign Patents, patents in process, and are protected 
// by trade secret or copyright law. Dissemination of this information or 
// reproduction of this material is strictly forbidden unless prior written 
// permission is obtained from xInterop Software, LLC. 
//
// This copyright header must be kept intact without any change under any circumstances.
//
// The source code of this file can NOT be re-distributed to any third parties
// unless certain OEM license has been arranged and written permission has been
// authorized by xInterop Software, LLC.
//
// ----------------------------------------------------------------------------

#include "stdafx.h"
#include <Ole2.h>

#include "../Native/Include/PdfSharpgdiBridge.h"

#ifdef _WIN64
#pragma comment(lib, "../Native/Lib/x64/PdfSharpgdiBridge.lib")
#else
#pragma comment(lib, "../Native/Lib/win32/PdfSharpgdiBridge.lib")
#endif


using namespace::xinterop;
using namespace::System::IO;
using namespace::PdfSharp::Drawing;
using namespace::PdfSharp::Pdf;
using namespace::PdfSharp::Pdf::IO;
using namespace::System::Diagnostics;


int _tmain(int argc, _TCHAR* argv[])
{
    ///////////////////////////////////////////////////////////////////////////////////////////////
    //
    // Notes:
    //
    // This file was created when "Load .NET bridge assembly automatically" option was turned on.
    //
    // The C# bridge assembly shall be loaded and initialized automatically when any c++     
    // class of the C++ bridge DLL is accessed.
    //
    // The C# bridge assembly can also be loaded and initialized by calling xiInitializeBridgeAssembly.
    //
    ///////////////////////////////////////////////////////////////////////////////////////////////

    CoInitializeEx(0, COINIT_APARTMENTTHREADED);

    ///////////////////////////////////////////////////////////////////////////////////////////////
    // Add your code here.
    ///////////////////////////////////////////////////////////////////////////////////////////////


    const TCHAR* watermark = _T("xInterop");
    const int emSize = 150;

    // Get a fresh copy of the sample PDF file.
    const TCHAR* filename = _T("Portable Document Format.pdf");
    TCHAR currentDirectory[MAX_PATH];
    GetCurrentDirectory(sizeof(currentDirectory), currentDirectory);
    auto file = Path::Combine(currentDirectory, filename);
    File::Copy(Path::Combine(_T("..//..//assets//PDFs//"), filename).c_str(), file.c_str(), true);

    // Remove ReadOnly attribute from the copy.
    File::SetAttributes(file.c_str(), File::GetAttributes(file.c_str()) & ~FileAttributes::ReadOnly);

    // Create the font for drawing the watermark.
    XFont font(_T("Times New Roman"), emSize, XFontStyle::BoldItalic);

    // Open an existing document for editing and loop through its pages.
    auto document = PdfReader::Open(filename);

    // Set version to PDF 1.4 (Acrobat 5) because we use transparency.    
    if (document->Version < 14)
        document->Version = 14;

    auto pages = document->get_Pages();

    for (int idx = 0; idx < pages->Count; idx++)
    {
        auto page = (*pages)[idx];

        switch (idx % 3)
        {
        case 0:
        {
            // Variation 1: Draw a watermark as a text string.

            // Get an XGraphics object for drawing beneath the existing content.
            auto gfx = XGraphics::FromPdfPage(page.get(), XGraphicsPdfPageOptions::Prepend);

            // Get the size (in points) of the text.
            auto size = gfx->MeasureString(watermark, &font);

            // Define a rotation transformation at the center of the page.
            gfx->TranslateTransform(page->Width->Value / 2, page->Height->Value / 2);
            gfx->RotateTransform(-System::Math::Atan(page->Height->Value / page->Width->Value) * 180 / System::Math::XI_PI);
            gfx->TranslateTransform(-page->Width->Value / 2, -page->Height->Value / 2);

            // Create a string format.
            XStringFormat format;
            format.set_Alignment(XStringAlignment::Near);
            format.set_LineAlignment(XLineAlignment::Near);

            // Create a dimmed red brush.                
            XSolidBrush brush(XColor::FromArgb(128, 255, 0, 0).get());

            // Draw the string.
            XPoint point((page->Width->Value - size->Width) / 2, (page->Height->Value - size->Height) / 2);
            gfx->DrawString(watermark, &font, &brush, &point, &format);
        }
        break;

        case 1:
        {
            // Variation 2: Draw a watermark as an outlined graphical path.
            // NYI: Does not work in Core build.

            // Get an XGraphics object for drawing beneath the existing content.
            auto gfx = XGraphics::FromPdfPage(page.get(), XGraphicsPdfPageOptions::Prepend);

            // Get the size (in points) of the text.
            auto size = gfx->MeasureString(watermark, &font);

            // Define a rotation transformation at the center of the page.
            gfx->TranslateTransform(page->Width->Value / 2, page->Height->Value / 2);
            gfx->RotateTransform(-System::Math::Atan(page->Height->Value / page->Width->Value) * 180 / System::Math::XI_PI);
            gfx->TranslateTransform(-page->Width->Value / 2, -page->Height->Value / 2);

            // Create a graphical path.
            XGraphicsPath path;

            // Create a string format.
            XStringFormat format;
            format.set_Alignment(XStringAlignment::Near);
            format.set_LineAlignment(XLineAlignment::Near);

            // Add the text to the path.
            // AddString is not implemented in PDFsharp Core.
            XPoint point((page->Width->Value - size->Width) / 2, (page->Height->Value - size->Height) / 2);
            path.AddString(watermark, font.get_FontFamily().get(), XFontStyle::BoldItalic, 150, &point, &format);

            // Create a dimmed red pen.
            XPen pen(XColor::FromArgb(128, 255, 0, 0).get());

            // Stroke the outline of the path.
            gfx->DrawPath(&pen, &path);
        }
        break;

        case 2:
        {
            // Variation 3: Draw a watermark as a transparent graphical path above text.
            // NYI: Does not work in Core build.

            // Get an XGraphics object for drawing beneath the existing content.
            auto gfx = XGraphics::FromPdfPage(page.get(), XGraphicsPdfPageOptions::Prepend);

            // Get the size (in points) of the text.
            auto size = gfx->MeasureString(watermark, &font);

            // Define a rotation transformation at the center of the page.
            gfx->TranslateTransform(page->Width->Value / 2, page->Height->Value / 2);
            gfx->RotateTransform(-System::Math::Atan(page->Height->Value / page->Width->Value) * 180 / System::Math::XI_PI);
            gfx->TranslateTransform(-page->Width->Value / 2, -page->Height->Value / 2);

            // Create a graphical path.
            XGraphicsPath path;

            // Create a string format.
            XStringFormat format;
            format.set_Alignment(XStringAlignment::Near);
            format.set_LineAlignment(XLineAlignment::Near);

            // Add the text to the path.
            // AddString is not implemented in PDFsharp Core.
            XPoint point((page->Width->Value - size->Width) / 2, (page->Height->Value - size->Height) / 2);
            path.AddString(watermark, font.get_FontFamily().get(), XFontStyle::BoldItalic, 150, &point, &format);

            // Create a dimmed red pen and brush.
            XPen pen(XColor::FromArgb(50, 75, 0, 130).get(), 3);
            XSolidBrush brush(XColor::FromArgb(50, 106, 90, 205).get());

            // Stroke the outline of the path.
            gfx->DrawPath(&pen, &brush, &path);
        }
        break;
        }
    }

    // Save the document...
    document->Save(filename);

    // ...and start a viewer
    Process::Start(filename);

    ///////////////////////////////////////////////////////////////////////////////////////////////
    // End of your code.
    ///////////////////////////////////////////////////////////////////////////////////////////////

    CoUninitialize();

    exit(0);

    return 0;
}

The C++ code is very similar to the C# counterpart since we can simulate the C# property in the C++ code. The native C++ application creates exactly same PDF file as the one generated by the C# console sample application. Let’s go over the important steps before we can start calling the functions.

1. Include the header file for the native C++ Bridge DLL.

image

2. Reference the native C++ Bridge lib files.

image

3. Define all the required namespace inclusion.

image

See the difference between .NET namespace and Native C++ namespace

image

There are a few things worth mentioning in the C++ code.

1. Open an existing document.

image

2. Using properties.

image

In the preceding screen-shot, Version is a property. We are using them just like using the properties in the C# code.

3. System.Diagnostics.Process class

image

We also created the native C++ bridge class for the .NET class of Process, the screen-shot above shows how to use them.

The post Using PdfSharp for Processing PDF from Native C++ : Watermark Sample appeared first on xInterop C++ .NET Bridge.

Calling .NET from Native C++: How to receive C# event

$
0
0

There are a few other technologies we can use to call .NET from native C++ as shown in Introduction to Native C++ to .NET Bridge, such as C++/CLI, COM, Reverse P/Invoke, Unmanaged DllExport, but none of them are easy to implement receiving events from .NET as xInterop Native C++ to .NET Bridge is.

Let’s write a sample assembly to demonstrate how we can receive C# .NET events from .NET using native C/C++ code. The sample assembly is quite simple, it has only one class named SimpleWebClient which implements a method named DownloadStringAsync and an event named DownloadStringCompletedEventHandler, as you see, SimpleWebClient basically wraps method and even from the class of WebClient.

using System;
using System.Net;

namespace EventSample
{
    public class SimpleWebClient
    {
        private WebClient webClient;

        // Occurs when an asynchronous resource-download operation completes.
        public event DownloadStringCompletedEventHandler DownloadStringCompleted;

        public SimpleWebClient()
        {
            webClient = new WebClient();
            webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(DownloadStringCompletedNotified);
        }

        //
        // Summary:
        //     Downloads the resource specified as a System.Uri. This method does not block
        //     the calling thread.
        //
        // Parameters:
        //   address:
        //     A System.Uri containing the URI to download.
        //
        // Exceptions:
        //   T:System.ArgumentNullException:
        //     The address parameter is null.
        //
        //   T:System.Net.WebException:
        //     The URI formed by combining System.Net.WebClient.BaseAddress and address is invalid.-or-
        //     An error occurred while downloading the resource.
        public void DownloadStringAsync(Uri address)
        {
            webClient.DownloadStringAsync(address);
        }

        private void DownloadStringCompletedNotified(object sender, DownloadStringCompletedEventArgs e)
        {
            if (DownloadStringCompleted != null)
            {
                DownloadStringCompleted(sender, e);
            }
        }
    }
}

With Native C++ to .NET Bridge, we can easily create the native C++ bridge DLL and a testing application to test the resulting native DLL.

The following is the corresponding C++ native bridge class, EventSample::SimpleWebClient which bridges to the C# class, SimpleWebClient.

///////////////////////////////////////////////////////////////////////////////
// 
// C++ class SimpleWebClient for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace EventSample
{
	class SimpleWebClient : public System::Object
	{

	public:

		EVENTSAMPLEBRIDGE_API SimpleWebClient();

		EVENTSAMPLEBRIDGE_API virtual ~SimpleWebClient();

		#ifdef add_DownloadStringCompleted
		#pragma push_macro("add_DownloadStringCompleted")
		#undef add_DownloadStringCompleted
		#define XINTEROP_add_DownloadStringCompleted
		#endif

		EVENTSAMPLEBRIDGE_API void add_DownloadStringCompleted(class System::Net::DownloadStringCompletedEventHandler * value);

		#ifdef XINTEROP_add_DownloadStringCompleted
		#pragma pop_macro("add_DownloadStringCompleted")
		#endif



		#ifdef remove_DownloadStringCompleted
		#pragma push_macro("remove_DownloadStringCompleted")
		#undef remove_DownloadStringCompleted
		#define XINTEROP_remove_DownloadStringCompleted
		#endif

		EVENTSAMPLEBRIDGE_API void remove_DownloadStringCompleted(class System::Net::DownloadStringCompletedEventHandler * value);

		#ifdef XINTEROP_remove_DownloadStringCompleted
		#pragma pop_macro("remove_DownloadStringCompleted")
		#endif



		#ifdef DownloadStringAsync
		#pragma push_macro("DownloadStringAsync")
		#undef DownloadStringAsync
		#define XINTEROP_DownloadStringAsync
		#endif

		EVENTSAMPLEBRIDGE_API void DownloadStringAsync(class System::Uri * address);

		#ifdef XINTEROP_DownloadStringAsync
		#pragma pop_macro("DownloadStringAsync")
		#endif



		#ifdef ToSimpleWebClient
		#pragma push_macro("ToSimpleWebClient")
		#undef ToSimpleWebClient
		#define XINTEROP_ToSimpleWebClient
		#endif

		EVENTSAMPLEBRIDGE_API static std::shared_ptr<class EventSample::SimpleWebClient> ToSimpleWebClient(class System::Object * value);

		#ifdef XINTEROP_ToSimpleWebClient
		#pragma pop_macro("ToSimpleWebClient")
		#endif
	};
}

DownloadStringCompletedEventHandler

///////////////////////////////////////////////////////////////////////////////
// 
// The definition of the C++ bridge class of DownloadStringCompletedEventHandler for .NET delegate of System.Net.DownloadStringCompletedEventHandler
//
///////////////////////////////////////////////////////////////////////////////

namespace System
{
	namespace Net
	{


		///////////////////////////////////////////////////////////////////////////////
		// 
		// C++ callback interface IDownloadStringCompletedEventHandlerCallback for C# delegate DownloadStringCompletedEventHandler
		//
		///////////////////////////////////////////////////////////////////////////////

		class EVENTSAMPLEBRIDGE_API IDownloadStringCompletedEventHandlerCallback
		{

		public:

			virtual ~IDownloadStringCompletedEventHandlerCallback();

			virtual void OnCall(class System::Object * sender, class System::Net::DownloadStringCompletedEventArgs * e) = 0;

		};


		typedef void (*DownloadStringCompletedEventHandler__Callback)(class System::Object * sender, class System::Net::DownloadStringCompletedEventArgs * e);


		class DownloadStringCompletedEventHandler : public System::Object
		{

		public:

			EVENTSAMPLEBRIDGE_API DownloadStringCompletedEventHandler(std::function<void (class System::Object *, class System::Net::DownloadStringCompletedEventArgs *)> callback);

			EVENTSAMPLEBRIDGE_API virtual ~DownloadStringCompletedEventHandler();

		private:

			char reserved3[16];
			void* reserved4[2];

		};

	}
}

The following is the code demonstrating how we can receive the C# .NET event from native C++

// ----------------------------------------------------------------------------
// <copyright file="TestApp.cpp" company="xInterop Software, LLC">
// Copyright (c) 2016 xInterop Software, LLC. All rights reserved.
// http://www.xinterop.com
// </copyright>
//
// NOTICE:  All information contained herein is, and remains the property of 
// xInterop Software, LLC, if any. The intellectual and technical concepts 
// contained herein are proprietary to xInterop Software, LLC and may be 
// covered by U.S. and Foreign Patents, patents in process, and are protected 
// by trade secret or copyright law. Dissemination of this information or 
// reproduction of this material is strictly forbidden unless prior written 
// permission is obtained from xInterop Software, LLC. 
//
// This copyright header must be kept intact without any change under any circumstances.
//
// The source code of this file can NOT be re-distributed to any third parties
// unless certain OEM license has been arranged and written permission has been
// authorized by xInterop Software, LLC.
//
// ----------------------------------------------------------------------------

#include "stdafx.h"
#include <Ole2.h>
#include <functional>

#include "../Native/Include/EventSampleBridge.h"

#ifdef _WIN64
#pragma comment(lib, "../Native/Lib/x64/EventSampleBridge.lib")
#else
#pragma comment(lib, "../Native/Lib/win32/EventSampleBridge.lib")
#endif

using namespace::xinterop;

int _tmain(int argc, _TCHAR* argv[])
{	
	///////////////////////////////////////////////////////////////////////////////////////////////
	//
	// Notes:
	//
	// This file was created when "Load .NET bridge assembly automatically" option was turned on.
	//
	// The C# bridge assembly shall be loaded and initialized automatically when any c++ 	
	// class of the C++ bridge DLL is accessed.
	//
	// The C# bridge assembly can also be loaded and initialized by calling xiInitializeBridgeAssembly.
	//
	///////////////////////////////////////////////////////////////////////////////////////////////

	CoInitializeEx(0, COINIT_APARTMENTTHREADED);

	///////////////////////////////////////////////////////////////////////////////////////////////
	// Add your code here.
	///////////////////////////////////////////////////////////////////////////////////////////////

	System::Uri webUri(_T("http://www.xinterop.com"));

	bool completed = false;

        // using Lambda Expressions in C++ to create a function.
	auto callback([](class System::Object * sender, class System::Net::DownloadStringCompletedEventArgs * e)
	{
		auto result = e->get_Result();
		wprintf(L"1 %s\n", result.c_str());
	});

	System::Net::DownloadStringCompletedEventHandler downloadStringCompletedEventHandler(callback);	

	EventSample::SimpleWebClient webClient;
	webClient.add_DownloadStringCompleted(&downloadStringCompletedEventHandler);
	webClient.DownloadStringAsync(&webUri);

	while (!completed)
	{
		// A simple loop waiting for the DownloadStringAsync to complete.
		Sleep(100);
	}

	///////////////////////////////////////////////////////////////////////////////////////////////
	// End of your code.
	///////////////////////////////////////////////////////////////////////////////////////////////

	CoUninitialize();

	exit(0);

	return 0;
}

I am also posting the Uri bridge class if you are interested.

///////////////////////////////////////////////////////////////////////////////
// 
// C++ class Uri for C# class definition
//
///////////////////////////////////////////////////////////////////////////////

namespace System
{
	class Uri : public System::Object
	{

	public:

		EVENTSAMPLEBRIDGE_API Uri(const wchar_t * uriString);

		EVENTSAMPLEBRIDGE_API Uri(const wchar_t * uriString, System::UriKind uriKind);

		EVENTSAMPLEBRIDGE_API Uri(class System::Uri * baseUri, const wchar_t * relativeUri);

		EVENTSAMPLEBRIDGE_API Uri(class System::Uri * baseUri, class System::Uri * relativeUri);

		EVENTSAMPLEBRIDGE_API virtual ~Uri();

		#ifdef get_AbsolutePath
		#pragma push_macro("get_AbsolutePath")
		#undef get_AbsolutePath
		#define XINTEROP_get_AbsolutePath
		#endif

		EVENTSAMPLEBRIDGE_API std::wstring get_AbsolutePath();

		#ifdef XINTEROP_get_AbsolutePath
		#pragma pop_macro("get_AbsolutePath")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_AbsolutePath)) std::wstring AbsolutePath;



		#ifdef get_AbsoluteUri
		#pragma push_macro("get_AbsoluteUri")
		#undef get_AbsoluteUri
		#define XINTEROP_get_AbsoluteUri
		#endif

		EVENTSAMPLEBRIDGE_API std::wstring get_AbsoluteUri();

		#ifdef XINTEROP_get_AbsoluteUri
		#pragma pop_macro("get_AbsoluteUri")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_AbsoluteUri)) std::wstring AbsoluteUri;



		#ifdef get_LocalPath
		#pragma push_macro("get_LocalPath")
		#undef get_LocalPath
		#define XINTEROP_get_LocalPath
		#endif

		EVENTSAMPLEBRIDGE_API std::wstring get_LocalPath();

		#ifdef XINTEROP_get_LocalPath
		#pragma pop_macro("get_LocalPath")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_LocalPath)) std::wstring LocalPath;



		#ifdef get_Authority
		#pragma push_macro("get_Authority")
		#undef get_Authority
		#define XINTEROP_get_Authority
		#endif

		EVENTSAMPLEBRIDGE_API std::wstring get_Authority();

		#ifdef XINTEROP_get_Authority
		#pragma pop_macro("get_Authority")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_Authority)) std::wstring Authority;



		#ifdef get_HostNameType
		#pragma push_macro("get_HostNameType")
		#undef get_HostNameType
		#define XINTEROP_get_HostNameType
		#endif

		EVENTSAMPLEBRIDGE_API System::UriHostNameType get_HostNameType();

		#ifdef XINTEROP_get_HostNameType
		#pragma pop_macro("get_HostNameType")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_HostNameType)) System::UriHostNameType HostNameType;



		#ifdef get_IsDefaultPort
		#pragma push_macro("get_IsDefaultPort")
		#undef get_IsDefaultPort
		#define XINTEROP_get_IsDefaultPort
		#endif

		EVENTSAMPLEBRIDGE_API bool get_IsDefaultPort();

		#ifdef XINTEROP_get_IsDefaultPort
		#pragma pop_macro("get_IsDefaultPort")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_IsDefaultPort)) bool IsDefaultPort;



		#ifdef get_IsFile
		#pragma push_macro("get_IsFile")
		#undef get_IsFile
		#define XINTEROP_get_IsFile
		#endif

		EVENTSAMPLEBRIDGE_API bool get_IsFile();

		#ifdef XINTEROP_get_IsFile
		#pragma pop_macro("get_IsFile")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_IsFile)) bool IsFile;



		#ifdef get_IsLoopback
		#pragma push_macro("get_IsLoopback")
		#undef get_IsLoopback
		#define XINTEROP_get_IsLoopback
		#endif

		EVENTSAMPLEBRIDGE_API bool get_IsLoopback();

		#ifdef XINTEROP_get_IsLoopback
		#pragma pop_macro("get_IsLoopback")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_IsLoopback)) bool IsLoopback;



		#ifdef get_PathAndQuery
		#pragma push_macro("get_PathAndQuery")
		#undef get_PathAndQuery
		#define XINTEROP_get_PathAndQuery
		#endif

		EVENTSAMPLEBRIDGE_API std::wstring get_PathAndQuery();

		#ifdef XINTEROP_get_PathAndQuery
		#pragma pop_macro("get_PathAndQuery")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_PathAndQuery)) std::wstring PathAndQuery;



		#ifdef get_IsUnc
		#pragma push_macro("get_IsUnc")
		#undef get_IsUnc
		#define XINTEROP_get_IsUnc
		#endif

		EVENTSAMPLEBRIDGE_API bool get_IsUnc();

		#ifdef XINTEROP_get_IsUnc
		#pragma pop_macro("get_IsUnc")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_IsUnc)) bool IsUnc;



		#ifdef get_Host
		#pragma push_macro("get_Host")
		#undef get_Host
		#define XINTEROP_get_Host
		#endif

		EVENTSAMPLEBRIDGE_API std::wstring get_Host();

		#ifdef XINTEROP_get_Host
		#pragma pop_macro("get_Host")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_Host)) std::wstring Host;



		#ifdef get_Port
		#pragma push_macro("get_Port")
		#undef get_Port
		#define XINTEROP_get_Port
		#endif

		EVENTSAMPLEBRIDGE_API int get_Port();

		#ifdef XINTEROP_get_Port
		#pragma pop_macro("get_Port")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_Port)) int Port;



		#ifdef get_Query
		#pragma push_macro("get_Query")
		#undef get_Query
		#define XINTEROP_get_Query
		#endif

		EVENTSAMPLEBRIDGE_API std::wstring get_Query();

		#ifdef XINTEROP_get_Query
		#pragma pop_macro("get_Query")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_Query)) std::wstring Query;



		#ifdef get_Fragment
		#pragma push_macro("get_Fragment")
		#undef get_Fragment
		#define XINTEROP_get_Fragment
		#endif

		EVENTSAMPLEBRIDGE_API std::wstring get_Fragment();

		#ifdef XINTEROP_get_Fragment
		#pragma pop_macro("get_Fragment")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_Fragment)) std::wstring Fragment;



		#ifdef get_Scheme
		#pragma push_macro("get_Scheme")
		#undef get_Scheme
		#define XINTEROP_get_Scheme
		#endif

		EVENTSAMPLEBRIDGE_API std::wstring get_Scheme();

		#ifdef XINTEROP_get_Scheme
		#pragma pop_macro("get_Scheme")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_Scheme)) std::wstring Scheme;



		#ifdef get_OriginalString
		#pragma push_macro("get_OriginalString")
		#undef get_OriginalString
		#define XINTEROP_get_OriginalString
		#endif

		EVENTSAMPLEBRIDGE_API std::wstring get_OriginalString();

		#ifdef XINTEROP_get_OriginalString
		#pragma pop_macro("get_OriginalString")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_OriginalString)) std::wstring OriginalString;



		#ifdef get_DnsSafeHost
		#pragma push_macro("get_DnsSafeHost")
		#undef get_DnsSafeHost
		#define XINTEROP_get_DnsSafeHost
		#endif

		EVENTSAMPLEBRIDGE_API std::wstring get_DnsSafeHost();

		#ifdef XINTEROP_get_DnsSafeHost
		#pragma pop_macro("get_DnsSafeHost")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_DnsSafeHost)) std::wstring DnsSafeHost;



		#ifdef get_IsAbsoluteUri
		#pragma push_macro("get_IsAbsoluteUri")
		#undef get_IsAbsoluteUri
		#define XINTEROP_get_IsAbsoluteUri
		#endif

		EVENTSAMPLEBRIDGE_API bool get_IsAbsoluteUri();

		#ifdef XINTEROP_get_IsAbsoluteUri
		#pragma pop_macro("get_IsAbsoluteUri")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_IsAbsoluteUri)) bool IsAbsoluteUri;



		#ifdef get_UserEscaped
		#pragma push_macro("get_UserEscaped")
		#undef get_UserEscaped
		#define XINTEROP_get_UserEscaped
		#endif

		EVENTSAMPLEBRIDGE_API bool get_UserEscaped();

		#ifdef XINTEROP_get_UserEscaped
		#pragma pop_macro("get_UserEscaped")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_UserEscaped)) bool UserEscaped;



		#ifdef get_UserInfo
		#pragma push_macro("get_UserInfo")
		#undef get_UserInfo
		#define XINTEROP_get_UserInfo
		#endif

		EVENTSAMPLEBRIDGE_API std::wstring get_UserInfo();

		#ifdef XINTEROP_get_UserInfo
		#pragma pop_macro("get_UserInfo")
		#endif



		// Simulates .NET property.
		__declspec(property(get = get_UserInfo)) std::wstring UserInfo;



		#ifdef CheckHostName
		#pragma push_macro("CheckHostName")
		#undef CheckHostName
		#define XINTEROP_CheckHostName
		#endif

		EVENTSAMPLEBRIDGE_API static System::UriHostNameType CheckHostName(const wchar_t * name);

		#ifdef XINTEROP_CheckHostName
		#pragma pop_macro("CheckHostName")
		#endif



		#ifdef GetLeftPart
		#pragma push_macro("GetLeftPart")
		#undef GetLeftPart
		#define XINTEROP_GetLeftPart
		#endif

		EVENTSAMPLEBRIDGE_API std::wstring GetLeftPart(System::UriPartial part);

		#ifdef XINTEROP_GetLeftPart
		#pragma pop_macro("GetLeftPart")
		#endif



		#ifdef HexEscape
		#pragma push_macro("HexEscape")
		#undef HexEscape
		#define XINTEROP_HexEscape
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring HexEscape(wchar_t character);

		#ifdef XINTEROP_HexEscape
		#pragma pop_macro("HexEscape")
		#endif



		#ifdef HexUnescape
		#pragma push_macro("HexUnescape")
		#undef HexUnescape
		#define XINTEROP_HexUnescape
		#endif

		EVENTSAMPLEBRIDGE_API static wchar_t HexUnescape(const wchar_t * pattern, int & index);

		#ifdef XINTEROP_HexUnescape
		#pragma pop_macro("HexUnescape")
		#endif



		#ifdef IsHexEncoding
		#pragma push_macro("IsHexEncoding")
		#undef IsHexEncoding
		#define XINTEROP_IsHexEncoding
		#endif

		EVENTSAMPLEBRIDGE_API static bool IsHexEncoding(const wchar_t * pattern, int index);

		#ifdef XINTEROP_IsHexEncoding
		#pragma pop_macro("IsHexEncoding")
		#endif



		#ifdef CheckSchemeName
		#pragma push_macro("CheckSchemeName")
		#undef CheckSchemeName
		#define XINTEROP_CheckSchemeName
		#endif

		EVENTSAMPLEBRIDGE_API static bool CheckSchemeName(const wchar_t * schemeName);

		#ifdef XINTEROP_CheckSchemeName
		#pragma pop_macro("CheckSchemeName")
		#endif



		#ifdef IsHexDigit
		#pragma push_macro("IsHexDigit")
		#undef IsHexDigit
		#define XINTEROP_IsHexDigit
		#endif

		EVENTSAMPLEBRIDGE_API static bool IsHexDigit(wchar_t character);

		#ifdef XINTEROP_IsHexDigit
		#pragma pop_macro("IsHexDigit")
		#endif



		#ifdef FromHex
		#pragma push_macro("FromHex")
		#undef FromHex
		#define XINTEROP_FromHex
		#endif

		EVENTSAMPLEBRIDGE_API static int FromHex(wchar_t digit);

		#ifdef XINTEROP_FromHex
		#pragma pop_macro("FromHex")
		#endif



		#ifdef MakeRelativeUri
		#pragma push_macro("MakeRelativeUri")
		#undef MakeRelativeUri
		#define XINTEROP_MakeRelativeUri
		#endif

		EVENTSAMPLEBRIDGE_API std::shared_ptr<class System::Uri> MakeRelativeUri(class System::Uri * uri);

		#ifdef XINTEROP_MakeRelativeUri
		#pragma pop_macro("MakeRelativeUri")
		#endif



		#ifdef TryCreate
		#pragma push_macro("TryCreate")
		#undef TryCreate
		#define XINTEROP_TryCreate
		#endif

		EVENTSAMPLEBRIDGE_API static bool TryCreate(const wchar_t * uriString, System::UriKind uriKind, class System::Uri * result);

		#ifdef XINTEROP_TryCreate
		#pragma pop_macro("TryCreate")
		#endif



		#ifdef TryCreate
		#pragma push_macro("TryCreate")
		#undef TryCreate
		#define XINTEROP_TryCreate
		#endif

		EVENTSAMPLEBRIDGE_API static bool TryCreate(class System::Uri * baseUri, const wchar_t * relativeUri, class System::Uri * result);

		#ifdef XINTEROP_TryCreate
		#pragma pop_macro("TryCreate")
		#endif



		#ifdef TryCreate
		#pragma push_macro("TryCreate")
		#undef TryCreate
		#define XINTEROP_TryCreate
		#endif

		EVENTSAMPLEBRIDGE_API static bool TryCreate(class System::Uri * baseUri, class System::Uri * relativeUri, class System::Uri * result);

		#ifdef XINTEROP_TryCreate
		#pragma pop_macro("TryCreate")
		#endif



		#ifdef GetComponents
		#pragma push_macro("GetComponents")
		#undef GetComponents
		#define XINTEROP_GetComponents
		#endif

		EVENTSAMPLEBRIDGE_API std::wstring GetComponents(System::UriComponents components, System::UriFormat format);

		#ifdef XINTEROP_GetComponents
		#pragma pop_macro("GetComponents")
		#endif



		#ifdef Compare
		#pragma push_macro("Compare")
		#undef Compare
		#define XINTEROP_Compare
		#endif

		EVENTSAMPLEBRIDGE_API static int Compare(class System::Uri * uri1, class System::Uri * uri2, System::UriComponents partsToCompare, System::UriFormat compareFormat, System::StringComparison comparisonType);

		#ifdef XINTEROP_Compare
		#pragma pop_macro("Compare")
		#endif



		#ifdef IsWellFormedOriginalString
		#pragma push_macro("IsWellFormedOriginalString")
		#undef IsWellFormedOriginalString
		#define XINTEROP_IsWellFormedOriginalString
		#endif

		EVENTSAMPLEBRIDGE_API bool IsWellFormedOriginalString();

		#ifdef XINTEROP_IsWellFormedOriginalString
		#pragma pop_macro("IsWellFormedOriginalString")
		#endif



		#ifdef IsWellFormedUriString
		#pragma push_macro("IsWellFormedUriString")
		#undef IsWellFormedUriString
		#define XINTEROP_IsWellFormedUriString
		#endif

		EVENTSAMPLEBRIDGE_API static bool IsWellFormedUriString(const wchar_t * uriString, System::UriKind uriKind);

		#ifdef XINTEROP_IsWellFormedUriString
		#pragma pop_macro("IsWellFormedUriString")
		#endif



		#ifdef UnescapeDataString
		#pragma push_macro("UnescapeDataString")
		#undef UnescapeDataString
		#define XINTEROP_UnescapeDataString
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring UnescapeDataString(const wchar_t * stringToUnescape);

		#ifdef XINTEROP_UnescapeDataString
		#pragma pop_macro("UnescapeDataString")
		#endif



		#ifdef EscapeUriString
		#pragma push_macro("EscapeUriString")
		#undef EscapeUriString
		#define XINTEROP_EscapeUriString
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring EscapeUriString(const wchar_t * stringToEscape);

		#ifdef XINTEROP_EscapeUriString
		#pragma pop_macro("EscapeUriString")
		#endif



		#ifdef EscapeDataString
		#pragma push_macro("EscapeDataString")
		#undef EscapeDataString
		#define XINTEROP_EscapeDataString
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring EscapeDataString(const wchar_t * stringToEscape);

		#ifdef XINTEROP_EscapeDataString
		#pragma pop_macro("EscapeDataString")
		#endif



		#ifdef IsBaseOf
		#pragma push_macro("IsBaseOf")
		#undef IsBaseOf
		#define XINTEROP_IsBaseOf
		#endif

		EVENTSAMPLEBRIDGE_API bool IsBaseOf(class System::Uri * uri);

		#ifdef XINTEROP_IsBaseOf
		#pragma pop_macro("IsBaseOf")
		#endif



		#ifdef get_UriSchemeFile
		#pragma push_macro("get_UriSchemeFile")
		#undef get_UriSchemeFile
		#define XINTEROP_get_UriSchemeFile
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring get_UriSchemeFile();

		#ifdef XINTEROP_get_UriSchemeFile
		#pragma pop_macro("get_UriSchemeFile")
		#endif



		#ifdef get_UriSchemeFtp
		#pragma push_macro("get_UriSchemeFtp")
		#undef get_UriSchemeFtp
		#define XINTEROP_get_UriSchemeFtp
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring get_UriSchemeFtp();

		#ifdef XINTEROP_get_UriSchemeFtp
		#pragma pop_macro("get_UriSchemeFtp")
		#endif



		#ifdef get_UriSchemeGopher
		#pragma push_macro("get_UriSchemeGopher")
		#undef get_UriSchemeGopher
		#define XINTEROP_get_UriSchemeGopher
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring get_UriSchemeGopher();

		#ifdef XINTEROP_get_UriSchemeGopher
		#pragma pop_macro("get_UriSchemeGopher")
		#endif



		#ifdef get_UriSchemeHttp
		#pragma push_macro("get_UriSchemeHttp")
		#undef get_UriSchemeHttp
		#define XINTEROP_get_UriSchemeHttp
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring get_UriSchemeHttp();

		#ifdef XINTEROP_get_UriSchemeHttp
		#pragma pop_macro("get_UriSchemeHttp")
		#endif



		#ifdef get_UriSchemeHttps
		#pragma push_macro("get_UriSchemeHttps")
		#undef get_UriSchemeHttps
		#define XINTEROP_get_UriSchemeHttps
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring get_UriSchemeHttps();

		#ifdef XINTEROP_get_UriSchemeHttps
		#pragma pop_macro("get_UriSchemeHttps")
		#endif



		#ifdef get_UriSchemeMailto
		#pragma push_macro("get_UriSchemeMailto")
		#undef get_UriSchemeMailto
		#define XINTEROP_get_UriSchemeMailto
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring get_UriSchemeMailto();

		#ifdef XINTEROP_get_UriSchemeMailto
		#pragma pop_macro("get_UriSchemeMailto")
		#endif



		#ifdef get_UriSchemeNews
		#pragma push_macro("get_UriSchemeNews")
		#undef get_UriSchemeNews
		#define XINTEROP_get_UriSchemeNews
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring get_UriSchemeNews();

		#ifdef XINTEROP_get_UriSchemeNews
		#pragma pop_macro("get_UriSchemeNews")
		#endif



		#ifdef get_UriSchemeNntp
		#pragma push_macro("get_UriSchemeNntp")
		#undef get_UriSchemeNntp
		#define XINTEROP_get_UriSchemeNntp
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring get_UriSchemeNntp();

		#ifdef XINTEROP_get_UriSchemeNntp
		#pragma pop_macro("get_UriSchemeNntp")
		#endif



		#ifdef get_UriSchemeNetTcp
		#pragma push_macro("get_UriSchemeNetTcp")
		#undef get_UriSchemeNetTcp
		#define XINTEROP_get_UriSchemeNetTcp
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring get_UriSchemeNetTcp();

		#ifdef XINTEROP_get_UriSchemeNetTcp
		#pragma pop_macro("get_UriSchemeNetTcp")
		#endif



		#ifdef get_UriSchemeNetPipe
		#pragma push_macro("get_UriSchemeNetPipe")
		#undef get_UriSchemeNetPipe
		#define XINTEROP_get_UriSchemeNetPipe
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring get_UriSchemeNetPipe();

		#ifdef XINTEROP_get_UriSchemeNetPipe
		#pragma pop_macro("get_UriSchemeNetPipe")
		#endif



		#ifdef get_SchemeDelimiter
		#pragma push_macro("get_SchemeDelimiter")
		#undef get_SchemeDelimiter
		#define XINTEROP_get_SchemeDelimiter
		#endif

		EVENTSAMPLEBRIDGE_API static std::wstring get_SchemeDelimiter();

		#ifdef XINTEROP_get_SchemeDelimiter
		#pragma pop_macro("get_SchemeDelimiter")
		#endif



		#ifdef ToUri
		#pragma push_macro("ToUri")
		#undef ToUri
		#define XINTEROP_ToUri
		#endif

		EVENTSAMPLEBRIDGE_API static std::shared_ptr<class System::Uri> ToUri(class System::Object * value);

		#ifdef XINTEROP_ToUri
		#pragma pop_macro("ToUri")
		#endif

	};
}

 

The post Calling .NET from Native C++: How to receive C# event appeared first on xInterop C++ .NET Bridge.


Ultimate Guide to Call .NET Assembly from Native C/C++ Using Unmanaged Exports

$
0
0

I have been mentioning Unmanaged Exports in a few of my articles, which is a very basic technique allowing us to export managed methods from .NET world to native C and C++. The resulting assembly is a mixed mode DLL containing native-like export entry. You can use Unmanaged Exports Nuget Package to create such DLLs, As long as you can write the native C/C++ declaration of the functions correctly, you should be able to create export function with simple and primitive types. But I went further to write an article named Unmanaged Exports, An Ultimate Guide to Call .NET Assembly from Native C/C++ Using Unmanaged Exports, once you learn those advanced tips, you should be able to even export classes, structs.

The post Ultimate Guide to Call .NET Assembly from Native C/C++ Using Unmanaged Exports appeared first on xInterop C++ .NET Bridge.

xInterop C++ .NET Bridge 4.0 is available now

$
0
0

xInterop C++ .NET Bridge 4.0 is available now

We are pleased to announce the release of xInterop C++ .NET Bridge 4.0, a Code Generator for Creating Two-Ways Bridges between C++ Native World and .NET World. Visual Studio 2017 is now supported.

xInterop C++ .NET Bridge 4.0 is available to the public for evaluation to anyone who is interested in using xInterop C++ .NET Bridge to

  • Generating C# .NET Wrapper/Bridge for native C++ DLLs so that you can call native C++ DLL from .NET.
  • Generating C++ Native DLL Bridge for .NET assemblies so that you can call .NET assemblies from native C++.

You may want to download it from the link below and start evaluating it and experiencing how powerful xInterop C++ .NET Bridge is. Once you start using xInterop C++ .NET Bridge, you will find that it is so easy to bridge between the C++ native world to C# .NET managed world by using xInterop C++ .NET Bridge. You will be able to evaluate the software for free for 30 days.

 

To anyone who is interested in purchasing xInterop C++ .NET Bridge, the licensing model and pricing document is available to you upon request. If you have any questions regarding xInterop C++ .NET Bridge software, licensing or pricing, please feel free to contact us using the Contact Us Page.

The post xInterop C++ .NET Bridge 4.0 is available now appeared first on xInterop C++ .NET Bridge.

Status Change

$
0
0

I had been working on xInterop C++ .NET Bridge during my spare time for 6 years before I finally gave up a few months ago due to the lack of sales. I no longer offer trial any more, the download link has been removed.

I am currently looking for new job in Washington, DC area(remote is also fine), any job related to C/C++ and C# (Except web application) on Windows would fit me quite well. Please do not hesitate to reference/contact me if your company has any job available, in return, I will offer you a free copy of professional version of xInterop C++ .NET Bridge which contains both Native C++ to .NET Bridge and .NET to Native C++ Bridge.

The post Status Change appeared first on xInterop C++ .NET Bridge.

Viewing all 31 articles
Browse latest View live