Import TechBot

svn path=/trunk/; revision=13064
This commit is contained in:
Casper Hornstrup 2005-01-15 19:27:25 +00:00
parent 568b27baeb
commit 9dab4509fa
94 changed files with 24386 additions and 0 deletions

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="IRCServerHostName" value="irc.eu.freenode.net" />
<add key="IRCServerHostPort" value="6667" />
<add key="IRCChannelName" value="channel" />
<add key="IRCBotName" value="MyBot" />
<add key="ChmPath" value="C:\IRC\TechBot\CHM" />
<add key="MainChm" value="kmarch.chm" />
<add key="NtstatusXml" value="C:\IRC\TechBot\ntstatus.xml" />
<add key="WinerrorXml" value="C:\IRC\TechBot\winerror.xml" />
<add key="HresultXml" value="C:\IRC\TechBot\hresult.xml" />
<add key="SvnCommand" value="svn co svn://svn.reactos.com/trunk/reactos" />
</appSettings>
</configuration>

View file

@ -0,0 +1,32 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]
// The following attributes specify the key for the sign of your assembly. See the
// .NET Framework documentation for more information about signing.
// This is not required, if you don't want signing let these attributes like they're.
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]

View file

@ -0,0 +1,23 @@
<?xml version="1.0"?>
<project name="TechBot.Console" default="build">
<property name="output.dir" value="..\bin" />
<target name="build" description="Build component">
<mkdir dir="${output.dir}" />
<csc target="exe"
output="${output.dir}\TechBot.Console.exe"
optimize="true"
debug="true"
doc="${output.dir}\TechBot.Console.xml"
warninglevel="0">
<sources>
<include name="*.cs" />
</sources>
<references>
<include name="${output.dir}\TechBot.Library.dll" />
</references>
</csc>
</target>
</project>

View file

@ -0,0 +1,187 @@
using System;
using System.Configuration;
using TechBot.Library;
namespace TechBot.Console
{
public class ConsoleServiceOutput : IServiceOutput
{
public void WriteLine(string message)
{
System.Console.WriteLine(message);
}
}
class MainClass
{
private static void VerifyRequiredOption(string optionName,
string optionValue)
{
if (optionValue == null)
{
throw new Exception(String.Format("Option '{0}' not set.",
optionName));
}
}
private static string IRCServerHostName
{
get
{
string optionName = "IRCServerHostName";
string s = ConfigurationSettings.AppSettings[optionName];
VerifyRequiredOption(optionName,
s);
return s;
}
}
private static int IRCServerHostPort
{
get
{
string optionName = "IRCServerHostPort";
string s = ConfigurationSettings.AppSettings[optionName];
VerifyRequiredOption(optionName,
s);
return Int32.Parse(s);
}
}
private static string IRCChannelName
{
get
{
string optionName = "IRCChannelName";
string s = ConfigurationSettings.AppSettings[optionName];
VerifyRequiredOption(optionName,
s);
return s;
}
}
private static string IRCBotName
{
get
{
string optionName = "IRCBotName";
string s = ConfigurationSettings.AppSettings[optionName];
VerifyRequiredOption(optionName,
s);
return s;
}
}
private static string ChmPath
{
get
{
string optionName = "ChmPath";
string s = ConfigurationSettings.AppSettings[optionName];
VerifyRequiredOption(optionName,
s);
return s;
}
}
private static string MainChm
{
get
{
string optionName = "MainChm";
string s = ConfigurationSettings.AppSettings[optionName];
VerifyRequiredOption(optionName,
s);
return s;
}
}
private static string NtstatusXml
{
get
{
string optionName = "NtstatusXml";
string s = ConfigurationSettings.AppSettings[optionName];
VerifyRequiredOption(optionName,
s);
return s;
}
}
private static string WinerrorXml
{
get
{
string optionName = "WinerrorXml";
string s = ConfigurationSettings.AppSettings[optionName];
VerifyRequiredOption(optionName,
s);
return s;
}
}
private static string HresultXml
{
get
{
string optionName = "HresultXml";
string s = ConfigurationSettings.AppSettings[optionName];
VerifyRequiredOption(optionName,
s);
return s;
}
}
private static string SvnCommand
{
get
{
string optionName = "SvnCommand";
string s = ConfigurationSettings.AppSettings[optionName];
VerifyRequiredOption(optionName,
s);
return s;
}
}
private static void RunIrcService()
{
IrcService ircService = new IrcService(IRCServerHostName,
IRCServerHostPort,
IRCChannelName,
IRCBotName,
ChmPath,
MainChm,
NtstatusXml,
WinerrorXml,
HresultXml,
SvnCommand);
ircService.Run();
}
public static void Main(string[] args)
{
if (args.Length > 0 && args[0].ToLower().Equals("irc"))
{
RunIrcService();
return;
}
System.Console.WriteLine("TechBot running console service...");
TechBotService service = new TechBotService(new ConsoleServiceOutput(),
ChmPath,
MainChm,
NtstatusXml,
WinerrorXml,
HresultXml,
SvnCommand);
service.Run();
while (true)
{
string s = System.Console.ReadLine();
service.InjectMessage(s);
}
}
}
}

