/[RomCheater]/trunk/RomCheater/Docking/MemorySearch/ResultType.cs
ViewVC logotype

Contents of /trunk/RomCheater/Docking/MemorySearch/ResultType.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 476 - (show annotations) (download)
Mon Jun 3 18:22:20 2013 UTC (8 years, 6 months ago) by william
File size: 1937 byte(s)
+ use ResultType<ulong> instead of ResultType<object>
+ use StructResultType<ulong> instead of StructResultType<object>

1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5
6 namespace RomCheater.Docking.MemorySearch
7 {
8 [Serializable()]
9 public class ResultType<T> : IDisposable
10 where T : IConvertible
11 {
12
13 public ResultType()
14 {
15 this.Address = 0;
16 this.Value = default(T);
17 }
18 public ResultType(uint Address, T Value)
19 {
20 this.Address = Address;
21 this.Value = Value;
22 }
23 private uint _Address;
24 private T _Value;
25 public uint Address { get { return _Address; } set { _Address = value; } }
26 public T Value { get { return _Value; } set { _Value = value; } }
27
28 #region IDisposable Members
29 protected virtual void Dispose(bool disposing)
30 {
31 if (disposing)
32 {
33 // dispose managed resources
34 }
35 // free native resources
36 }
37 public void Dispose()
38 {
39 Dispose(true);
40 GC.SuppressFinalize(this); // do not finalize because we don't have any unmanaged resources.
41 }
42
43 #endregion
44 }
45 [Serializable()]
46 public struct StructResultType<T>
47 where T : IConvertible
48 {
49 public static StructResultType<T> Empty { get { return new StructResultType<T>(0, (T)Convert.ChangeType(0, typeof(T))); } }
50 //public StructResultType()
51 //{
52 // _Address = 0;
53 // _Value = default(T);
54 //}
55 public StructResultType(uint Address, T Value)
56 {
57 _Address = Address;
58 _Value = Value;
59 }
60 private uint _Address;
61 private T _Value;
62 public uint Address { get { return _Address; } set { _Address = value; } }
63 public T Value { get { return _Value; } set { _Value = value; } }
64 }
65 }

  ViewVC Help
Powered by ViewVC 1.1.22