This commit is contained in:
Rens Pastoor
2025-05-27 23:40:31 +02:00
parent cd68d8abd0
commit d71b8570a1
55 changed files with 1277 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1 @@
{"RootPath":"C:\\Users\\rens\\Downloads\\school-Csharp-programming-main\\school-Csharp-programming-main\\poloclub app\\PoloClubApp\\PoloClubApp","ProjectFileName":"PoloClubApp.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"Club.cs"},{"SourceFile":"Device.cs"},{"SourceFile":"FitTracker.cs"},{"SourceFile":"PoloClubAppForm.cs"},{"SourceFile":"PoloClubAppForm.Designer.cs"},{"SourceFile":"IWearable.cs"},{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"SmartPhone.cs"},{"SourceFile":"SmartWatch.cs"},{"SourceFile":"Properties\\Resources.Designer.cs"},{"SourceFile":"Properties\\Settings.Designer.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.6.1.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\Microsoft.CSharp\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Core\\v4.0_4.0.0.0__b77a5c561934e089\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Data.DataSetExtensions\\v4.0_4.0.0.0__b77a5c561934e089\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Windows\\Microsoft.Net\\assembly\\GAC_64\\System.Data\\v4.0_4.0.0.0__b77a5c561934e089\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Deployment\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Deployment.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System\\v4.0_4.0.0.0__b77a5c561934e089\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Drawing\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Net.Http\\v4.0_4.0.0.0__b03f5f7f11d50a3a\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Windows.Forms\\v4.0_4.0.0.0__b77a5c561934e089\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Windows\\Microsoft.Net\\assembly\\GAC_MSIL\\System.Xml.Linq\\v4.0_4.0.0.0__b77a5c561934e089\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"C:\\Users\\rens\\Downloads\\school-Csharp-programming-main\\school-Csharp-programming-main\\poloclub app\\PoloClubApp\\PoloClubApp\\bin\\Debug\\PoloClubApp.exe","OutputItemRelativePath":"PoloClubApp.exe"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}

View 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>

View File

@@ -0,0 +1,155 @@
///
/// class: Club.cs
///
///This file contains the Club class, which manages the collection of devices in the polo club.
///It provides methods to add, assign, return, and generate reports for devices, as well as retrieve all wearables.
///
/// Name: Rens Pastoor
/// Studentnumber: 555408
/// Date: 11 May 2025
///
///Version: 1
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Windows.Forms;
namespace PoloClubApp {
class Club {
private string name; // the name of the club
private List<Device> devices; // a list of devices
public Club(string name){
this.name = name;
this.devices = new List<Device>();
}
public string Name { get { return this.name; } } // read only property for Name
//-----Provide your answers here-----
public List<Device> GetAllWearables(){
List<Device> wearables = new List<Device>();
foreach (Device dev in this.devices){
if (dev is SmartWatch || dev is FitTracker){
wearables.Add(dev);
}
}
return wearables;
}
public void AssignDevice(int id, string playerName){
Device device = GetDeviceById(id);
if(device == null){
throw new Exception("Device not found");
}
if (!(device is IWearable)){
device.AssignDevice(playerName, null);
} else {
IWearable wearable = (IWearable)device;
device.AssignDevice(playerName, wearable.GetWaterResistanceMeters());
}
}
public bool ReturnDevice(int id){
Device device = GetDeviceById(id);
return device.ReturnDevice();
}
public List<Device> GetAllAssignedDevicesByPlayer(string playerName){
List<Device> assignedDevices = new List<Device>();
foreach (Device dev in this.devices){
if (dev.PlayerName == playerName){
assignedDevices.Add(dev);
}
}
return assignedDevices;
}
public List<String> GenerateReportPerPlayer(string playerName){
string returnString = "List of devices assigned to " + playerName;
List<String> lines = new List<String>();
List<Device> assignedDevices = GetAllAssignedDevicesByPlayer(playerName);
lines.Add(returnString);
string currentDeviceType = "SmartPhone";
lines.Add("Phones");
lines.Add("-");
foreach (Device dev in assignedDevices){
if (dev is SmartPhone){
lines.Add(dev.GetDetails());
}
}
lines.Add("Wearables");
lines.Add("-");
foreach (Device dev in assignedDevices){
if (!(dev is SmartPhone)){
lines.Add(dev.GetDetails());
}
}
int phoneCount = 0;
int wearableCount = 0;
foreach (Device dev in assignedDevices){
if (dev is SmartPhone){
phoneCount++;
}
if (dev is IWearable){
wearableCount++;
}
}
lines.Add("Total: " + assignedDevices.Count + " devices, " + phoneCount + " phones and " + wearableCount + " wearables");
return lines;
}
// -----The provided code below will not be graded, therefore should not be changed-----
/// <summary>
/// Provides all devices to the caller.
/// </summary>
/// <returns>List of devices</returns>
public List<Device> GetAllDevices(){
return this.devices;
}
/// <summary>
/// Adds a device to the list of devices if unique id is provided.
/// </summary>
/// <param name="device">device to be added</param>
public void AddDevice(Device device) {
foreach (Device dev in this.devices){
if (dev.Id == device.Id){
return;
}
}
devices.Add(device);
}
/// <summary>
/// Provides a device by a given id.
/// </summary>
/// <param name="id">the unique identity number of the requested device.</param>
/// <returns>A device when found, otherwise null</returns>
public Device GetDeviceById(int id){
foreach (Device dev in this.devices){
if (dev.Id == id){
return dev;
}
}
return null;
}
}
}

