commit c638f0cf2d17ad58f935da3495c1f8c2ad05fcf8 Author: Tommy Öman Date: Fri Jan 4 00:04:44 2019 +0100 Initial add of three projects diff --git a/.vs/TrainingAdvancedTechniques/v16/.suo b/.vs/TrainingAdvancedTechniques/v16/.suo new file mode 100644 index 0000000..11ca012 Binary files /dev/null and b/.vs/TrainingAdvancedTechniques/v16/.suo differ diff --git a/BooksLambda/App.config b/BooksLambda/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/BooksLambda/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/BooksLambda/BooksLambda.csproj b/BooksLambda/BooksLambda.csproj new file mode 100644 index 0000000..b5af9d9 --- /dev/null +++ b/BooksLambda/BooksLambda.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {D7C73E43-0BD2-4EC5-B6B1-2106EDE4BE41} + Exe + BooksLambda + BooksLambda + v4.6.1 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BooksLambda/Program.cs b/BooksLambda/Program.cs new file mode 100644 index 0000000..179e130 --- /dev/null +++ b/BooksLambda/Program.cs @@ -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 GetBooks() + { + return new List + { + 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; } + } +} diff --git a/BooksLambda/Properties/AssemblyInfo.cs b/BooksLambda/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7516727 --- /dev/null +++ b/BooksLambda/Properties/AssemblyInfo.cs @@ -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")] diff --git a/BooksLambda/bin/Debug/BooksLambda.exe b/BooksLambda/bin/Debug/BooksLambda.exe new file mode 100644 index 0000000..cadddc2 Binary files /dev/null and b/BooksLambda/bin/Debug/BooksLambda.exe differ diff --git a/BooksLambda/bin/Debug/BooksLambda.exe.config b/BooksLambda/bin/Debug/BooksLambda.exe.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/BooksLambda/bin/Debug/BooksLambda.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/BooksLambda/bin/Debug/BooksLambda.pdb b/BooksLambda/bin/Debug/BooksLambda.pdb new file mode 100644 index 0000000..f6f495e Binary files /dev/null and b/BooksLambda/bin/Debug/BooksLambda.pdb differ diff --git a/BooksLambda/obj/Debug/BooksLambda.csproj.CoreCompileInputs.cache b/BooksLambda/obj/Debug/BooksLambda.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..536ac4e --- /dev/null +++ b/BooksLambda/obj/Debug/BooksLambda.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +776a4596f18f18d5b55dda90c4584f71b9d5b430 diff --git a/BooksLambda/obj/Debug/BooksLambda.csproj.FileListAbsolute.txt b/BooksLambda/obj/Debug/BooksLambda.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..463db56 --- /dev/null +++ b/BooksLambda/obj/Debug/BooksLambda.csproj.FileListAbsolute.txt @@ -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 diff --git a/BooksLambda/obj/Debug/BooksLambda.csprojAssemblyReference.cache b/BooksLambda/obj/Debug/BooksLambda.csprojAssemblyReference.cache new file mode 100644 index 0000000..cbe43f5 Binary files /dev/null and b/BooksLambda/obj/Debug/BooksLambda.csprojAssemblyReference.cache differ diff --git a/BooksLambda/obj/Debug/BooksLambda.exe b/BooksLambda/obj/Debug/BooksLambda.exe new file mode 100644 index 0000000..cadddc2 Binary files /dev/null and b/BooksLambda/obj/Debug/BooksLambda.exe differ diff --git a/BooksLambda/obj/Debug/BooksLambda.pdb b/BooksLambda/obj/Debug/BooksLambda.pdb new file mode 100644 index 0000000..f6f495e Binary files /dev/null and b/BooksLambda/obj/Debug/BooksLambda.pdb differ diff --git a/BooksLambda/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/BooksLambda/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..0ad81fe Binary files /dev/null and b/BooksLambda/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/BooksLambda/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/BooksLambda/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs new file mode 100644 index 0000000..e69de29 diff --git a/BooksLambda/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/BooksLambda/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs new file mode 100644 index 0000000..e69de29 diff --git a/BooksLambda/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/BooksLambda/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs new file mode 100644 index 0000000..e69de29 diff --git a/TrainingAdvancedTechniques.sln b/TrainingAdvancedTechniques.sln new file mode 100644 index 0000000..94ffda2 --- /dev/null +++ b/TrainingAdvancedTechniques.sln @@ -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 diff --git a/TrainingAdvancedTechniques/App.config b/TrainingAdvancedTechniques/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/TrainingAdvancedTechniques/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/TrainingAdvancedTechniques/Program.cs b/TrainingAdvancedTechniques/Program.cs new file mode 100644 index 0000000..398131c --- /dev/null +++ b/TrainingAdvancedTechniques/Program.cs @@ -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 square = number => number * number; + Console.WriteLine(square(5)); + + const int factor = 5; + Func multiplyer = n => n * factor; + + var result = multiplyer(10); + Console.WriteLine(result); + } + + //static int Square(int number) + //{ + // return number * number; + //} + } +} diff --git a/TrainingAdvancedTechniques/Properties/AssemblyInfo.cs b/TrainingAdvancedTechniques/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ddc4dd4 --- /dev/null +++ b/TrainingAdvancedTechniques/Properties/AssemblyInfo.cs @@ -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")] diff --git a/TrainingAdvancedTechniques/TrainingAdvancedTechniques.csproj b/TrainingAdvancedTechniques/TrainingAdvancedTechniques.csproj new file mode 100644 index 0000000..dd3af61 --- /dev/null +++ b/TrainingAdvancedTechniques/TrainingAdvancedTechniques.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {6F3F478D-7B6D-4DD5-8DE7-EBE805263D51} + Exe + TrainingAdvancedTechniques + TrainingAdvancedTechniques + v4.6.1 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TrainingAdvancedTechniques/bin/Debug/TrainingAdvancedTechniques.exe b/TrainingAdvancedTechniques/bin/Debug/TrainingAdvancedTechniques.exe new file mode 100644 index 0000000..5c8c2f9 Binary files /dev/null and b/TrainingAdvancedTechniques/bin/Debug/TrainingAdvancedTechniques.exe differ diff --git a/TrainingAdvancedTechniques/bin/Debug/TrainingAdvancedTechniques.exe.config b/TrainingAdvancedTechniques/bin/Debug/TrainingAdvancedTechniques.exe.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/TrainingAdvancedTechniques/bin/Debug/TrainingAdvancedTechniques.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/TrainingAdvancedTechniques/bin/Debug/TrainingAdvancedTechniques.pdb b/TrainingAdvancedTechniques/bin/Debug/TrainingAdvancedTechniques.pdb new file mode 100644 index 0000000..d4315d7 Binary files /dev/null and b/TrainingAdvancedTechniques/bin/Debug/TrainingAdvancedTechniques.pdb differ diff --git a/TrainingAdvancedTechniques/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/TrainingAdvancedTechniques/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..d0eba99 Binary files /dev/null and b/TrainingAdvancedTechniques/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/TrainingAdvancedTechniques/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/TrainingAdvancedTechniques/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs new file mode 100644 index 0000000..e69de29 diff --git a/TrainingAdvancedTechniques/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/TrainingAdvancedTechniques/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs new file mode 100644 index 0000000..e69de29 diff --git a/TrainingAdvancedTechniques/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/TrainingAdvancedTechniques/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs new file mode 100644 index 0000000..e69de29 diff --git a/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.csproj.CoreCompileInputs.cache b/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..536ac4e --- /dev/null +++ b/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +776a4596f18f18d5b55dda90c4584f71b9d5b430 diff --git a/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.csproj.FileListAbsolute.txt b/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..876f586 --- /dev/null +++ b/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.csproj.FileListAbsolute.txt @@ -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 diff --git a/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.csprojAssemblyReference.cache b/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.csprojAssemblyReference.cache new file mode 100644 index 0000000..cbe43f5 Binary files /dev/null and b/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.csprojAssemblyReference.cache differ diff --git a/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.exe b/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.exe new file mode 100644 index 0000000..5c8c2f9 Binary files /dev/null and b/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.exe differ diff --git a/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.pdb b/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.pdb new file mode 100644 index 0000000..d4315d7 Binary files /dev/null and b/TrainingAdvancedTechniques/obj/Debug/TrainingAdvancedTechniques.pdb differ diff --git a/VideoEnc/App.config b/VideoEnc/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/VideoEnc/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/VideoEnc/MailService.cs b/VideoEnc/MailService.cs new file mode 100644 index 0000000..cc87ce6 --- /dev/null +++ b/VideoEnc/MailService.cs @@ -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); + } + } +} diff --git a/VideoEnc/MessageService.cs b/VideoEnc/MessageService.cs new file mode 100644 index 0000000..a4ea8b0 --- /dev/null +++ b/VideoEnc/MessageService.cs @@ -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); + } + } +} diff --git a/VideoEnc/Program.cs b/VideoEnc/Program.cs new file mode 100644 index 0000000..2eef469 --- /dev/null +++ b/VideoEnc/Program.cs @@ -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); + } + + } +} diff --git a/VideoEnc/Properties/AssemblyInfo.cs b/VideoEnc/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..54bc1ba --- /dev/null +++ b/VideoEnc/Properties/AssemblyInfo.cs @@ -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")] diff --git a/VideoEnc/Video.cs b/VideoEnc/Video.cs new file mode 100644 index 0000000..e633178 --- /dev/null +++ b/VideoEnc/Video.cs @@ -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; } + } +} diff --git a/VideoEnc/VideoEnc.csproj b/VideoEnc/VideoEnc.csproj new file mode 100644 index 0000000..9f71c8d --- /dev/null +++ b/VideoEnc/VideoEnc.csproj @@ -0,0 +1,57 @@ + + + + + Debug + AnyCPU + {8B61AEAF-981F-4509-A550-2DA29838DF66} + Exe + VideoEnc + VideoEnc + v4.6.1 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VideoEnc/VideoEncoder.cs b/VideoEnc/VideoEncoder.cs new file mode 100644 index 0000000..de08f63 --- /dev/null +++ b/VideoEnc/VideoEncoder.cs @@ -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 }); + } + } +} diff --git a/VideoEnc/bin/Debug/VideoEnc.exe b/VideoEnc/bin/Debug/VideoEnc.exe new file mode 100644 index 0000000..91d56c2 Binary files /dev/null and b/VideoEnc/bin/Debug/VideoEnc.exe differ diff --git a/VideoEnc/bin/Debug/VideoEnc.exe.config b/VideoEnc/bin/Debug/VideoEnc.exe.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/VideoEnc/bin/Debug/VideoEnc.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/VideoEnc/bin/Debug/VideoEnc.pdb b/VideoEnc/bin/Debug/VideoEnc.pdb new file mode 100644 index 0000000..2023554 Binary files /dev/null and b/VideoEnc/bin/Debug/VideoEnc.pdb differ diff --git a/VideoEnc/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/VideoEnc/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..bb56aaf Binary files /dev/null and b/VideoEnc/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/VideoEnc/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/VideoEnc/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs new file mode 100644 index 0000000..e69de29 diff --git a/VideoEnc/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/VideoEnc/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs new file mode 100644 index 0000000..e69de29 diff --git a/VideoEnc/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/VideoEnc/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs new file mode 100644 index 0000000..e69de29 diff --git a/VideoEnc/obj/Debug/VideoEnc.csproj.CoreCompileInputs.cache b/VideoEnc/obj/Debug/VideoEnc.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..1acbd86 --- /dev/null +++ b/VideoEnc/obj/Debug/VideoEnc.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +6ca44b11e984b22a307d84830ebf5d6145c71a6d diff --git a/VideoEnc/obj/Debug/VideoEnc.csproj.FileListAbsolute.txt b/VideoEnc/obj/Debug/VideoEnc.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..5fc5940 --- /dev/null +++ b/VideoEnc/obj/Debug/VideoEnc.csproj.FileListAbsolute.txt @@ -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 diff --git a/VideoEnc/obj/Debug/VideoEnc.csprojAssemblyReference.cache b/VideoEnc/obj/Debug/VideoEnc.csprojAssemblyReference.cache new file mode 100644 index 0000000..0225d3d Binary files /dev/null and b/VideoEnc/obj/Debug/VideoEnc.csprojAssemblyReference.cache differ diff --git a/VideoEnc/obj/Debug/VideoEnc.exe b/VideoEnc/obj/Debug/VideoEnc.exe new file mode 100644 index 0000000..91d56c2 Binary files /dev/null and b/VideoEnc/obj/Debug/VideoEnc.exe differ diff --git a/VideoEnc/obj/Debug/VideoEnc.pdb b/VideoEnc/obj/Debug/VideoEnc.pdb new file mode 100644 index 0000000..2023554 Binary files /dev/null and b/VideoEnc/obj/Debug/VideoEnc.pdb differ