Skip to content

Commit 7d21e42

Browse files
committed
Adding source code
1 parent c145850 commit 7d21e42

13 files changed

+831
-0
lines changed

CSMDevHelper.sln

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual Studio 2010
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSMDevHelper", "CSMDevHelper\CSMDevHelper.csproj", "{19ED354E-3B36-4ED1-9686-9952D040C50B}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|x86 = Debug|x86
9+
Release|x86 = Release|x86
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{19ED354E-3B36-4ED1-9686-9952D040C50B}.Debug|x86.ActiveCfg = Debug|x86
13+
{19ED354E-3B36-4ED1-9686-9952D040C50B}.Debug|x86.Build.0 = Debug|x86
14+
{19ED354E-3B36-4ED1-9686-9952D040C50B}.Release|x86.ActiveCfg = Release|x86
15+
{19ED354E-3B36-4ED1-9686-9952D040C50B}.Release|x86.Build.0 = Release|x86
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
EndGlobal

CSMDevHelper/CSMDevHelper.csproj

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6+
<ProductVersion>8.0.30703</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{19ED354E-3B36-4ED1-9686-9952D040C50B}</ProjectGuid>
9+
<OutputType>WinExe</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>CSMDevHelper</RootNamespace>
12+
<AssemblyName>CSMDevHelper</AssemblyName>
13+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
14+
<TargetFrameworkProfile>
15+
</TargetFrameworkProfile>
16+
<FileAlignment>512</FileAlignment>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
19+
<PlatformTarget>x86</PlatformTarget>
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>bin\Debug\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
29+
<PlatformTarget>x86</PlatformTarget>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<ItemGroup>
38+
<Reference Include="System" />
39+
<Reference Include="System.Core" />
40+
<Reference Include="System.Xml.Linq" />
41+
<Reference Include="System.Data.DataSetExtensions" />
42+
<Reference Include="Microsoft.CSharp" />
43+
<Reference Include="System.Data" />
44+
<Reference Include="System.Deployment" />
45+
<Reference Include="System.Drawing" />
46+
<Reference Include="System.Windows.Forms" />
47+
<Reference Include="System.Web.Extensions" />
48+
<Reference Include="System.Xml" />
49+
</ItemGroup>
50+
<ItemGroup>
51+
<Compile Include="LogReader.cs" />
52+
<Compile Include="frmCSMDH.cs">
53+
<SubType>Form</SubType>
54+
</Compile>
55+
<Compile Include="frmCSMDH.Designer.cs">
56+
<DependentUpon>frmCSMDH.cs</DependentUpon>
57+
</Compile>
58+
<Compile Include="Program.cs" />
59+
<Compile Include="Properties\AssemblyInfo.cs" />
60+
<EmbeddedResource Include="frmCSMDH.resx">
61+
<DependentUpon>frmCSMDH.cs</DependentUpon>
62+
</EmbeddedResource>
63+
<EmbeddedResource Include="Properties\Resources.resx">
64+
<Generator>ResXFileCodeGenerator</Generator>
65+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
66+
<SubType>Designer</SubType>
67+
</EmbeddedResource>
68+
<Compile Include="Properties\Resources.Designer.cs">
69+
<AutoGen>True</AutoGen>
70+
<DependentUpon>Resources.resx</DependentUpon>
71+
<DesignTime>True</DesignTime>
72+
</Compile>
73+
<None Include="app.config" />
74+
<None Include="Properties\Settings.settings">
75+
<Generator>SettingsSingleFileGenerator</Generator>
76+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
77+
</None>
78+
<Compile Include="Properties\Settings.Designer.cs">
79+
<AutoGen>True</AutoGen>
80+
<DependentUpon>Settings.settings</DependentUpon>
81+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
82+
</Compile>
83+
</ItemGroup>
84+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
85+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
86+
Other similar extension points exist, see Microsoft.Common.targets.
87+
<Target Name="BeforeBuild">
88+
</Target>
89+
<Target Name="AfterBuild">
90+
</Target>
91+
-->
92+
</Project>

CSMDevHelper/LogReader.cs

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.IO;
6+
using System.Text.RegularExpressions;
7+
8+
namespace CSMDevHelper
9+
{
10+
class LogReader
11+
{
12+
private FileStream m_fileStream;
13+
private StreamReader m_streamReader;
14+
private static string logPattern = @"
15+
(?ix)
16+
(?<DATE>\\d{2}/\\d{2}/\\d{4})\\s+
17+
(?<TIME>\\d{1,2}:\\d{1,2}:\\d{1,2}\\s(PM|AM))\\s+
18+
(?<UNK1>\\d+)\\s+
19+
(?<UNK2>\\w+)\\s+
20+
:\\s+Lay7Dec\\|
21+
(?<MESSAGE>.*)";
22+
23+
public LogReader(string filename)
24+
{
25+
m_fileStream = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete);
26+
m_streamReader = new StreamReader(m_fileStream);
27+
}
28+
29+
~LogReader() { }
30+
31+
public string Process()
32+
{
33+
string result;
34+
result = m_streamReader.ReadLine();
35+
if (result != null)
36+
{
37+
Match logMatch = Regex.Match(result, logPattern);
38+
if (logMatch.Success)
39+
{
40+
result = logMatch.Groups["MESSAGE"].Value;
41+
}
42+
else
43+
{
44+
result = "";
45+
}
46+
}
47+
return result;
48+
}
49+
}
50+
}

CSMDevHelper/Program.cs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Windows.Forms;
5+
6+
namespace CSMDevHelper
7+
{
8+
static class Program
9+
{
10+
/// <summary>
11+
/// The main entry point for the application.
12+
/// </summary>
13+
[STAThread]
14+
static void Main()
15+
{
16+
Application.EnableVisualStyles();
17+
Application.SetCompatibleTextRenderingDefault(false);
18+
Application.Run(new frmCSMDH());
19+
}
20+
}
21+
}
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("CSMDevHelper")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("CSMDevHelper")]
13+
[assembly: AssemblyCopyright("Copyright © 2012")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("b19069fa-fa35-4bf0-8c97-1cb12162766e")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

CSMDevHelper/Properties/Resources.Designer.cs

+63
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)