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

Annotation of /trunk/gr2lib/core/coretypes/implementation/Map.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 79 - (hide annotations) (download)
Thu Jul 15 21:50:56 2010 UTC (11 years, 6 months ago) by william
File size: 1343 byte(s)
create and implement interfaces for all core classes (for type casting)

1 william 79 using System;
2     using System.Collections.Generic;
3     using System.Linq;
4     using System.Text;
5     using gr2lib.core.helpers;
6     using gr2lib.core.interfaces;
7     namespace gr2lib.core.coretypes.implementation
8     {
9     public class Map : IMap
10     {
11     internal static Map ReadFromMemory(IntPtr pointer)
12     {
13     if (pointer == IntPtr.Zero) return null;
14     native.Map native = Helpers.ReadFromMemory<native.Map>(pointer);
15     Map managed = ReadFromNative(native);
16     managed.NativePointer = pointer;
17     return managed;
18     }
19    
20     internal static Map ReadFromNative(native.Map native)
21     {
22     Map managed = new Map();
23     managed.Usage = native.Usage;
24     managed.MapPointer = native.MapPointer;
25     return managed;
26     }
27    
28     #region INativePointer Members
29     private IntPtr _NativePointer;
30     public IntPtr NativePointer { get { return _NativePointer; } set { _NativePointer = value; } }
31     #endregion
32    
33     #region IMap Members
34     private string _Usage;
35     private IntPtr _MapPointer;
36    
37     public string Usage { get { return _Usage; } set { _Usage = value; } }
38     public IntPtr MapPointer { get { return _MapPointer; } set { _MapPointer = value; } }
39     #endregion
40     }
41     }

  ViewVC Help
Powered by ViewVC 1.1.22