View File

@@ -0,0 +1,56 @@
///
/// class: Device.cs
///
///This file defines the abstract Device class, which serves as the base class for all device types (e.g., smartphones, smartwatches).
///It includes common properties and methods for managing device details and assignments.
///
/// Name: Rens Pastoor
/// Studentnumber: 555408
/// Date: 11 May 2025
///
///Version: 1
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoloClubApp {
internal abstract class Device {
public int Id { get; }
public string Name { get; }
public string PlayerName { get; set; }
public Device(int id, string name, string playerName = null){
Id = id;
Name = name;
PlayerName = playerName;
}
public abstract string GetDetails();
public bool IsAssigned(){
return PlayerName != null;
}
public Exception AssignDevice(string playerName, int? waterResistanceMeters){
if (IsAssigned()){
throw new Exception("Device is already assigned");
} else if (this is IWearable && waterResistanceMeters < 3){
throw new Exception("Water resistance meters should be 3 or more");
} else if (this.Id == null){
throw new Exception("Device Id is null");
} else {
PlayerName = playerName;
return null;
}
}
public bool ReturnDevice(){
if (!IsAssigned()){
return false;
}
PlayerName = null;
return true;
}
}
}

View File

@@ -0,0 +1,43 @@
///
/// class: FitTracker.cs
///
///This file defines the FitTracker class, which represents a fitness tracker device. It implements
///the IWearable interface and includes properties for water resistance and other fitness-specific features.
///
/// Name: Rens Pastoor
/// Studentnumber: 555408
/// Date: 11 may 2025
///
///Version: 1
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoloClubApp {
internal class FitTracker : Device, IWearable {
public string DeviceType = "FitTracker";
public int Id { get; }
public string Name { get; }
public string PlayerName { get; set; }
public int WaterResistanceMeters { get; }
public string Color { get; }
public FitTracker(int id, string name, int waterResistanceMeters, string color) : base(id, name, null){
Id = id;
Name = name;
WaterResistanceMeters = waterResistanceMeters;
Color = color;
}
public override string GetDetails(){
return DeviceType + "Id: " + Id + ", Name: " + Name + ", Type: " + ", WaterResistanceMeters: " + WaterResistanceMeters + ", Color: " + Color;
}
public int GetWaterResistanceMeters(){
return WaterResistanceMeters;
}
}
}

View File

@@ -0,0 +1,25 @@
///
/// class: IWearable.cs
///
///This file defines the IWearable interface, which specifies a method to get the water resistance level of wearable devices.
///It is implemented by classes representing wearable devices like smartwatches and fitness trackers.
///
/// Name: Rens Pastoor
/// Studentnumber: 555408
/// Date: 11 May 2025
///
///Version: 1
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;
namespace PoloClubApp {
interface IWearable {
///Returns the water resistance level of the wearable device in meters.
int GetWaterResistanceMeters();
}
}

