125 |
|
public void LogSearchOptions() |
126 |
|
{ |
127 |
|
|
128 |
< |
StringBuilder builder = new StringBuilder(); |
128 |
> |
//StringBuilder builder = new StringBuilder(); |
129 |
|
|
130 |
< |
builder.AppendLine("Current Search Options:"); |
130 |
> |
logger.Info.WriteLine("Current Search Options:"); |
131 |
|
// write Data type |
132 |
< |
builder.AppendFormat("Data Type: {0}\n", Enum.GetName(typeof(SearchDataTypes), this.DataType)); |
132 |
> |
logger.Info.WriteLine("Data Type: {0}", Enum.GetName(typeof(SearchDataTypes), this.DataType)); |
133 |
|
// write Signed/Unsigned |
134 |
< |
if (this.IsUnsignedDataType) { builder.AppendFormat("Signed/Unsigned: {0}\n", "Unsigned"); } |
135 |
< |
else { builder.AppendFormat("Signed/Unsigned: {0}\n", "Signed"); } |
134 |
> |
if (this.IsUnsignedDataType) { logger.Info.WriteLine("Signed/Unsigned: {0}", "Unsigned"); } |
135 |
> |
else { logger.Info.WriteLine("Signed/Unsigned: {0}", "Signed"); } |
136 |
|
// Write Compare Type |
137 |
< |
builder.AppendFormat("Comparison Type: {0}\n", Enum.GetName(typeof(SearchCompareTypes), this.CompareType)); |
137 |
> |
logger.Info.WriteLine("Comparison Type: {0}", Enum.GetName(typeof(SearchCompareTypes), this.CompareType)); |
138 |
|
// Write Compare Value Tupe |
139 |
< |
builder.AppendFormat("Comparison Value Type: {0}\n", Enum.GetName(typeof(CompareValueTypes), this.CompareValueType)); |
139 |
> |
logger.Info.WriteLine("Comparison Value Type: {0}", Enum.GetName(typeof(CompareValueTypes), this.CompareValueType)); |
140 |
|
// Write Value |
141 |
|
if (this.CompareType != SearchCompareTypes.Between && this.CompareType != SearchCompareTypes.NotBetween) |
142 |
|
{ |
146 |
|
switch (this.DataType) |
147 |
|
{ |
148 |
|
case SearchDataTypes._8bits: |
149 |
< |
if (this.IsUnsignedDataType) { builder.AppendFormat("Comparison Value: 0x{0}\n", Convert.ToByte(this.CompareStartValue).ToString("x2")); } |
150 |
< |
else { builder.AppendFormat("Comparison Value: 0x{0}\n", Convert.ToSByte(this.CompareStartValue).ToString("x2")); } |
149 |
> |
if (this.IsUnsignedDataType) { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToByte(this.CompareStartValue).ToString("x2")); } |
150 |
> |
else { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToSByte(this.CompareStartValue).ToString("x2")); } |
151 |
|
break; |
152 |
|
case SearchDataTypes._16bits: |
153 |
< |
if (this.IsUnsignedDataType) { builder.AppendFormat("Comparison Value: 0x{0}\n", Convert.ToUInt16(this.CompareStartValue).ToString("x4")); } |
154 |
< |
else { builder.AppendFormat("Comparison Value: 0x{0}\n", Convert.ToInt16(this.CompareStartValue).ToString("x4")); } |
153 |
> |
if (this.IsUnsignedDataType) { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToUInt16(this.CompareStartValue).ToString("x4")); } |
154 |
> |
else { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToInt16(this.CompareStartValue).ToString("x4")); } |
155 |
|
break; |
156 |
|
case SearchDataTypes._32bits: |
157 |
< |
if (this.IsUnsignedDataType) { builder.AppendFormat("Comparison Value: 0x{0}\n", Convert.ToUInt32(this.CompareStartValue).ToString("x8")); } |
158 |
< |
else { builder.AppendFormat("Comparison Value: 0x{0}\n", Convert.ToInt32(this.CompareStartValue).ToString("x8")); } |
157 |
> |
if (this.IsUnsignedDataType) { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToUInt32(this.CompareStartValue).ToString("x8")); } |
158 |
> |
else { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToInt32(this.CompareStartValue).ToString("x8")); } |
159 |
|
break; |
160 |
|
case SearchDataTypes._64bits: |
161 |
< |
if (this.IsUnsignedDataType) { builder.AppendFormat("Comparison Value: 0x{0}\n", Convert.ToUInt64(this.CompareStartValue).ToString("x16")); } |
162 |
< |
else { builder.AppendFormat("Comparison Value: 0x{0}\n", Convert.ToInt64(this.CompareStartValue).ToString("x16")); } |
161 |
> |
if (this.IsUnsignedDataType) { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToUInt64(this.CompareStartValue).ToString("x16")); } |
162 |
> |
else { logger.Info.WriteLine("Comparison Value: 0x{0}", Convert.ToInt64(this.CompareStartValue).ToString("x16")); } |
163 |
|
break; |
164 |
|
default: throw new InvalidOperationException("In SearchType(): Encounterd an Unkown Search Data Type."); |
165 |
|
} |
166 |
|
} |
167 |
|
else |
168 |
|
{ |
169 |
< |
builder.AppendFormat("Comparison Value: {0}\n", "ignored"); |
169 |
> |
logger.Info.WriteLine("Comparison Value: {0}\n", "ignored"); |
170 |
|
} |
171 |
|
#endregion |
172 |
|
} |
176 |
|
switch (this.DataType) |
177 |
|
{ |
178 |
|
case SearchDataTypes._8bits: |
179 |
< |
if (this.IsUnsignedDataType) { builder.AppendFormat("Comparison Range: 0x{0:x2} to 0x{1:x2}\n", Convert.ToByte(this.CompareStartValue), Convert.ToByte(this.CompareEndValue)); } |
180 |
< |
else { builder.AppendFormat("Comparison Range: 0x{0:x2} to 0x{1:x2}\n", Convert.ToSByte(this.CompareStartValue), Convert.ToSByte(this.CompareEndValue)); } |
179 |
> |
if (this.IsUnsignedDataType) { logger.Info.WriteLine("Comparison Range: 0x{0:x2} to 0x{1:x2}", Convert.ToByte(this.CompareStartValue), Convert.ToByte(this.CompareEndValue)); } |
180 |
> |
else { logger.Info.WriteLine("Comparison Range: 0x{0:x2} to 0x{1:x2}", Convert.ToSByte(this.CompareStartValue), Convert.ToSByte(this.CompareEndValue)); } |
181 |
|
break; |
182 |
|
case SearchDataTypes._16bits: |
183 |
< |
if (this.IsUnsignedDataType) { builder.AppendFormat("CComparison Range: 0x{0:x2} to 0x{1:x4}\n", Convert.ToUInt16(this.CompareStartValue), Convert.ToUInt16(this.CompareEndValue)); } |
184 |
< |
else { builder.AppendFormat("Comparison Range: 0x{0:x4} to 0x{1:x4}\n", Convert.ToInt16(this.CompareStartValue), Convert.ToUInt16(this.CompareEndValue)); } |
183 |
> |
if (this.IsUnsignedDataType) { logger.Info.WriteLine("CComparison Range: 0x{0:x2} to 0x{1:x4}", Convert.ToUInt16(this.CompareStartValue), Convert.ToUInt16(this.CompareEndValue)); } |
184 |
> |
else { logger.Info.WriteLine("Comparison Range: 0x{0:x4} to 0x{1:x4}", Convert.ToInt16(this.CompareStartValue), Convert.ToUInt16(this.CompareEndValue)); } |
185 |
|
break; |
186 |
|
case SearchDataTypes._32bits: |
187 |
< |
if (this.IsUnsignedDataType) { builder.AppendFormat("Comparison Range: 0x{0:x8} to 0x{1:x8}\n", Convert.ToUInt32(this.CompareStartValue), Convert.ToUInt32(this.CompareEndValue)); } |
188 |
< |
else { builder.AppendFormat("Comparison Range: 0x{0:x8} to 0x{1:x8}\n", Convert.ToInt32(this.CompareStartValue), Convert.ToInt32(this.CompareEndValue)); } |
187 |
> |
if (this.IsUnsignedDataType) { logger.Info.WriteLine("Comparison Range: 0x{0:x8} to 0x{1:x8}", Convert.ToUInt32(this.CompareStartValue), Convert.ToUInt32(this.CompareEndValue)); } |
188 |
> |
else { logger.Info.WriteLine("Comparison Range: 0x{0:x8} to 0x{1:x8}", Convert.ToInt32(this.CompareStartValue), Convert.ToInt32(this.CompareEndValue)); } |
189 |
|
break; |
190 |
|
case SearchDataTypes._64bits: |
191 |
< |
if (this.IsUnsignedDataType) { builder.AppendFormat("Comparison Range: 0x{0:x16} to 0x{1:x16}\n", Convert.ToUInt64(this.CompareStartValue), Convert.ToUInt64(this.CompareEndValue)); } |
192 |
< |
else { builder.AppendFormat("Comparison Range: 0x{0:x16} to 0x{1:x16}\n", Convert.ToInt64(this.CompareStartValue), Convert.ToInt64(this.CompareEndValue)); } |
191 |
> |
if (this.IsUnsignedDataType) { logger.Info.WriteLine("Comparison Range: 0x{0:x16} to 0x{1:x16}", Convert.ToUInt64(this.CompareStartValue), Convert.ToUInt64(this.CompareEndValue)); } |
192 |
> |
else { logger.Info.WriteLine("Comparison Range: 0x{0:x16} to 0x{1:x16}", Convert.ToInt64(this.CompareStartValue), Convert.ToInt64(this.CompareEndValue)); } |
193 |
|
break; |
194 |
|
default: throw new InvalidOperationException("In SearchType(): Encounterd an Unkown Search Data Type."); |
195 |
|
} |
196 |
|
#endregion |
197 |
|
} |
198 |
|
|
199 |
< |
logger.Info.WriteLine(builder.ToString()); |
199 |
> |
//logger.Info.WriteLine(builder.ToString()); |
200 |
|
} |
201 |
|
#endregion |
202 |
|
|