/[gr2lib]/trunk/gr2lib/core/coretypes/implementation/ExporterInfo.cs
ViewVC logotype

Contents of /trunk/gr2lib/core/coretypes/implementation/ExporterInfo.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 71 - (show annotations) (download)
Thu Jul 15 13:07:44 2010 UTC (11 years, 4 months ago) by william
File size: 2722 byte(s)
enable reading of ExporterInfo

1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using gr2lib.core.helpers;
5 using gr2lib.core.typedefs;
6
7 namespace gr2lib.core.coretypes.implementation
8 {
9 public interface IExporterInfo
10 {
11 string ExporterName { get; set; }
12 granny_int32 ExporterMajorRevision { get; set; }
13 granny_int32 ExporterMinorRevision { get; set; }
14 granny_int32 ExporterCustomization { get; set; }
15 granny_int32 ExporterBuildNumber { get; set; }
16 IntPtr ExtendedData { get; set; }
17 }
18 public class ExporterInfo : IExporterInfo
19 {
20 internal string exporterName;
21 internal int exporterMajorRevision;
22 internal int exporterMinorRevision;
23 internal int exporterCustomization;
24 internal int exporterBuildNumber;
25 internal IntPtr _ExtendedData;
26
27 public IntPtr NativePointer;
28
29 public ExporterInfo()
30 {
31 }
32 internal static ExporterInfo ReadFromMemory(IntPtr pointer)
33 {
34 if (pointer == IntPtr.Zero) return null;
35 native.ExporterInfo native = Helpers.ReadFromMemory<native.ExporterInfo>(pointer);
36 ExporterInfo managed = ReadFromNative(native);
37 managed.NativePointer = pointer;
38 return managed;
39 }
40
41 internal static ExporterInfo ReadFromNative(native.ExporterInfo native)
42 {
43 ExporterInfo managed = new ExporterInfo();
44 managed.exporterName = string.IsNullOrEmpty(native.ExporterName) ? "{null}" : native.ExporterName;
45 managed.exporterMajorRevision = native.ExporterMajorRevision;
46 managed.exporterMinorRevision = native.ExporterMinorRevision;
47 managed.exporterCustomization = native.ExporterCustomization;
48 managed.exporterBuildNumber = native.ExporterBuildNumber;
49 return managed;
50 }
51
52 #region IExporterInfo Members
53 public string ExporterName { get { return exporterName; } set { exporterName = value; } }
54 public granny_int32 ExporterMajorRevision { get { return exporterMajorRevision; } set { exporterMajorRevision = value; } }
55 public granny_int32 ExporterMinorRevision { get { return exporterMinorRevision; } set { exporterMinorRevision = value; } }
56 public granny_int32 ExporterCustomization { get { return exporterCustomization; } set { exporterCustomization = value; } }
57 public granny_int32 ExporterBuildNumber { get { return exporterBuildNumber; } set { exporterBuildNumber = value; } }
58 public IntPtr ExtendedData { get { return _ExtendedData; } set { _ExtendedData = value; } }
59 #endregion
60 }
61 }

  ViewVC Help
Powered by ViewVC 1.1.22