View File

@@ -0,0 +1,92 @@
<?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>{BA2A90B1-738C-47C3-AAFD-B6866F66DB6D}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>PoloClubApp</RootNamespace>
<AssemblyName>PoloClubApp</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</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.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Club.cs" />
<Compile Include="Device.cs" />
<Compile Include="FitTracker.cs" />
<Compile Include="PoloClubAppForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PoloClubAppForm.Designer.cs">
<DependentUpon>PoloClubAppForm.cs</DependentUpon>
</Compile>
<Compile Include="IWearable.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SmartPhone.cs" />
<Compile Include="SmartWatch.cs" />
<EmbeddedResource Include="PoloClubAppForm.resx">
<DependentUpon>PoloClubAppForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32802.440
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PoloClubApp", "PoloClubApp.csproj", "{BA2A90B1-738C-47C3-AAFD-B6866F66DB6D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BA2A90B1-738C-47C3-AAFD-B6866F66DB6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA2A90B1-738C-47C3-AAFD-B6866F66DB6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA2A90B1-738C-47C3-AAFD-B6866F66DB6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA2A90B1-738C-47C3-AAFD-B6866F66DB6D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D457CC83-F016-41A7-8295-33BD3C8D4937}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,248 @@
namespace PoloClubApp
{
partial class PoloClubAppForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lbOverview = new System.Windows.Forms.ListBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnViewAllWearables = new System.Windows.Forms.Button();
this.btnViewAllDevices = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.tbPlayerNameForFile = new System.Windows.Forms.TextBox();
this.btnGeneratePlayerTextReport = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.btnShowAssignedDevices = new System.Windows.Forms.Button();
this.btnReturn = new System.Windows.Forms.Button();
this.btnAssign = new System.Windows.Forms.Button();
this.lblDevice = new System.Windows.Forms.Label();
this.cbDevice = new System.Windows.Forms.ComboBox();
this.lblPlayerName = new System.Windows.Forms.Label();
this.tbPlayerName = new System.Windows.Forms.TextBox();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// lbOverview
//
this.lbOverview.Dock = System.Windows.Forms.DockStyle.Top;
this.lbOverview.FormattingEnabled = true;
this.lbOverview.Location = new System.Drawing.Point(0, 0);
this.lbOverview.Name = "lbOverview";
this.lbOverview.Size = new System.Drawing.Size(598, 212);
this.lbOverview.TabIndex = 0;
//
// groupBox1
//
this.groupBox1.BackColor = System.Drawing.Color.Green;
this.groupBox1.Controls.Add(this.btnViewAllWearables);
this.groupBox1.Controls.Add(this.btnViewAllDevices);
this.groupBox1.Location = new System.Drawing.Point(12, 229);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(247, 58);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Overview";
//
// btnViewAllWearables
//
this.btnViewAllWearables.Location = new System.Drawing.Point(124, 19);
this.btnViewAllWearables.Name = "btnViewAllWearables";
this.btnViewAllWearables.Size = new System.Drawing.Size(112, 23);
this.btnViewAllWearables.TabIndex = 1;
this.btnViewAllWearables.Text = "View All Wearables";
this.btnViewAllWearables.UseVisualStyleBackColor = true;
this.btnViewAllWearables.Click += new System.EventHandler(this.btnViewAllWearables_Click);
//
// btnViewAllDevices
//
this.btnViewAllDevices.BackColor = System.Drawing.SystemColors.Control;
this.btnViewAllDevices.Location = new System.Drawing.Point(6, 19);
this.btnViewAllDevices.Name = "btnViewAllDevices";
this.btnViewAllDevices.Size = new System.Drawing.Size(112, 23);
this.btnViewAllDevices.TabIndex = 0;
this.btnViewAllDevices.Text = "View All Devices";
this.btnViewAllDevices.UseVisualStyleBackColor = false;
this.btnViewAllDevices.Click += new System.EventHandler(this.btnViewAllDevices_Click);
//
// groupBox2
//
this.groupBox2.BackColor = System.Drawing.Color.Red;
this.groupBox2.Controls.Add(this.tbPlayerNameForFile);
this.groupBox2.Controls.Add(this.btnGeneratePlayerTextReport);
this.groupBox2.Location = new System.Drawing.Point(12, 293);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(247, 65);
this.groupBox2.TabIndex = 2;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Report";
//
// tbPlayerNameForFile
//
this.tbPlayerNameForFile.Location = new System.Drawing.Point(141, 10);
this.tbPlayerNameForFile.Name = "tbPlayerNameForFile";
this.tbPlayerNameForFile.Size = new System.Drawing.Size(100, 20);
this.tbPlayerNameForFile.TabIndex = 2;
//
// btnGeneratePlayerTextReport
//
this.btnGeneratePlayerTextReport.Location = new System.Drawing.Point(6, 36);
this.btnGeneratePlayerTextReport.Name = "btnGeneratePlayerTextReport";
this.btnGeneratePlayerTextReport.Size = new System.Drawing.Size(238, 23);
this.btnGeneratePlayerTextReport.TabIndex = 0;
this.btnGeneratePlayerTextReport.Text = "Generate report per player";
this.btnGeneratePlayerTextReport.UseVisualStyleBackColor = true;
this.btnGeneratePlayerTextReport.Click += new System.EventHandler(this.btnGeneratePlayerTextReport_Click);
//
// groupBox3
//
this.groupBox3.BackColor = System.Drawing.Color.DodgerBlue;
this.groupBox3.Controls.Add(this.btnShowAssignedDevices);
this.groupBox3.Controls.Add(this.btnReturn);
this.groupBox3.Controls.Add(this.btnAssign);
this.groupBox3.Controls.Add(this.lblDevice);
this.groupBox3.Controls.Add(this.cbDevice);
this.groupBox3.Controls.Add(this.lblPlayerName);
this.groupBox3.Controls.Add(this.tbPlayerName);
this.groupBox3.Location = new System.Drawing.Point(275, 229);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(313, 129);
this.groupBox3.TabIndex = 3;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Assign / Return";
//
// btnShowAssignedDevices
//
this.btnShowAssignedDevices.Location = new System.Drawing.Point(6, 93);
this.btnShowAssignedDevices.Name = "btnShowAssignedDevices";
this.btnShowAssignedDevices.Size = new System.Drawing.Size(133, 23);
this.btnShowAssignedDevices.TabIndex = 6;
this.btnShowAssignedDevices.Text = "Show Assigned Devices";
this.btnShowAssignedDevices.UseVisualStyleBackColor = true;
this.btnShowAssignedDevices.Click += new System.EventHandler(this.btnShowAssignedDevices_Click);
//
// btnReturn
//
this.btnReturn.Location = new System.Drawing.Point(172, 64);
this.btnReturn.Name = "btnReturn";
this.btnReturn.Size = new System.Drawing.Size(132, 23);
this.btnReturn.TabIndex = 5;
this.btnReturn.Text = "Return Device";
this.btnReturn.UseVisualStyleBackColor = true;
this.btnReturn.Click += new System.EventHandler(this.btnReturn_Click);
//
// btnAssign
//
this.btnAssign.Location = new System.Drawing.Point(6, 64);
this.btnAssign.Name = "btnAssign";
this.btnAssign.Size = new System.Drawing.Size(132, 23);
this.btnAssign.TabIndex = 4;
this.btnAssign.Text = "Assign Device";
this.btnAssign.UseVisualStyleBackColor = true;
this.btnAssign.Click += new System.EventHandler(this.btnAssign_Click);
//
// lblDevice
//
this.lblDevice.AutoSize = true;
this.lblDevice.Location = new System.Drawing.Point(169, 22);
this.lblDevice.Name = "lblDevice";
this.lblDevice.Size = new System.Drawing.Size(53, 13);
this.lblDevice.TabIndex = 3;
this.lblDevice.Text = "Device Id";
//
// cbDevice
//
this.cbDevice.FormattingEnabled = true;
this.cbDevice.Location = new System.Drawing.Point(172, 37);
this.cbDevice.Name = "cbDevice";
this.cbDevice.Size = new System.Drawing.Size(132, 21);
this.cbDevice.TabIndex = 1;
//
// lblPlayerName
//
this.lblPlayerName.AutoSize = true;
this.lblPlayerName.Location = new System.Drawing.Point(6, 22);
this.lblPlayerName.Name = "lblPlayerName";
this.lblPlayerName.Size = new System.Drawing.Size(67, 13);
this.lblPlayerName.TabIndex = 1;
this.lblPlayerName.Text = "Player Name";
//
// tbPlayerName
//
this.tbPlayerName.Location = new System.Drawing.Point(6, 38);
this.tbPlayerName.Name = "tbPlayerName";
this.tbPlayerName.Size = new System.Drawing.Size(132, 20);
this.tbPlayerName.TabIndex = 0;
//
// saveFileDialog1
//
this.saveFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.saveFileDialog1_FileOk);
//
// PoloClubAppForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(598, 377);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.lbOverview);
this.Name = "PoloClubAppForm";
this.Text = "Form1";
this.Load += new System.EventHandler(this.PoloClubAppForm_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ListBox lbOverview;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button btnViewAllDevices;
private System.Windows.Forms.Button btnViewAllWearables;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button btnGeneratePlayerTextReport;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Label lblPlayerName;
private System.Windows.Forms.TextBox tbPlayerName;
private System.Windows.Forms.Label lblDevice;
private System.Windows.Forms.ComboBox cbDevice;
private System.Windows.Forms.Button btnShowAssignedDevices;
private System.Windows.Forms.Button btnReturn;
private System.Windows.Forms.Button btnAssign;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.TextBox tbPlayerNameForFile;
}
}

