Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/Version_0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gallimathias committed Aug 14, 2016
2 parents 62a12c6 + 9fc87ac commit aaa6374
Show file tree
Hide file tree
Showing 27 changed files with 1,281 additions and 15 deletions.
17 changes: 17 additions & 0 deletions NoobBotDatabase/NoobBotDatabase.refactorlog
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Operations Version="1.0" xmlns="http://schemas.microsoft.com/sqlserver/dac/Serialization/2012/02">
<Operation Name="Rename Refactor" Key="d739c07a-77f4-4b21-b885-acf4ea56b6aa" ChangeDateTime="07/24/2016 18:07:33">
<Property Name="ElementName" Value="[dbo].[user].[Name]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[user]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="name" />
</Operation>
<Operation Name="Rename Refactor" Key="0c516f4d-440b-4f2d-848b-5b1b9ab25146" ChangeDateTime="07/24/2016 18:07:42">
<Property Name="ElementName" Value="[dbo].[user].[Id]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[user]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="id" />
</Operation>
</Operations>
119 changes: 119 additions & 0 deletions NoobBotDatabase/NoobBotDatabase.sqlproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Name>NoobBotDatabase</Name>
<SchemaVersion>2.0</SchemaVersion>
<ProjectVersion>4.1</ProjectVersion>
<ProjectGuid>{5fb2b3c8-5b8c-451e-b762-e0aa9c589005}</ProjectGuid>
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql130DatabaseSchemaProvider</DSP>
<OutputType>Database</OutputType>
<RootPath>
</RootPath>
<RootNamespace>NoobBotDatabase</RootNamespace>
<AssemblyName>NoobBotDatabase</AssemblyName>
<ModelCollation>1033, CI</ModelCollation>
<DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
<DeployToDatabase>True</DeployToDatabase>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetLanguage>CS</TargetLanguage>
<AppDesignerFolder>Properties</AppDesignerFolder>
<SqlServerVerification>False</SqlServerVerification>
<IncludeCompositeObjects>True</IncludeCompositeObjects>
<TargetDatabaseSet>True</TargetDatabaseSet>
<GenerateCreateScript>True</GenerateCreateScript>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
<!-- Default to the v11.0 targets path if the targets file for the current VS version is not found -->
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>bin\Release\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<OutputPath>bin\Debug\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\Release\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\Debug\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<ItemGroup>
<Folder Include="Properties" />
</ItemGroup>
<ItemGroup>
<Build Include="user.sql" />
<Build Include="streams.sql" />
</ItemGroup>
<ItemGroup>
<RefactorLog Include="NoobBotDatabase.refactorlog" />
</ItemGroup>
</Project>
10 changes: 10 additions & 0 deletions NoobBotDatabase/streams.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE [dbo].[streams]
(
[id] INT IDENTITY (1, 1) NOT NULL,
[userId] INT not null,
[start] DateTime NOT NULL,
[title] text NOT NULL,
[url] text
CONSTRAINT [PK_streams] PRIMARY KEY ([id]) NULL,
FOREIGN KEY ([userId]) REFERENCES [dbo].[user] ([id])
)
7 changes: 7 additions & 0 deletions NoobBotDatabase/user.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE [dbo].[user]
(
[id] INT NOT NULL PRIMARY KEY,
[streamer] BIT NULL DEFAULT 0,
[name] TEXT NULL
)

