Permalink
Browse files

Fix.

  • Loading branch information...
1 parent 990b5e2 commit 395db5ffa7366799daaff5e49c489592585dd3b4 TOM_RUS committed Jan 11, 2012
View
@@ -17,16 +17,16 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Debug|Any CPU.ActiveCfg = Debug|x86
- {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Debug|x86.ActiveCfg = Debug|x86
- {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Debug|x86.Build.0 = Debug|x86
- {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Release|Any CPU.ActiveCfg = Release|x86
- {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Release|Mixed Platforms.Build.0 = Release|x86
- {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Release|x86.ActiveCfg = Release|x86
- {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Release|x86.Build.0 = Release|x86
+ {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {04F8B0DA-4747-40DA-AA73-40BB50F6185C}.Release|x86.ActiveCfg = Release|Any CPU
{1A2AD897-3AB7-4C6E-9071-B63D54D36E84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A2AD897-3AB7-4C6E-9071-B63D54D36E84}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A2AD897-3AB7-4C6E-9071-B63D54D36E84}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -29,28 +29,6 @@
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
<PropertyGroup>
<ApplicationIcon>dbc.ico</ApplicationIcon>
</PropertyGroup>
@@ -73,6 +51,42 @@
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <DebugType>full</DebugType>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <CodeAnalysisLogFile>bin\Debug\DBC Viewer.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+ <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+ <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+ <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
+ <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+ <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
+ <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <Optimize>true</Optimize>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <CodeAnalysisLogFile>bin\Release\DBC Viewer.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+ <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+ <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+ <ErrorReport>prompt</ErrorReport>
+ <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+ <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
+ <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+ <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
+ <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
@@ -1,17 +1,24 @@
-
+using System;
+using System.Globalization;
+
namespace DBCViewer
{
- struct FilterOptions
+ class FilterOptions
{
- public string Col { get; set; }
- public string Val { get; set; }
- public ComparisonType Type { get; set; }
- public FilterOptions(string col, ComparisonType type, string val)
- : this()
+ public string Column { get; private set; }
+ public string Value { get; set; }
+ public ComparisonType CompType { get; private set; }
+
+ public FilterOptions(string col, ComparisonType ct, string val)
{
- Col = col;
- Val = val;
- Type = type;
+ Column = col;
+ Value = val;
+ CompType = ct;
+ }
+
+ public override string ToString()
+ {
+ return String.Format(CultureInfo.InvariantCulture, "{0} {1} {2}", Column, CompType, Value);
}
}
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -24,16 +24,16 @@ private bool Compare(DataRow row)
var matches = 0;
var checks = 0;
- foreach (var filter in m_filters.Values)
+ foreach (FilterOptions filter in listBox1.Items)
{
checks++;
- var type = row[filter.Col].GetType();
+ var type = row[filter.Column].GetType();
- var value1 = (IComparable)row[filter.Col];
- var value2 = (IComparable)Convert.ChangeType(filter.Val, type, CultureInfo.InvariantCulture);
+ var value1 = (IComparable)row[filter.Column];
+ var value2 = (IComparable)Convert.ChangeType(filter.Value, type, CultureInfo.InvariantCulture);
- switch (filter.Type)
+ switch (filter.CompType)
{
case ComparisonType.And:
if (And(type, filter, row))
@@ -81,8 +81,8 @@ private bool Compare(DataRow row)
private bool Equal(Type type, FilterOptions filter, DataRow row)
{
- var value1 = (IComparable)row[filter.Col];
- var value2 = (IComparable)Convert.ChangeType(filter.Val, type, CultureInfo.InvariantCulture);
+ var value1 = (IComparable)row[filter.Column];
+ var value2 = (IComparable)Convert.ChangeType(filter.Value, type, CultureInfo.InvariantCulture);
if (value1.CompareTo(value2) == 0)
return true;
@@ -92,8 +92,8 @@ private bool Equal(Type type, FilterOptions filter, DataRow row)
private bool NotEqual(Type type, FilterOptions filter, DataRow row)
{
- var value1 = (IComparable)row[filter.Col];
- var value2 = (IComparable)Convert.ChangeType(filter.Val, type, CultureInfo.InvariantCulture);
+ var value1 = (IComparable)row[filter.Column];
+ var value2 = (IComparable)Convert.ChangeType(filter.Value, type, CultureInfo.InvariantCulture);
if (value1.CompareTo(value2) != 0)
return true;
@@ -103,8 +103,8 @@ private bool NotEqual(Type type, FilterOptions filter, DataRow row)
private bool Less(Type type, FilterOptions filter, DataRow row)
{
- var value1 = (IComparable)row[filter.Col];
- var value2 = (IComparable)Convert.ChangeType(filter.Val, type, CultureInfo.InvariantCulture);
+ var value1 = (IComparable)row[filter.Column];
+ var value2 = (IComparable)Convert.ChangeType(filter.Value, type, CultureInfo.InvariantCulture);
if (value1.CompareTo(value2) < 0)
return true;
@@ -114,8 +114,8 @@ private bool Less(Type type, FilterOptions filter, DataRow row)
private bool Greater(Type type, FilterOptions filter, DataRow row)
{
- var value1 = (IComparable)row[filter.Col];
- var value2 = (IComparable)Convert.ChangeType(filter.Val, type, CultureInfo.InvariantCulture);
+ var value1 = (IComparable)row[filter.Column];
+ var value2 = (IComparable)Convert.ChangeType(filter.Value, type, CultureInfo.InvariantCulture);
if (value1.CompareTo(value2) > 0)
return true;
@@ -125,15 +125,15 @@ private bool Greater(Type type, FilterOptions filter, DataRow row)
private bool StartWith(FilterOptions filter, DataRow row)
{
- if (row.Field<string>(filter.Col).StartsWith(filter.Val, checkBox2.Checked ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal))
+ if (row.Field<string>(filter.Column).StartsWith(filter.Value, checkBox2.Checked ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal))
return true;
return false;
}
private bool EndsWith(FilterOptions filter, DataRow row)
{
- if (row.Field<string>(filter.Col).EndsWith(filter.Val, checkBox2.Checked ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal))
+ if (row.Field<string>(filter.Column).EndsWith(filter.Value, checkBox2.Checked ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal))
return true;
return false;
@@ -143,14 +143,14 @@ private bool Contains(FilterOptions filter, DataRow row)
{
if (checkBox2.Checked)
{
- if (row.Field<string>(filter.Col).ToUpperInvariant().Contains(filter.Val.ToUpperInvariant()))
+ if (row.Field<string>(filter.Column).ToUpperInvariant().Contains(filter.Value.ToUpperInvariant()))
return true;
return false;
}
else
{
- if (row.Field<string>(filter.Col).Contains(filter.Val))
+ if (row.Field<string>(filter.Column).Contains(filter.Value))
return true;
return false;
@@ -163,14 +163,14 @@ private bool And(Type type, FilterOptions filter, DataRow row)
if (typeCode == TypeCode.Byte || typeCode == TypeCode.UInt16 || typeCode == TypeCode.UInt32 || typeCode == TypeCode.UInt64)
{
- if (((ulong)Convert.ChangeType(row[filter.Col], typeof(ulong), CultureInfo.InvariantCulture) & Convert.ToUInt64(filter.Val, CultureInfo.InvariantCulture)) != 0)
+ if (((ulong)Convert.ChangeType(row[filter.Column], typeof(ulong), CultureInfo.InvariantCulture) & Convert.ToUInt64(filter.Value, CultureInfo.InvariantCulture)) != 0)
return true;
return false;
}
else if (typeCode == TypeCode.SByte || typeCode == TypeCode.Int16 || typeCode == TypeCode.Int32 || typeCode == TypeCode.Int64)
{
- if (((long)Convert.ChangeType(row[filter.Col], typeof(long), CultureInfo.InvariantCulture) & Convert.ToInt64(filter.Val, CultureInfo.InvariantCulture)) != 0)
+ if (((long)Convert.ChangeType(row[filter.Column], typeof(long), CultureInfo.InvariantCulture) & Convert.ToInt64(filter.Value, CultureInfo.InvariantCulture)) != 0)
return true;
return false;
@@ -185,14 +185,14 @@ private bool AndNot(Type type, FilterOptions filter, DataRow row)
if (typeCode == TypeCode.Byte || typeCode == TypeCode.UInt16 || typeCode == TypeCode.UInt32 || typeCode == TypeCode.UInt64)
{
- if (((ulong)Convert.ChangeType(row[filter.Col], typeof(ulong), CultureInfo.InvariantCulture) & Convert.ToUInt64(filter.Val, CultureInfo.InvariantCulture)) == 0)
+ if (((ulong)Convert.ChangeType(row[filter.Column], typeof(ulong), CultureInfo.InvariantCulture) & Convert.ToUInt64(filter.Value, CultureInfo.InvariantCulture)) == 0)
return true;
return false;
}
else if (typeCode == TypeCode.SByte || typeCode == TypeCode.Int16 || typeCode == TypeCode.Int32 || typeCode == TypeCode.Int64)
{
- if (((long)Convert.ChangeType(row[filter.Col], typeof(long), CultureInfo.InvariantCulture) & Convert.ToInt64(filter.Val, CultureInfo.InvariantCulture)) == 0)
+ if (((long)Convert.ChangeType(row[filter.Column], typeof(long), CultureInfo.InvariantCulture) & Convert.ToInt64(filter.Value, CultureInfo.InvariantCulture)) == 0)
return true;
return false;
Oops, something went wrong.

4 comments on commit 395db5f

An extremely useful utility. Thaks a lot

Faq replied May 13, 2012

@Zakamurite could u pls share compiled version of this tool?

Faq replied May 13, 2012

thnx

Please sign in to comment.