View File

@@ -0,0 +1,114 @@
///
/// class: PoloClubAppForm.cs
///
///This file contains the PoloClubAppForm class, which is the main Windows Forms application for managing the
///polo club's devices. It provides the user interface for viewing, assigning, returning, and generating reports for devices.
///
/// Name: Rens Pastoor
/// Studentnumber: 555408
/// Date: 11 May 2025
///
///Version: 1
///
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PoloClubApp {
public partial class PoloClubAppForm : Form {
// Provide your answers here
private void btnViewAllWearables_Click(object sender, EventArgs e){
List<Device> wearables = myClub.GetAllWearables();
lbOverview.Items.Clear();
foreach (Device wearable in wearables)
{
lbOverview.Items.Add(wearable.GetDetails());
}
}
private void btnAssign_Click(object sender, EventArgs e){
try {
if (string.IsNullOrWhiteSpace(tbPlayerName.Text)){
MessageBox.Show("Please enter a player name");
return;
}
int deviceId = int.Parse(cbDevice.SelectedItem.ToString());
myClub.AssignDevice(deviceId, tbPlayerName.Text);
MessageBox.Show("Device assigned successfully");
}
catch (FormatException){
MessageBox.Show("Please select a valid device");
}
catch (Exception ex){
MessageBox.Show($"Error assigning device: {ex.Message}");
}
}
private void btnReturn_Click(object sender, EventArgs e){
myClub.ReturnDevice(Convert.ToInt32(cbDevice.Text));
}
private void btnShowAssignedDevices_Click(object sender, EventArgs e){
List<Device> assignedDevices = myClub.GetAllAssignedDevicesByPlayer(tbPlayerName.Text);
lbOverview.Items.Clear();
foreach (Device device in assignedDevices){
lbOverview.Items.Add(device.GetDetails());
}
}
private void btnGeneratePlayerTextReport_Click(object sender, EventArgs e){
List<string> report = myClub.GenerateReportPerPlayer(tbPlayerName.Text);
lbOverview.Items.Clear();
foreach (string line in report){
lbOverview.Items.Add(line);
}
}
// -----The provided code below will not be graded, therefore should not be changed-----
private Club myClub;
public PoloClubAppForm(){
InitializeComponent();
myClub = new Club("PoloClub");
this.Text = myClub.Name;
this.addSomeTestingStuff();
this.fillComboBoxDevices();
}
private void addSomeTestingStuff(){
myClub.AddDevice(new SmartPhone(101, "iPhone X"));
myClub.AddDevice(new SmartWatch(202, "Apple Watch Sport", 5, 38));
myClub.AddDevice(new FitTracker(300, "Fitbit Ionic", 1, "pink"));
myClub.AddDevice(new SmartWatch(203, "Motorola Moto 360", 9, 40));
myClub.AddDevice(new SmartPhone(102, "iPhone 9"));
myClub.AddDevice(new SmartPhone(103, "Galaxy S9"));
myClub.AddDevice(new FitTracker(301, "Fitbit Alta HR", 8, "blue"));
myClub.AddDevice(new SmartPhone(104, "Pixels 2"));
myClub.AddDevice(new SmartWatch(204, "Samsung Gear Sport", 2, 42));
myClub.AddDevice(new FitTracker(302, "Fitbit Charge 2", 10, "black"));
myClub.AddDevice(new FitTracker(303, "Misfit Ray", 0, "black"));
}
private void fillComboBoxDevices(){
foreach (Device dev in myClub.GetAllDevices()){
cbDevice.Items.Add(dev.Id);
}
}
private void btnViewAllDevices_Click(object sender, EventArgs e){
this.lbOverview.Items.Clear();
foreach (Device dev in myClub.GetAllDevices()){
this.lbOverview.Items.Add(dev.GetDetails());
}
}
}
}

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PoloClubApp {
static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(){
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new PoloClubAppForm());
}
}
}

