Czoko_Smieciarka/Trunk/Interface/CzokoŚmieciarka.WPFv2/Models/Dump.cs
2019-04-01 23:10:31 +02:00

49 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using CzokoŚmieciarka.DataModels.Enums;
using CzokoŚmieciarka.DataModels.GeneralModels.Models;
using CzokoŚmieciarka.DataModels.Interfaces;
using CzokoŚmieciarka.DataModels.Interfaces.TrashCans;
using CzokoŚmieciarka.DataModels.Models;
using CzokoŚmieciarka.WPFv2.Interfaces;
namespace CzokoŚmieciarka.WPFv2.Models
{
class WPFDump : ADump, IWPFObject
{
public string ImagePath { get; set; }
public Image Image { get; set; }
public WPFDump(ITypeOfGarbage typeofGarbage, int maxVolume, Coords localization, string imagePath) : base ( typeofGarbage, maxVolume, localization)
{
ImagePath = imagePath;
Image = new Image();
switch (typeofGarbage.GarbageType)
{
case GarbageType.Glass:
ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\glass.png";
Image.Source = new BitmapImage(new Uri(ImagePath));
break;
case GarbageType.PlasticMetal:
ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\plasticmetal.png";
Image.Source = new BitmapImage(new Uri(ImagePath));
break;
case GarbageType.Organic:
ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\organic.png";
Image.Source = new BitmapImage(new Uri(ImagePath));
break;
case GarbageType.Paper:
ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\paper.png";
Image.Source = new BitmapImage(new Uri(ImagePath));
break;
}
}
}
}