Skip to content

Commit 93ccbc8

Browse files
committed
Добавьте файлы проекта.
1 parent b51df9f commit 93ccbc8

File tree

11 files changed

+278
-0
lines changed

11 files changed

+278
-0
lines changed

AdapterExample.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.2.32630.192
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdapterExample", "AdapterExample\AdapterExample.csproj", "{016969C0-57AF-4EB0-9B91-D8064AC63A79}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{016969C0-57AF-4EB0-9B91-D8064AC63A79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{016969C0-57AF-4EB0-9B91-D8064AC63A79}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{016969C0-57AF-4EB0-9B91-D8064AC63A79}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{016969C0-57AF-4EB0-9B91-D8064AC63A79}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {D16BF223-4507-41AE-BC3E-4B9B6A2ABB45}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{016969C0-57AF-4EB0-9B91-D8064AC63A79}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>AdapterExample</RootNamespace>
10+
<AssemblyName>AdapterExample</AssemblyName>
11+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Net.Http" />
43+
<Reference Include="System.Xml" />
44+
</ItemGroup>
45+
<ItemGroup>
46+
<Compile Include="Monitor\IMonitor.cs" />
47+
<Compile Include="NetworkCard\GlobalNet v3100.cs" />
48+
<Compile Include="NetworkCard\INetworkCard.cs" />
49+
<Compile Include="Monitor\MonGame I370.cs" />
50+
<Compile Include="NetworkInterfaceAdapter.cs" />
51+
<Compile Include="PrintHardware.cs" />
52+
<Compile Include="Program.cs" />
53+
<Compile Include="Properties\AssemblyInfo.cs" />
54+
</ItemGroup>
55+
<ItemGroup>
56+
<None Include="App.config" />
57+
</ItemGroup>
58+
<ItemGroup />
59+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
60+
</Project>

AdapterExample/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
5+
</startup>
6+
</configuration>

AdapterExample/Monitor/IMonitor.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AdapterExample.Monitor
8+
{
9+
internal interface IMonitor
10+
{
11+
string name { get; }
12+
string GetMatrixInfo();
13+
}
14+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AdapterExample.Monitor
8+
{
9+
internal class MonGame_I370 : IMonitor
10+
{
11+
public string name { get; }
12+
string matrixInfo;
13+
14+
public MonGame_I370()
15+
{
16+
name = "MonGame I370";
17+
matrixInfo = "IPS";
18+
}
19+
20+
public string GetMatrixInfo() => matrixInfo;
21+
}
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AdapterExample.NetworkCard
8+
{
9+
internal class GlobalNet_v3100 : INetworkCard
10+
{
11+
public string name { get; }
12+
public string description { get; }
13+
14+
public GlobalNet_v3100()
15+
{
16+
name = "GlobalNet v3100";
17+
description = "Network card 10gbps";
18+
}
19+
20+
public string GetDescription() => description;
21+
}
22+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AdapterExample.NetworkCard
8+
{
9+
internal interface INetworkCard
10+
{
11+
string name { get; }
12+
string GetDescription();
13+
}
14+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using AdapterExample.Monitor;
2+
using AdapterExample.NetworkCard;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace AdapterExample
10+
{
11+
internal class NetworkInterfaceAdapter : INetworkCard
12+
{
13+
IMonitor monitor;
14+
public string name { get { return monitor.name; } }
15+
16+
public NetworkInterfaceAdapter(IMonitor _monitor)
17+
{
18+
monitor = _monitor;
19+
}
20+
21+
public string GetDescription()
22+
{
23+
return monitor.GetMatrixInfo();
24+
}
25+
}
26+
}

AdapterExample/PrintHardware.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using AdapterExample.Monitor;
2+
using AdapterExample.NetworkCard;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace AdapterExample
10+
{
11+
internal static class PrintHardware
12+
{
13+
public static void OutputInfo(INetworkCard networkCard)
14+
{
15+
Console.WriteLine($"Название: {networkCard.name} \nОписание: {networkCard.GetDescription()}");
16+
}
17+
public static void OutputInfo(IMonitor monitor)
18+
{
19+
Console.WriteLine("Not supported");
20+
}
21+
}
22+
}

AdapterExample/Program.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using AdapterExample.Monitor;
2+
using AdapterExample.NetworkCard;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace AdapterExample
10+
{
11+
internal class Program
12+
{
13+
static void Main(string[] args)
14+
{
15+
INetworkCard networkCard = new GlobalNet_v3100();
16+
PrintHardware.OutputInfo(networkCard);
17+
18+
Console.WriteLine();
19+
20+
IMonitor monitor = new MonGame_I370();
21+
PrintHardware.OutputInfo(monitor);
22+
23+
Console.WriteLine();
24+
25+
NetworkInterfaceAdapter monitorAdapter = new NetworkInterfaceAdapter(monitor);
26+
PrintHardware.OutputInfo(monitorAdapter);
27+
28+
Console.ReadLine();
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)