View file

@ -0,0 +1,16 @@
<Combine fileversion="1.0" name="TechBot.Console" description="">
<StartMode startupentry="TechBot.Console" single="True">
<Execute entry="TechBot.Console" type="None" />
</StartMode>
<Entries>
<Entry filename=".\.\TechBot.Console.prjx" />
</Entries>
<Configurations active="Debug">
<Configuration name="Release">
<Entry name="TechBot.Console" configurationname="Debug" build="False" />
</Configuration>
<Configuration name="Debug">
<Entry name="TechBot.Console" configurationname="Debug" build="False" />
</Configuration>
</Configurations>
</Combine>

View file

@ -0,0 +1,29 @@
<Project name="TechBot.Console" standardNamespace="TechBot.Console" description="" newfilesearch="None" enableviewstate="True" version="1.1" projecttype="C#">
<Contents>
<File name=".\Main.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\AssemblyInfo.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Default.build" subtype="Code" buildaction="Nothing" dependson="" data="" />
<File name=".\App.config" subtype="Code" buildaction="Nothing" dependson="" data="" />
</Contents>
<References>
<Reference type="Project" refto="TechBot.Library" localcopy="True" />
</References>
<DeploymentInformation target="" script="" strategy="File" />
<Configuration runwithwarnings="True" name="Debug">
<CodeGeneration runtime="MsNet" compiler="Csc" compilerversion="" warninglevel="4" nowarn="" includedebuginformation="True" optimize="False" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Exe" definesymbols="" generatexmldocumentation="False" win32Icon="" noconfig="False" nostdlib="False" />
<Execution commandlineparameters="" consolepause="True" />
<Output directory="..\bin\Debug" assembly="TechBot.Console" executeScript="" executeBeforeBuild="" executeAfterBuild="" executeBeforeBuildArguments="" executeAfterBuildArguments="" />
</Configuration>
<Configurations active="Debug">
<Configuration runwithwarnings="True" name="Debug">
<CodeGeneration runtime="MsNet" compiler="Csc" compilerversion="" warninglevel="4" nowarn="" includedebuginformation="True" optimize="False" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Exe" definesymbols="" generatexmldocumentation="False" win32Icon="" noconfig="False" nostdlib="False" />
<Execution commandlineparameters="" consolepause="True" />
<Output directory="..\bin\Debug" assembly="TechBot.Console" executeScript="" executeBeforeBuild="" executeAfterBuild="" executeBeforeBuildArguments="" executeAfterBuildArguments="" />
</Configuration>
<Configuration runwithwarnings="True" name="Release">
<CodeGeneration runtime="MsNet" compiler="Csc" compilerversion="" warninglevel="4" nowarn="" includedebuginformation="False" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" mainclass="" target="Exe" definesymbols="" generatexmldocumentation="False" win32Icon="" noconfig="False" nostdlib="False" />
<Execution commandlineparameters="" consolepause="True" />
<Output directory="..\bin\Release" assembly="TechBot.Console" executeScript="" executeBeforeBuild="" executeAfterBuild="" executeBeforeBuildArguments="" executeAfterBuildArguments="" />
</Configuration>
</Configurations>
</Project>