This repository has been archived by the owner on Jan 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,281 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
Oops, something went wrong.