Changeset 13 for trunk/MacFaceLibrary/Part.cs
- Timestamp:
- Nov 15, 2004, 2:12:03 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MacFaceLibrary/Part.cs
r8 r13 12 12 /// Part ÌTvÌà¾Å·B 13 13 /// </summary> 14 public class Part 14 public class Part : IDisposable 15 15 { 16 protected Image image; 17 protected string filename; 18 protected int x; 19 protected int y; 16 private Image _image; 17 private string _filename; 18 private Point _point; 20 19 21 20 /*public Part(string basePath, Hashtable partDef) … … 28 27 public Part(String path, int x, int y) 29 28 { 30 this.filename = filename;31 this.image = Image.FromFile(path);32 this. x= x;33 this. y= y;29 _filename = System.IO.Path.GetFileName(path); 30 _image = Image.FromFile(path); 31 this.X = x; 32 this.Y = y; 34 33 } 35 34 36 35 public Part(String path, Image image, int x, int y) 37 36 { 38 this.filename = filename;39 this.image = image;40 this. x= x;41 this. y= y;37 _filename = System.IO.Path.GetFileName(path); 38 _image = image; 39 this.X = x; 40 this.Y = y; 42 41 } 43 42 44 43 public string FileName 45 44 { 46 get { return filename; }45 get { return _filename; } 47 46 } 48 47 49 48 public Image Image 50 49 { 51 get { return image; }50 get { return _image; } 52 51 } 53 52 53 public Point Point 54 { 55 get { return _point; } 56 set { _point = value; } 57 } 54 58 public int X 55 59 { 56 get { return x; } 60 get { return _point.X; } 61 set { _point.X = value; } 57 62 } 58 63 59 64 public int Y 60 65 { 61 get { return y; } 66 get { return 128 - _point.Y - _image.Height; } 67 set { _point.Y = 128 - value - _image.Height; } 62 68 } 63 69 … … 67 73 g.DrawImage(img, x, drawY, img.Size.Width, img.Size.Height); 68 74 }*/ 75 76 #region IDisposable o 77 78 public void Dispose() 79 { 80 Dispose(true); 81 GC.SuppressFinalize(this); 82 } 83 84 protected virtual void Dispose(bool disposing) 85 { 86 if (disposing) 87 { 88 } 89 // í 90 if (_image != null) { _image.Dispose(); } 91 } 92 93 ~Part() 94 { 95 Dispose(false); 96 } 97 98 #endregion 69 99 } 70 100 }
Note: See TracChangeset
for help on using the changeset viewer.