refact: mvp

This commit is contained in:
rainerosion 2023-01-31 18:02:56 +08:00
parent 4d2f062e70
commit 9a84ad998e
13 changed files with 95 additions and 19 deletions

59
Tech/Model/Equipment.cs Normal file
View File

@ -0,0 +1,59 @@
using System;
namespace Tech_Demo.Model
{
public class Equipment
{
/**
*
*/
public int Id { get; set; }
/**
*
*/
public string Name { get; set; }
/**
* ip
*/
public string Ip { get; set; }
/**
*
*/
public string Url { get; set; }
/**
*
*/
public int Type { get; set; }
public override string ToString()
{
return base.ToString();
}
public override bool Equals(object obj)
{
var equipment = obj as Equipment;
return base.Equals(equipment);
}
public override int GetHashCode()
{
return Id.GetHashCode() ^ Name.GetHashCode() ^ Ip.GetHashCode() ^ Url.GetHashCode() ^ Type.GetHashCode();
}
public bool Equals(Equipment equipment)
{
if (equipment == null)
{
return false;
}
return Id == equipment.Id && Name == equipment.Name && Ip == equipment.Ip && Url == equipment.Url &&
Type == equipment.Type;
}
}
}

View File

@ -0,0 +1,7 @@
namespace Tech_Demo.Model.Repository.Impl
{
public class package_info
{
}
}

View File

@ -0,0 +1,7 @@
namespace Tech_Demo.Presenter
{
public class package_info
{
}
}

View File

@ -84,20 +84,9 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ArpUtil.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="GetIPNetTable.cs" />
<Compile Include="PlayerView.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="PlayerView.Designer.cs">
<DependentUpon>PlayerView.cs</DependentUpon>
</Compile>
<Compile Include="Model\Equipment.cs" />
<Compile Include="Model\Repository\Impl\package-info.cs" />
<Compile Include="Presenter\package-info.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UCOverview.cs">
@ -106,13 +95,21 @@
<Compile Include="UCOverview.Designer.cs">
<DependentUpon>UCOverview.cs</DependentUpon>
</Compile>
<Compile Include="util\Thumbnail.cs" />
<EmbeddedResource Include="MainForm.resx">
<Compile Include="Util\ArpUtil.cs" />
<Compile Include="Util\GetIPNetTable.cs" />
<Compile Include="Util\Thumbnail.cs" />
<Compile Include="View\Impl\MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="View\Impl\MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PlayerView.resx">
</Compile>
<Compile Include="View\Impl\PlayerView.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="View\Impl\PlayerView.Designer.cs">
<DependentUpon>PlayerView.cs</DependentUpon>
</EmbeddedResource>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@ -126,6 +123,12 @@
<EmbeddedResource Include="UCOverview.resx">
<DependentUpon>UCOverview.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="View\Impl\MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="View\Impl\PlayerView.resx">
<DependentUpon>PlayerView.cs</DependentUpon>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>