/[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 82 - (show annotations) (download)
Thu Jul 15 23:36:04 2010 UTC (10 years, 7 months ago) by william
File size: 2921 byte(s)
move ExtenededData to it's own interface and make the classes, that need it, implement it.

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

  ViewVC Help
Powered by ViewVC 1.1.22