Initial add of three projects
This commit is contained in:
BIN
.vs/TrainingAdvancedTechniques/v16/.suo
Normal file
BIN
.vs/TrainingAdvancedTechniques/v16/.suo
Normal file
Binary file not shown.
6
BooksLambda/App.config
Normal file
6
BooksLambda/App.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
53
BooksLambda/BooksLambda.csproj
Normal file
53
BooksLambda/BooksLambda.csproj
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<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>
|
||||||
|
<ProjectGuid>{D7C73E43-0BD2-4EC5-B6B1-2106EDE4BE41}</ProjectGuid>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<RootNamespace>BooksLambda</RootNamespace>
|
||||||
|
<AssemblyName>BooksLambda</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
47
BooksLambda/Program.cs
Normal file
47
BooksLambda/Program.cs
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BooksLambda
|
||||||
|
{
|
||||||
|
public class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
var books = new BookRepository().GetBooks();
|
||||||
|
//var cheapBooks = books.FindAll(IsCheaperThan10Dollars);
|
||||||
|
var cheapBooks = books.FindAll(b => b.Price<10);
|
||||||
|
|
||||||
|
foreach (var book in cheapBooks)
|
||||||
|
{
|
||||||
|
Console.WriteLine(book.Title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//static bool IsCheaperThan10Dollars(Book book)
|
||||||
|
//{
|
||||||
|
// return book.Price < 10;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BookRepository
|
||||||
|
{
|
||||||
|
public List<Book> GetBooks()
|
||||||
|
{
|
||||||
|
return new List<Book>
|
||||||
|
{
|
||||||
|
new Book(){Title="Title 1", Price=5.25m},
|
||||||
|
new Book(){Title="Title 2", Price=9.25m},
|
||||||
|
new Book(){Title="Title 3", Price=10.75m}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Book
|
||||||
|
{
|
||||||
|
public string Title { get; set; }
|
||||||
|
public decimal Price { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
36
BooksLambda/Properties/AssemblyInfo.cs
Normal file
36
BooksLambda/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("BooksLambda")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("BooksLambda")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("d7c73e43-0bd2-4ec5-b6b1-2106ede4be41")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
BIN
BooksLambda/bin/Debug/BooksLambda.exe
Normal file
BIN
BooksLambda/bin/Debug/BooksLambda.exe
Normal file
Binary file not shown.
6
BooksLambda/bin/Debug/BooksLambda.exe.config
Normal file
6
BooksLambda/bin/Debug/BooksLambda.exe.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
BIN
BooksLambda/bin/Debug/BooksLambda.pdb
Normal file
BIN
BooksLambda/bin/Debug/BooksLambda.pdb
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
776a4596f18f18d5b55dda90c4584f71b9d5b430
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\BooksLambda\bin\Debug\BooksLambda.exe.config
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\BooksLambda\bin\Debug\BooksLambda.exe
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\BooksLambda\bin\Debug\BooksLambda.pdb
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\BooksLambda\obj\Debug\BooksLambda.csprojAssemblyReference.cache
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\BooksLambda\obj\Debug\BooksLambda.csproj.CoreCompileInputs.cache
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\BooksLambda\obj\Debug\BooksLambda.exe
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\BooksLambda\obj\Debug\BooksLambda.pdb
|
||||||
BIN
BooksLambda/obj/Debug/BooksLambda.csprojAssemblyReference.cache
Normal file
BIN
BooksLambda/obj/Debug/BooksLambda.csprojAssemblyReference.cache
Normal file
Binary file not shown.
BIN
BooksLambda/obj/Debug/BooksLambda.exe
Normal file
BIN
BooksLambda/obj/Debug/BooksLambda.exe
Normal file
Binary file not shown.
BIN
BooksLambda/obj/Debug/BooksLambda.pdb
Normal file
BIN
BooksLambda/obj/Debug/BooksLambda.pdb
Normal file
Binary file not shown.
Binary file not shown.
37
TrainingAdvancedTechniques.sln
Normal file
37
TrainingAdvancedTechniques.sln
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 16
|
||||||
|
VisualStudioVersion = 16.0.28407.52
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TrainingAdvancedTechniques", "TrainingAdvancedTechniques\TrainingAdvancedTechniques.csproj", "{6F3F478D-7B6D-4DD5-8DE7-EBE805263D51}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BooksLambda", "BooksLambda\BooksLambda.csproj", "{D7C73E43-0BD2-4EC5-B6B1-2106EDE4BE41}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoEnc", "VideoEnc\VideoEnc.csproj", "{8B61AEAF-981F-4509-A550-2DA29838DF66}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{6F3F478D-7B6D-4DD5-8DE7-EBE805263D51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{6F3F478D-7B6D-4DD5-8DE7-EBE805263D51}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{6F3F478D-7B6D-4DD5-8DE7-EBE805263D51}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{6F3F478D-7B6D-4DD5-8DE7-EBE805263D51}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{D7C73E43-0BD2-4EC5-B6B1-2106EDE4BE41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{D7C73E43-0BD2-4EC5-B6B1-2106EDE4BE41}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{D7C73E43-0BD2-4EC5-B6B1-2106EDE4BE41}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{D7C73E43-0BD2-4EC5-B6B1-2106EDE4BE41}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{8B61AEAF-981F-4509-A550-2DA29838DF66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{8B61AEAF-981F-4509-A550-2DA29838DF66}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{8B61AEAF-981F-4509-A550-2DA29838DF66}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{8B61AEAF-981F-4509-A550-2DA29838DF66}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {67103D05-055E-4189-BCE3-9359929D71BB}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
6
TrainingAdvancedTechniques/App.config
Normal file
6
TrainingAdvancedTechniques/App.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
35
TrainingAdvancedTechniques/Program.cs
Normal file
35
TrainingAdvancedTechniques/Program.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace TrainingAdvancedTechniques
|
||||||
|
{
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
//args => expression
|
||||||
|
//number => number*number
|
||||||
|
|
||||||
|
//() => ...
|
||||||
|
// x => ...
|
||||||
|
// (x, y, z) => ...
|
||||||
|
|
||||||
|
Func<int,int> square = number => number * number;
|
||||||
|
Console.WriteLine(square(5));
|
||||||
|
|
||||||
|
const int factor = 5;
|
||||||
|
Func<int, int> multiplyer = n => n * factor;
|
||||||
|
|
||||||
|
var result = multiplyer(10);
|
||||||
|
Console.WriteLine(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
//static int Square(int number)
|
||||||
|
//{
|
||||||
|
// return number * number;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
TrainingAdvancedTechniques/Properties/AssemblyInfo.cs
Normal file
36
TrainingAdvancedTechniques/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("TrainingAdvancedTechniques")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("TrainingAdvancedTechniques")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("6f3f478d-7b6d-4dd5-8de7-ebe805263d51")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
53
TrainingAdvancedTechniques/TrainingAdvancedTechniques.csproj
Normal file
53
TrainingAdvancedTechniques/TrainingAdvancedTechniques.csproj
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<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>
|
||||||
|
<ProjectGuid>{6F3F478D-7B6D-4DD5-8DE7-EBE805263D51}</ProjectGuid>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<RootNamespace>TrainingAdvancedTechniques</RootNamespace>
|
||||||
|
<AssemblyName>TrainingAdvancedTechniques</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
Binary file not shown.
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
776a4596f18f18d5b55dda90c4584f71b9d5b430
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\TrainingAdvancedTechniques\bin\Debug\TrainingAdvancedTechniques.exe.config
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\TrainingAdvancedTechniques\bin\Debug\TrainingAdvancedTechniques.exe
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\TrainingAdvancedTechniques\bin\Debug\TrainingAdvancedTechniques.pdb
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\TrainingAdvancedTechniques\obj\Debug\TrainingAdvancedTechniques.csprojAssemblyReference.cache
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\TrainingAdvancedTechniques\obj\Debug\TrainingAdvancedTechniques.csproj.CoreCompileInputs.cache
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\TrainingAdvancedTechniques\obj\Debug\TrainingAdvancedTechniques.exe
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\TrainingAdvancedTechniques\obj\Debug\TrainingAdvancedTechniques.pdb
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
6
VideoEnc/App.config
Normal file
6
VideoEnc/App.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
12
VideoEnc/MailService.cs
Normal file
12
VideoEnc/MailService.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace VideoEnc
|
||||||
|
{
|
||||||
|
public class MailService
|
||||||
|
{
|
||||||
|
public void OnVideoEncoded(object source, VideoEventArgs e)
|
||||||
|
{
|
||||||
|
Console.WriteLine("MailService: Sending an email..."+e.Video.Title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
VideoEnc/MessageService.cs
Normal file
12
VideoEnc/MessageService.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace VideoEnc
|
||||||
|
{
|
||||||
|
public class MessageService
|
||||||
|
{
|
||||||
|
public void OnVideoEncoded(object source, VideoEventArgs e)
|
||||||
|
{
|
||||||
|
Console.WriteLine("MessageService: Sending a text message..."+e.Video.Title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
24
VideoEnc/Program.cs
Normal file
24
VideoEnc/Program.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace VideoEnc
|
||||||
|
{
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
var video = new Video() { Title = "Video 1" };
|
||||||
|
var videoEncoder = new VideoEncoder(); //publisher
|
||||||
|
var mailService = new MailService(); //subscriber
|
||||||
|
var messageService = new MessageService(); //subscriber
|
||||||
|
|
||||||
|
videoEncoder.VideoEncoded += mailService.OnVideoEncoded;
|
||||||
|
videoEncoder.VideoEncoded += messageService.OnVideoEncoded;
|
||||||
|
|
||||||
|
videoEncoder.Encode(video);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
36
VideoEnc/Properties/AssemblyInfo.cs
Normal file
36
VideoEnc/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("VideoEnc")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("VideoEnc")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("8b61aeaf-981f-4509-a550-2da29838df66")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
13
VideoEnc/Video.cs
Normal file
13
VideoEnc/Video.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace VideoEnc
|
||||||
|
{
|
||||||
|
public class Video
|
||||||
|
{
|
||||||
|
public string Title { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
57
VideoEnc/VideoEnc.csproj
Normal file
57
VideoEnc/VideoEnc.csproj
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<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>
|
||||||
|
<ProjectGuid>{8B61AEAF-981F-4509-A550-2DA29838DF66}</ProjectGuid>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<RootNamespace>VideoEnc</RootNamespace>
|
||||||
|
<AssemblyName>VideoEnc</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="MailService.cs" />
|
||||||
|
<Compile Include="MessageService.cs" />
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Video.cs" />
|
||||||
|
<Compile Include="VideoEncoder.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
38
VideoEnc/VideoEncoder.cs
Normal file
38
VideoEnc/VideoEncoder.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace VideoEnc
|
||||||
|
{
|
||||||
|
public class VideoEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public Video Video { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class VideoEncoder
|
||||||
|
{
|
||||||
|
// 1- Define a delegate
|
||||||
|
// 2- Define an Event
|
||||||
|
// 3 Raise the event
|
||||||
|
|
||||||
|
public delegate void VideoEncodedEventHandler(object source, VideoEventArgs args);
|
||||||
|
public event VideoEncodedEventHandler VideoEncoded;
|
||||||
|
|
||||||
|
public void Encode(Video video)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Encoding video...");
|
||||||
|
Thread.Sleep(3000);
|
||||||
|
|
||||||
|
OnVideoEncoded(video);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnVideoEncoded(Video video)
|
||||||
|
{
|
||||||
|
if (VideoEncoded != null)
|
||||||
|
VideoEncoded(this, new VideoEventArgs() { Video =video });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
VideoEnc/bin/Debug/VideoEnc.exe
Normal file
BIN
VideoEnc/bin/Debug/VideoEnc.exe
Normal file
Binary file not shown.
6
VideoEnc/bin/Debug/VideoEnc.exe.config
Normal file
6
VideoEnc/bin/Debug/VideoEnc.exe.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
BIN
VideoEnc/bin/Debug/VideoEnc.pdb
Normal file
BIN
VideoEnc/bin/Debug/VideoEnc.pdb
Normal file
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
6ca44b11e984b22a307d84830ebf5d6145c71a6d
|
||||||
7
VideoEnc/obj/Debug/VideoEnc.csproj.FileListAbsolute.txt
Normal file
7
VideoEnc/obj/Debug/VideoEnc.csproj.FileListAbsolute.txt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\VideoEnc\bin\Debug\VideoEnc.exe.config
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\VideoEnc\bin\Debug\VideoEnc.exe
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\VideoEnc\bin\Debug\VideoEnc.pdb
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\VideoEnc\obj\Debug\VideoEnc.csproj.CoreCompileInputs.cache
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\VideoEnc\obj\Debug\VideoEnc.exe
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\VideoEnc\obj\Debug\VideoEnc.pdb
|
||||||
|
C:\Users\tommy\Source\Repos\TrainingAdvancedTechniques\VideoEnc\obj\Debug\VideoEnc.csprojAssemblyReference.cache
|
||||||
BIN
VideoEnc/obj/Debug/VideoEnc.csprojAssemblyReference.cache
Normal file
BIN
VideoEnc/obj/Debug/VideoEnc.csprojAssemblyReference.cache
Normal file
Binary file not shown.
BIN
VideoEnc/obj/Debug/VideoEnc.exe
Normal file
BIN
VideoEnc/obj/Debug/VideoEnc.exe
Normal file
Binary file not shown.
BIN
VideoEnc/obj/Debug/VideoEnc.pdb
Normal file
BIN
VideoEnc/obj/Debug/VideoEnc.pdb
Normal file
Binary file not shown.
Reference in New Issue
Block a user