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

Diff of /trunk/gr2lib/core/coretypes/implementation/grnfileinfo.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 71 by william, Thu Jul 15 13:07:44 2010 UTC revision 72 by william, Thu Jul 15 14:22:00 2010 UTC
# Line 5  using gr2lib.core.helpers; Line 5  using gr2lib.core.helpers;
5    
6  namespace gr2lib.core.coretypes.implementation  namespace gr2lib.core.coretypes.implementation
7  {  {
8        public interface Igrnfileinfo
9        {
10            ArtToolInfo ArtToolInfo { get;set;}
11            ExporterInfo ExporterInfo { get; set; }
12            string FromFileName { get; set; }
13            List<Texture> Textures { get; set; }
14        }
15      public class grnfileinfo      public class grnfileinfo
16      {      {
17          public ArtToolInfo ArtToolInfo;          private string fromFileName;
18          public ExporterInfo ExporterInfo;          private ArtToolInfo _ArtToolInfo;
19            private ExporterInfo _ExporterInfo;
20            private List<Texture> _Textures;
21    
22            #region Igrnfileinfo Members
23            public ArtToolInfo ArtToolInfo { get { return _ArtToolInfo; } set { _ArtToolInfo = value; } }
24            public ExporterInfo ExporterInfo { get { return _ExporterInfo; } set { _ExporterInfo = value; } }
25            public string FromFileName { get { return fromFileName; } set { fromFileName = value; } }
26            public List<Texture> Textures { get { return _Textures; } set { _Textures = value; } }
27            #endregion
28    
29          public IntPtr NativePointer;          public IntPtr NativePointer;
30    
31          internal string filePath;          internal string filePath;
32          internal string fileName;          internal string fileName;
33    
# Line 44  namespace gr2lib.core.coretypes.implemen Line 61  namespace gr2lib.core.coretypes.implemen
61              {              {
62                  managed.ExporterInfo = ExporterInfo.ReadFromMemory(native.ExporterInfo);                  managed.ExporterInfo = ExporterInfo.ReadFromMemory(native.ExporterInfo);
63              }              }
64    
65                managed.fromFileName = string.IsNullOrEmpty(native.FromFileName) ? "{null}" : native.FromFileName;
66    
67                int length = 0;
68                if (native.Textures.Pointer != IntPtr.Zero)
69                {
70                    IntPtr[] textures = Helpers.ReadArrayFromMemory(native.Textures);
71                    length = textures.Length;
72                    managed.Textures = new List<Texture>(length);
73                    foreach (IntPtr ptr in textures)
74                    {
75                        managed.Textures.Add(new Texture());
76                    }
77                    for (int i = 0; i < length; i++)
78                    {
79                        managed.Textures[i] = Texture.ReadFromMemory(textures[i]);
80                    }
81                }
82    
83    
84              return managed;              return managed;
85          }          }
86          public static grnfileinfo ReadFromFile(string fileName)          public static grnfileinfo ReadFromFile(string fileName)

Legend:
Removed from v.71  
changed lines
  Added in v.72

  ViewVC Help
Powered by ViewVC 1.1.22