Initial add of three projects
This commit is contained in:
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