/[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

--- trunk/gr2lib/core/coretypes/implementation/grnfileinfo.cs	2010/07/15 13:07:44	71
+++ trunk/gr2lib/core/coretypes/implementation/grnfileinfo.cs	2010/07/15 14:22:00	72
@@ -5,12 +5,29 @@
 
 namespace gr2lib.core.coretypes.implementation
 {
+    public interface Igrnfileinfo
+    {
+        ArtToolInfo ArtToolInfo { get;set;}
+        ExporterInfo ExporterInfo { get; set; }
+        string FromFileName { get; set; }
+        List<Texture> Textures { get; set; }
+    }
     public class grnfileinfo
     {
-        public ArtToolInfo ArtToolInfo;
-        public ExporterInfo ExporterInfo;
+        private string fromFileName;
+        private ArtToolInfo _ArtToolInfo;
+        private ExporterInfo _ExporterInfo;
+        private List<Texture> _Textures;
+
+        #region Igrnfileinfo Members
+        public ArtToolInfo ArtToolInfo { get { return _ArtToolInfo; } set { _ArtToolInfo = value; } }
+        public ExporterInfo ExporterInfo { get { return _ExporterInfo; } set { _ExporterInfo = value; } }
+        public string FromFileName { get { return fromFileName; } set { fromFileName = value; } }
+        public List<Texture> Textures { get { return _Textures; } set { _Textures = value; } }
+        #endregion
 
         public IntPtr NativePointer;
+
         internal string filePath;
         internal string fileName;
 
@@ -44,6 +61,26 @@
             {
                 managed.ExporterInfo = ExporterInfo.ReadFromMemory(native.ExporterInfo);
             }
+
+            managed.fromFileName = string.IsNullOrEmpty(native.FromFileName) ? "{null}" : native.FromFileName;
+
+            int length = 0;
+            if (native.Textures.Pointer != IntPtr.Zero)
+            {
+                IntPtr[] textures = Helpers.ReadArrayFromMemory(native.Textures);
+                length = textures.Length;
+                managed.Textures = new List<Texture>(length);
+                foreach (IntPtr ptr in textures)
+                {
+                    managed.Textures.Add(new Texture());
+                }
+                for (int i = 0; i < length; i++)
+                {
+                    managed.Textures[i] = Texture.ReadFromMemory(textures[i]);
+                }
+            }
+
+
             return managed;
         }
         public static grnfileinfo ReadFromFile(string fileName)

 

  ViewVC Help
Powered by ViewVC 1.1.22