View 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("PoloClubApp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PoloClubApp")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[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("ba2a90b1-738c-47c3-aafd-b6866f66db6d")]
// 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")]

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace PoloClubApp.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PoloClubApp.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace PoloClubApp.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.13.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,34 @@
///
/// class: SmartPhone.cs
///
///This file defines the SmartPhone class, which represents a smartphone device. It includes properties and methods
///specific to smartphones, such as getting device details and managing assignments to players.
///
/// Name: Rens Pastoor
/// Studentnumber: 555408
/// Date: 11 May 2025
///
///Version: 1
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoloClubApp {
internal class SmartPhone : Device {
public string DeviceType = "SmartPhone";
public int Id { get; }
public string Name { get; }
public string PlayerName { get; set; }
public SmartPhone(int id, string name) : base(id, name, null){
Id = id;
Name = name;
}
public override string GetDetails(){
return DeviceType + "Id: " + Id + ", Name: " + Name;
}
}
}

View File

@@ -0,0 +1,42 @@
///
/// class: SmartWatch.cs
///
///This file defines the SmartWatch class, which represents a smartwatch device. It implements the IWearable interface
///and includes properties for water resistance and screen size, along with methods to get device details.
///
/// Name: Rens Pastoor
/// Studentnumber: 555408
/// Date: 11 May 2025
///
///Version: 1
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace PoloClubApp {
internal class SmartWatch : Device, IWearable {
public string DeviceType = "Watch";
public int WaterResistanceMeters { get; }
public int ScreenSize { get; }
/// Initializes a new SmartWatch with specified ID, name, player name, water resistance, and screen size.
public SmartWatch(int id, string name, int waterResistanceMeters, int screenSize) : base(id, name, null){
WaterResistanceMeters = waterResistanceMeters;
ScreenSize = screenSize;
}
/// Returns a string representation of the SmartWatch details.
public override string GetDetails(){
return DeviceType + "Id: " + Id + ", Name: " + Name + ", WaterResistanceMeters: " + WaterResistanceMeters + ", ScreenSize: " + ScreenSize;
}
/// Returns the water resistance of the SmartWatch in meters.
public int GetWaterResistanceMeters(){
return WaterResistanceMeters;
}
}
}

