public void Create() { CreateWriter(Class.FileName); WriteStart(Class.Namespace); var baseClass = string.Empty; if (!Class.IsStatic && Class.HasInstance && !Class.IsConst && !Class.IsDynamic) { baseClass = " : IDisposable"; } WriteLine(Class.Access + (Class.IsStatic ? " static" : string.Empty) + " partial class " + Class.ClassName + baseClass); WriteStartColon(); WriteDelegates(); WriteLine("[SuppressUnmanagedCodeSecurity]"); WriteLine("private static unsafe class NativeMethods"); WriteStartColon(); WriteX64(); WriteARM64(); WriteX86(); WriteEndColon(); var generator = new NativeInstanceGenerator(this); generator.Write(); WriteEndColon(); WriteEnd(); CloseWriter(); }
public void Create() { CreateWriter(Class.FileName); WriteStart(Class.Namespace); string baseClass = ""; if (!Class.IsStatic && Class.HasInstance && !Class.IsConst && !Class.IsDynamic) { baseClass = " : IDisposable"; } WriteLine(Class.Access + (Class.IsStatic ? " static" : "") + " partial class " + Class.Name + baseClass); WriteStartColon(); WriteDelegates(); WriteLine("private static class NativeMethods"); WriteStartColon(); WriteX64(); WriteX86(); WriteEndColon(); var generator = new NativeInstanceGenerator(this); generator.Write(); WriteEndColon(); WriteEnd(); CloseWriter(); }
public void Create() { CreateWriter(Class.FileName); WriteStart(Class.Namespace); string baseClass = ""; if (!Class.IsStatic && Class.HasInstance && !Class.IsConst && !Class.IsDynamic) baseClass = " : IDisposable"; WriteLine(Class.Access + (Class.IsStatic ? " static" : "") + " partial class " + Class.Name + baseClass); WriteStartColon(); WriteDelegates(); WriteLine("private static class NativeMethods"); WriteStartColon(); WriteX64(); WriteX86(); WriteEndColon(); var generator = new NativeInstanceGenerator(this); generator.Write(); WriteEndColon(); WriteEnd(); CloseWriter(); }