/[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 185 - (show annotations) (download)
Fri Jul 23 23:55:52 2010 UTC (9 years, 3 months ago) by william
File size: 5276 byte(s)
continue to add xml documentation

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 using System.Diagnostics;
8 using gr2lib.core.exceptions;
9 using gr2lib.core.apiversion;
10 using gr2lib.core.ui.helpers;
11 using System.ComponentModel;
12 using gr2lib.core.ui.typeeditors;
13 using System.Drawing.Design;
14 namespace gr2lib.core.coretypes.implementation
15 {
16 /// <summary>
17 /// ExporterInfo class
18 /// </summary>
19 public class ExporterInfo : GrannyRigParentResource, IExporterInfo
20 {
21 private StringType exporterName;
22 //private int exporterMajorRevision;
23 //private int exporterMinorRevision;
24 //private int exporterCustomization;
25 //private int exporterBuildNumber;
26
27 /// <summary>
28 /// default constructor
29 /// </summary>
30 public ExporterInfo() : base("Exporter Info")
31 {
32 this.ExporterName = "";
33 this.Version = new versiontype("0.0.0.0");
34
35 this.ExporterMajorRevision = 0;
36 this.ExporterMinorRevision = 0;
37 this.ExporterCustomization = 0;
38 this.ExporterBuildNumber = 0;
39 //this.ExtendedData = IntPtr.Zero;
40 //this.NativePointer = IntPtr.Zero;
41 }
42 internal static ExporterInfo ReadFromMemory(IntPtr pointer)
43 {
44 try
45 {
46 if (pointer == IntPtr.Zero) return null;
47 native.ExporterInfo native = Helpers.ReadFromMemory<native.ExporterInfo>(pointer);
48 ExporterInfo managed = ReadFromNative(native);
49 managed.NativePointer = pointer;
50 return managed;
51 }
52 catch (Exception ex)
53 {
54 StackTrace st = new StackTrace(true);
55 #if ENABLE_EXCEPTION_OUTPUT_TO_CONSOLE
56 Granny2ExceptionWriter.WriteToConsole(ex,st);
57 #endif
58 return default(ExporterInfo);
59 }
60 }
61
62 internal static ExporterInfo ReadFromNative(native.ExporterInfo native)
63 {
64 try
65 {
66 ExporterInfo managed = new ExporterInfo();
67 managed.exporterName = string.IsNullOrEmpty(native.ExporterName) ? "{null}" : native.ExporterName;
68 managed.ExporterMajorRevision = native.ExporterMajorRevision;
69 managed.ExporterMinorRevision = native.ExporterMinorRevision;
70 managed.ExporterCustomization = native.ExporterCustomization;
71 managed.ExporterBuildNumber = native.ExporterBuildNumber;
72 return managed;
73 }
74 catch (Exception ex)
75 {
76 StackTrace st = new StackTrace(true);
77 #if ENABLE_EXCEPTION_OUTPUT_TO_CONSOLE
78 Granny2ExceptionWriter.WriteToConsole(ex,st);
79 #endif
80 return default(ExporterInfo);
81 }
82 }
83
84 #region IExporterInfo Members
85 /// <summary>
86 /// Exporter Name
87 /// </summary>
88 [RefreshPropertiesAttribute(RefreshProperties.All)]
89 public StringType ExporterName { get { return exporterName; } set { exporterName = value; } }
90
91 /// <summary>
92 /// Exporter Major
93 /// </summary>
94 [RefreshPropertiesAttribute(RefreshProperties.All)]
95 public int ExporterMajorRevision { get { return Version.major; } set { Version.major = value; } }
96 /// <summary>
97 /// Exporter Minor
98 /// </summary>
99 [RefreshPropertiesAttribute(RefreshProperties.All)]
100 public int ExporterMinorRevision { get { return Version.minor; } set { Version.minor = value; } }
101 /// <summary>
102 /// Exporter Customization
103 /// </summary>
104 [RefreshPropertiesAttribute(RefreshProperties.All)]
105 public int ExporterCustomization { get { return Version.customization; } set { Version.customization = value; } }
106 /// <summary>
107 /// Exporter Build
108 /// </summary>
109 [RefreshPropertiesAttribute(RefreshProperties.All)]
110 public int ExporterBuildNumber { get { return Version.build; } set { Version.build = value; } }
111
112 private versiontype _Version;
113 /// <summary>
114 /// Exporter Version
115 /// </summary>
116 [RefreshPropertiesAttribute(RefreshProperties.All)]
117 public versiontype Version
118 {
119 get { return _Version; }
120 set { _Version = value; }
121 }
122
123 #endregion
124 #region INativePointer Members
125 private IntPtr _NativePointer;
126 /// <summary>
127 /// When used in a derived class, gets the native pointer for this instance
128 /// </summary>
129 public IntPtr NativePointer { get { return _NativePointer; } set { _NativePointer = value; } }
130 #endregion
131
132 #region IExtendedData Members
133 private IntPtr _ExtendedData;
134 /// <summary>
135 /// When used in a derived class, gets the ExtendedData pointer for this instance
136 /// </summary>
137 public IntPtr ExtendedData { get { return _ExtendedData; } set { _ExtendedData = value; } }
138 #endregion
139 }
140 }

  ViewVC Help
Powered by ViewVC 1.1.22