View 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>

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6.1", FrameworkDisplayName = "")]

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View File

@@ -0,0 +1 @@
9d6f958781b23f97f72d1e7f5a9079b0d566078f

View File

@@ -0,0 +1 @@
2dd441a6dcab245f72940a1e3dc8fb177864ab58

View File

@@ -0,0 +1,29 @@
C:\Users\gijs\Downloads\PoloClubApp\PoloClubApp\bin\Debug\PoloClubApp.exe
C:\Users\gijs\Downloads\PoloClubApp\PoloClubApp\bin\Debug\PoloClubApp.exe.config
C:\Users\gijs\Downloads\PoloClubApp\PoloClubApp\obj\Debug\PoloClubApp.csproj.AssemblyReference.cache
C:\Users\gijs\Downloads\PoloClubApp\PoloClubApp\obj\Debug\PoloClubApp.PoloClubAppForm.resources
C:\Users\gijs\Downloads\PoloClubApp\PoloClubApp\obj\Debug\PoloClubApp.Properties.Resources.resources
C:\Users\gijs\Downloads\PoloClubApp\PoloClubApp\obj\Debug\PoloClubApp.csproj.GenerateResource.cache
C:\Users\gijs\Downloads\PoloClubApp\PoloClubApp\obj\Debug\PoloClubApp.csproj.CoreCompileInputs.cache
C:\Users\gijs\Downloads\PoloClubApp\PoloClubApp\obj\Debug\PoloClubApp.exe
C:\Users\gijs\Downloads\PoloClubApp\PoloClubApp\obj\Debug\PoloClubApp.pdb
C:\Users\rens\Downloads\school-Csharp-programming-main\school-Csharp-programming-main\poloclub app\PoloClubApp\PoloClubApp\bin\Debug\PoloClubApp.exe.config
C:\Users\rens\Downloads\school-Csharp-programming-main\school-Csharp-programming-main\poloclub app\PoloClubApp\PoloClubApp\bin\Debug\PoloClubApp.exe
C:\Users\rens\Downloads\school-Csharp-programming-main\school-Csharp-programming-main\poloclub app\PoloClubApp\PoloClubApp\bin\Debug\PoloClubApp.pdb
C:\Users\rens\Downloads\school-Csharp-programming-main\school-Csharp-programming-main\poloclub app\PoloClubApp\PoloClubApp\obj\Debug\PoloClubApp.csproj.AssemblyReference.cache
C:\Users\rens\Downloads\school-Csharp-programming-main\school-Csharp-programming-main\poloclub app\PoloClubApp\PoloClubApp\obj\Debug\PoloClubApp.PoloClubAppForm.resources
C:\Users\rens\Downloads\school-Csharp-programming-main\school-Csharp-programming-main\poloclub app\PoloClubApp\PoloClubApp\obj\Debug\PoloClubApp.Properties.Resources.resources
C:\Users\rens\Downloads\school-Csharp-programming-main\school-Csharp-programming-main\poloclub app\PoloClubApp\PoloClubApp\obj\Debug\PoloClubApp.csproj.GenerateResource.cache
C:\Users\rens\Downloads\school-Csharp-programming-main\school-Csharp-programming-main\poloclub app\PoloClubApp\PoloClubApp\obj\Debug\PoloClubApp.csproj.CoreCompileInputs.cache
C:\Users\rens\Downloads\school-Csharp-programming-main\school-Csharp-programming-main\poloclub app\PoloClubApp\PoloClubApp\obj\Debug\PoloClubApp.exe
C:\Users\rens\Downloads\school-Csharp-programming-main\school-Csharp-programming-main\poloclub app\PoloClubApp\PoloClubApp\obj\Debug\PoloClubApp.pdb
C:\Users\Rens\Downloads\PoloClubApp\bin\Debug\PoloClubApp.exe.config
C:\Users\Rens\Downloads\PoloClubApp\bin\Debug\PoloClubApp.exe
C:\Users\Rens\Downloads\PoloClubApp\bin\Debug\PoloClubApp.pdb
C:\Users\Rens\Downloads\PoloClubApp\obj\Debug\PoloClubApp.csproj.AssemblyReference.cache
C:\Users\Rens\Downloads\PoloClubApp\obj\Debug\PoloClubApp.PoloClubAppForm.resources
C:\Users\Rens\Downloads\PoloClubApp\obj\Debug\PoloClubApp.Properties.Resources.resources
C:\Users\Rens\Downloads\PoloClubApp\obj\Debug\PoloClubApp.csproj.GenerateResource.cache
C:\Users\Rens\Downloads\PoloClubApp\obj\Debug\PoloClubApp.csproj.CoreCompileInputs.cache
C:\Users\Rens\Downloads\PoloClubApp\obj\Debug\PoloClubApp.exe
C:\Users\Rens\Downloads\PoloClubApp\obj\Debug\PoloClubApp.pdb