Binary file added NoobDevBot(Stream)/libmp3lame.32.dll
Binary file not shown.
Binary file added NoobDevBot(Stream)/libmp3lame.64.dll
Binary file not shown.
38 changes: 32 additions & 6 deletions NoobDevBot.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,50 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NoobDevBot(Stream)", "NoobDevBot(Stream)\NoobDevBot(Stream).csproj", "{27A6E8B1-F7C7-4CB7-AE69-E240ED7D9971}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NoobDevBot", "NoobDevBot\NoobDevBot.csproj", "{8CD55321-6BE8-4958-864F-64749D0008A5}"
EndProject
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "NoobBotDatabase", "NoobBotDatabase\NoobBotDatabase.sqlproj", "{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{27A6E8B1-F7C7-4CB7-AE69-E240ED7D9971}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{27A6E8B1-F7C7-4CB7-AE69-E240ED7D9971}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27A6E8B1-F7C7-4CB7-AE69-E240ED7D9971}.Release|Any CPU.ActiveCfg = Release|Any CPU
{27A6E8B1-F7C7-4CB7-AE69-E240ED7D9971}.Release|Any CPU.Build.0 = Release|Any CPU
{8CD55321-6BE8-4958-864F-64749D0008A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8CD55321-6BE8-4958-864F-64749D0008A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8CD55321-6BE8-4958-864F-64749D0008A5}.Debug|x64.ActiveCfg = Debug|Any CPU
{8CD55321-6BE8-4958-864F-64749D0008A5}.Debug|x64.Build.0 = Debug|Any CPU
{8CD55321-6BE8-4958-864F-64749D0008A5}.Debug|x86.ActiveCfg = Debug|Any CPU
{8CD55321-6BE8-4958-864F-64749D0008A5}.Debug|x86.Build.0 = Debug|Any CPU
{8CD55321-6BE8-4958-864F-64749D0008A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8CD55321-6BE8-4958-864F-64749D0008A5}.Release|Any CPU.Build.0 = Release|Any CPU
{8CD55321-6BE8-4958-864F-64749D0008A5}.Release|x64.ActiveCfg = Release|Any CPU
{8CD55321-6BE8-4958-864F-64749D0008A5}.Release|x64.Build.0 = Release|Any CPU
{8CD55321-6BE8-4958-864F-64749D0008A5}.Release|x86.ActiveCfg = Release|Any CPU
{8CD55321-6BE8-4958-864F-64749D0008A5}.Release|x86.Build.0 = Release|Any CPU
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Debug|x64.ActiveCfg = Debug|x64
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Debug|x64.Build.0 = Debug|x64
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Debug|x64.Deploy.0 = Debug|x64
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Debug|x86.ActiveCfg = Debug|x86
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Debug|x86.Build.0 = Debug|x86
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Debug|x86.Deploy.0 = Debug|x86
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Release|Any CPU.Build.0 = Release|Any CPU
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Release|Any CPU.Deploy.0 = Release|Any CPU
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Release|x64.ActiveCfg = Release|x64
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Release|x64.Build.0 = Release|x64
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Release|x64.Deploy.0 = Release|x64
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Release|x86.ActiveCfg = Release|x64
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Release|x86.Build.0 = Release|x64
{5FB2B3C8-5B8C-451E-B762-E0AA9C589005}.Release|x86.Deploy.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
32 changes: 29 additions & 3 deletions NoobDevBot/App.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="NoobDevBot.Properties.Settings.NoobBotDatabaseConnectionString"
connectionString="Data Source=localhost;Initial Catalog=NoobBotDatabase;Integrated Security=True;Encrypt=False;TrustServerCertificate=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
Expand All @@ -11,4 +20,21 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v13.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
</system.data>
</configuration>
40 changes: 40 additions & 0 deletions NoobDevBot/CommandHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NoobDevBot
{
public class CommandHandler<TIn, TOut>
{
private Dictionary<string, Func<TIn, TOut>> mainDictionary;

public CommandHandler()
{
mainDictionary = new Dictionary<string, Func<TIn, TOut>>();
}

public Func<TIn, TOut> this[string commandName]
{
get
{
Func<TIn, TOut> value;
mainDictionary.TryGetValue(commandName, out value);
return value;
}
set
{
if (mainDictionary.ContainsKey(commandName))
mainDictionary[commandName] = value;
else
mainDictionary.Add(commandName, value);

}
}

public TOut Dispatch(string commandName, TIn parameter) => mainDictionary[commandName](parameter);

public bool CommandExists(string commandName) => mainDictionary.ContainsKey(commandName);
}
}
Loading

0 comments on commit aaa6374

Please sign in to comment.