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

Diff of /trunk/RomCheater/Docking/MemorySearch/SearchType.cs

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

revision 811 by william, Wed Jun 5 08:03:28 2013 UTC revision 812 by william, Tue Apr 15 14:52:10 2014 UTC
# Line 18  using System.Text; Line 18  using System.Text;
18  using Utilities.TransparentControls;  using Utilities.TransparentControls;
19  using RomCheater.Logging;  using RomCheater.Logging;
20  using RomCheater.Core;  using RomCheater.Core;
21    using Enterprise.Logging;
22    
23  namespace RomCheater.Docking.MemorySearch  namespace RomCheater.Docking.MemorySearch
24  {  {
# Line 149  namespace RomCheater.Docking.MemorySearc Line 150  namespace RomCheater.Docking.MemorySearc
150    
151              //StringBuilder builder = new StringBuilder();              //StringBuilder builder = new StringBuilder();
152    
153              logger.Info.WriteLine("Current Search Options:");              gLog.Info.WriteLine("Current Search Options:");
154              int size = 0;              int size = 0;
155              BitTools.SizeOf(this.DataType, out size);              BitTools.SizeOf(this.DataType, out size);
156              // write Data type              // write Data type
157              if (size == 1)              if (size == 1)
158              {              {
159                  logger.Info.WriteLine("Data Type: {0} [{1} byte]", Enum.GetName(typeof(SearchDataTypes), this.DataType), size);                  gLog.Info.WriteLine("Data Type: {0} [{1} byte]", Enum.GetName(typeof(SearchDataTypes), this.DataType), size);
160              }              }
161              else              else
162                  logger.Info.WriteLine("Data Type: {0} [{1} bytes]", Enum.GetName(typeof(SearchDataTypes), this.DataType), size);                  gLog.Info.WriteLine("Data Type: {0} [{1} bytes]", Enum.GetName(typeof(SearchDataTypes), this.DataType), size);
163              {              {
164              }              }
165              // write Signed/Unsigned              // write Signed/Unsigned
166              if (this.IsUnsignedDataType) { logger.Info.WriteLine("Signed/Unsigned: {0}", "Unsigned"); }              if (this.IsUnsignedDataType) { gLog.Info.WriteLine("Signed/Unsigned: {0}", "Unsigned"); }
167              else { logger.Info.WriteLine("Signed/Unsigned: {0}", "Signed"); }              else { gLog.Info.WriteLine("Signed/Unsigned: {0}", "Signed"); }
168              // Write Compare Type              // Write Compare Type
169              logger.Info.WriteLine("Comparison Type: {0}", Enum.GetName(typeof(SearchCompareTypes), this.CompareType));              gLog.Info.WriteLine("Comparison Type: {0}", Enum.GetName(typeof(SearchCompareTypes), this.CompareType));
170              // Write Compare Value Tupe              // Write Compare Value Tupe
171              logger.Info.WriteLine("Comparison Value Type: {0}", Enum.GetName(typeof(CompareValueTypes), this.CompareValueType));              gLog.Info.WriteLine("Comparison Value Type: {0}", Enum.GetName(typeof(CompareValueTypes), this.CompareValueType));
172              // Write Value              // Write Value
173              if (this.CompareType != SearchCompareTypes.Between && this.CompareType != SearchCompareTypes.NotBetween)              if (this.CompareType != SearchCompareTypes.Between && this.CompareType != SearchCompareTypes.NotBetween)
174              {              {
# Line 177  namespace RomCheater.Docking.MemorySearc Line 178  namespace RomCheater.Docking.MemorySearc
178                      switch (this.DataType)                      switch (this.DataType)
179                      {                      {
180                          case SearchDataTypes._8bits:                          case SearchDataTypes._8bits:
181                              if (this.IsUnsignedDataType) { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToByte(this.CompareStartValue).ToString("x2")); }                              if (this.IsUnsignedDataType) { gLog.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToByte(this.CompareStartValue).ToString("x2")); }
182                              else { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToSByte(this.CompareStartValue).ToString("x2")); }                              else { gLog.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToSByte(this.CompareStartValue).ToString("x2")); }
183                              break;                              break;
184                          case SearchDataTypes._16bits:                          case SearchDataTypes._16bits:
185                              if (this.IsUnsignedDataType) { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToUInt16(this.CompareStartValue).ToString("x4")); }                              if (this.IsUnsignedDataType) { gLog.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToUInt16(this.CompareStartValue).ToString("x4")); }
186                              else { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToInt16(this.CompareStartValue).ToString("x4")); }                              else { gLog.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToInt16(this.CompareStartValue).ToString("x4")); }
187                              break;                              break;
188                          case SearchDataTypes._32bits:                          case SearchDataTypes._32bits:
189                              if (this.IsUnsignedDataType) { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToUInt32(this.CompareStartValue).ToString("x8")); }                              if (this.IsUnsignedDataType) { gLog.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToUInt32(this.CompareStartValue).ToString("x8")); }
190                              else { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToInt32(this.CompareStartValue).ToString("x8")); }                              else { gLog.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToInt32(this.CompareStartValue).ToString("x8")); }
191                              break;                              break;
192                          case SearchDataTypes._64bits:                          case SearchDataTypes._64bits:
193                              if (this.IsUnsignedDataType) { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToUInt64(this.CompareStartValue).ToString("x16")); }                              if (this.IsUnsignedDataType) { gLog.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToUInt64(this.CompareStartValue).ToString("x16")); }
194                              else { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToInt64(this.CompareStartValue).ToString("x16")); }                              else { gLog.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToInt64(this.CompareStartValue).ToString("x16")); }
195                              break;                              break;
196                          default: throw new InvalidOperationException("In SearchType(): Encounterd an Unkown Search Data Type.");                          default: throw new InvalidOperationException("In SearchType(): Encounterd an Unkown Search Data Type.");
197                      }                      }
198                  }                  }
199                  else                  else
200                  {                  {
201                      logger.Info.WriteLine("Comparison Value: {0}\n", "ignored");                      gLog.Info.WriteLine("Comparison Value: {0}\n", "ignored");
202                  }                  }
203                  #endregion                  #endregion
204              }              }
# Line 207  namespace RomCheater.Docking.MemorySearc Line 208  namespace RomCheater.Docking.MemorySearc
208                  switch (this.DataType)                  switch (this.DataType)
209                  {                  {
210                      case SearchDataTypes._8bits:                      case SearchDataTypes._8bits:
211                          if (this.IsUnsignedDataType) { logger.Info.WriteLine("Comparison Range: 0x{0:x2} to 0x{1:x2}", Convert.ToByte(this.CompareStartValue), Convert.ToByte(this.CompareEndValue)); }                          if (this.IsUnsignedDataType) { gLog.Info.WriteLine("Comparison Range: 0x{0:x2} to 0x{1:x2}", Convert.ToByte(this.CompareStartValue), Convert.ToByte(this.CompareEndValue)); }
212                          else { logger.Info.WriteLine("Comparison Range: 0x{0:x2} to 0x{1:x2}", Convert.ToSByte(this.CompareStartValue), Convert.ToSByte(this.CompareEndValue)); }                          else { gLog.Info.WriteLine("Comparison Range: 0x{0:x2} to 0x{1:x2}", Convert.ToSByte(this.CompareStartValue), Convert.ToSByte(this.CompareEndValue)); }
213                          break;                          break;
214                      case SearchDataTypes._16bits:                      case SearchDataTypes._16bits:
215                          if (this.IsUnsignedDataType) { logger.Info.WriteLine("CComparison Range: 0x{0:x2} to 0x{1:x4}", Convert.ToUInt16(this.CompareStartValue), Convert.ToUInt16(this.CompareEndValue)); }                          if (this.IsUnsignedDataType) { gLog.Info.WriteLine("CComparison Range: 0x{0:x2} to 0x{1:x4}", Convert.ToUInt16(this.CompareStartValue), Convert.ToUInt16(this.CompareEndValue)); }
216                          else { logger.Info.WriteLine("Comparison Range: 0x{0:x4} to 0x{1:x4}", Convert.ToInt16(this.CompareStartValue), Convert.ToUInt16(this.CompareEndValue)); }                          else { gLog.Info.WriteLine("Comparison Range: 0x{0:x4} to 0x{1:x4}", Convert.ToInt16(this.CompareStartValue), Convert.ToUInt16(this.CompareEndValue)); }
217                          break;                          break;
218                      case SearchDataTypes._32bits:                      case SearchDataTypes._32bits:
219                          if (this.IsUnsignedDataType) { logger.Info.WriteLine("Comparison Range: 0x{0:x8} to 0x{1:x8}", Convert.ToUInt32(this.CompareStartValue), Convert.ToUInt32(this.CompareEndValue)); }                          if (this.IsUnsignedDataType) { gLog.Info.WriteLine("Comparison Range: 0x{0:x8} to 0x{1:x8}", Convert.ToUInt32(this.CompareStartValue), Convert.ToUInt32(this.CompareEndValue)); }
220                          else { logger.Info.WriteLine("Comparison Range: 0x{0:x8} to 0x{1:x8}", Convert.ToInt32(this.CompareStartValue), Convert.ToInt32(this.CompareEndValue)); }                          else { gLog.Info.WriteLine("Comparison Range: 0x{0:x8} to 0x{1:x8}", Convert.ToInt32(this.CompareStartValue), Convert.ToInt32(this.CompareEndValue)); }
221                          break;                          break;
222                      case SearchDataTypes._64bits:                      case SearchDataTypes._64bits:
223                          if (this.IsUnsignedDataType) { logger.Info.WriteLine("Comparison Range: 0x{0:x16} to 0x{1:x16}", Convert.ToUInt64(this.CompareStartValue), Convert.ToUInt64(this.CompareEndValue)); }                          if (this.IsUnsignedDataType) { gLog.Info.WriteLine("Comparison Range: 0x{0:x16} to 0x{1:x16}", Convert.ToUInt64(this.CompareStartValue), Convert.ToUInt64(this.CompareEndValue)); }
224                          else { logger.Info.WriteLine("Comparison Range: 0x{0:x16} to 0x{1:x16}", Convert.ToInt64(this.CompareStartValue), Convert.ToInt64(this.CompareEndValue)); }                          else { gLog.Info.WriteLine("Comparison Range: 0x{0:x16} to 0x{1:x16}", Convert.ToInt64(this.CompareStartValue), Convert.ToInt64(this.CompareEndValue)); }
225                          break;                          break;
226                      default: throw new InvalidOperationException("In SearchType(): Encounterd an Unkown Search Data Type.");                      default: throw new InvalidOperationException("In SearchType(): Encounterd an Unkown Search Data Type.");
227                  }                  }

Legend:
Removed from v.811  
changed lines
  Added in v.812

  ViewVC Help
Powered by ViewVC 1.1.22