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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 578 - (show annotations) (download)
Thu Jun 6 08:18:44 2013 UTC (6 years, 8 months ago) by william
File size: 3793 byte(s)

1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5
6 namespace RomCheater.Docking.MemorySearch
7 {
8 public class MemComparer<T> : ICompareValue<T>, ICompareAddress, ISearchSettings, IDisposable
9 {
10
11 public MemComparer(SearchType search_settings, ulong address, T value)
12 {
13 this.SearchSettings = search_settings;
14 this.Address = address;
15 this.Value = value;
16 }
17
18 //#region IMemComparer<T> Members
19 //public bool Compare(T CompareToValue, T CompareFromValue)
20 //{
21 // return true;
22 //}
23 //#endregion
24
25 #region ICompareValue<T> Members
26 private T _Value;
27 public T Value { get { return _Value; } set { _Value = value; } }
28 #endregion
29
30 #region ICompareAddress Members
31 private ulong _Address;
32 public ulong Address { get { return _Address; } set { _Address = value; } }
33 #endregion
34
35 #region ISearchSettings Members
36 private SearchType _SearchSettings;
37 public SearchType SearchSettings { get { return _SearchSettings; } set { _SearchSettings = value; } }
38 #endregion
39
40
41 #region IDisposable Support
42 // Track whether Dispose has been called.
43 private bool disposed = false;
44 // Implement IDisposable.
45 // Do not make this method virtual.
46 // A derived class should not be able to override this method.
47 public void Dispose()
48 {
49 Dispose(true);
50 // This object will be cleaned up by the Dispose method.
51 // Therefore, you should call GC.SupressFinalize to
52 // take this object off the finalization queue
53 // and prevent finalization code for this object
54 // from executing a second time.
55 GC.SuppressFinalize(this);
56 }
57 // Dispose(bool disposing) executes in two distinct scenarios.
58 // If disposing equals true, the method has been called directly
59 // or indirectly by a user's code. Managed and unmanaged resources
60 // can be disposed.
61 // If disposing equals false, the method has been called by the
62 // runtime from inside the finalizer and you should not reference
63 // other objects. Only unmanaged resources can be disposed.
64 protected virtual void Dispose(bool disposing)
65 {
66 // Check to see if Dispose has already been called.
67 if (!this.disposed)
68 {
69 // If disposing equals true, dispose all managed
70 // and unmanaged resources.
71 if (disposing)
72 {
73 // Dispose managed resources.
74 //component.Dispose();
75 }
76
77 // Call the appropriate methods to clean up
78 // unmanaged resources here.
79 // If disposing is false,
80 // only the following code is executed.
81
82 // empty
83
84 // Note disposing has been done.
85 disposed = true;
86
87 }
88 }
89 // Use C# destructor syntax for finalization code.
90 // This destructor will run only if the Dispose method
91 // does not get called.
92 // It gives your base class the opportunity to finalize.
93 // Do not provide destructors in types derived from this class.
94 ~MemComparer()
95 {
96 // Do not re-create Dispose clean-up code here.
97 // Calling Dispose(false) is optimal in terms of
98 // readability and maintainability.
99 Dispose(false);
100 }
101 #endregion
102 }
103 }

  ViewVC Help
Powered by ViewVC 1.1.22