LocalPicture -model added
This commit is contained in:
@ -12,6 +12,12 @@ namespace ImageHandlingLibrary
|
||||
{
|
||||
public class Filing : IFiling
|
||||
{
|
||||
private readonly IRegistring _registring;
|
||||
|
||||
public Filing(IRegistring registring)
|
||||
{
|
||||
_registring = registring;
|
||||
}
|
||||
public BitmapImage ConvertFromDrawImage(System.Drawing.Image _image)
|
||||
{
|
||||
using (var ms = new MemoryStream())
|
||||
@ -29,5 +35,11 @@ namespace ImageHandlingLibrary
|
||||
return bitmapImage;
|
||||
}
|
||||
}
|
||||
|
||||
public string ShowText()
|
||||
{
|
||||
var output = _registring.GetRegistryRootDir();
|
||||
return $"Root directory value is {output} OBS Test!!";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,11 +47,10 @@
|
||||
<Compile Include="Filing.cs" />
|
||||
<Compile Include="InterFaces\IFiling.cs" />
|
||||
<Compile Include="InterFaces\IRegistring.cs" />
|
||||
<Compile Include="Models\LocalPicture.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Registring.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@ -11,5 +11,6 @@ namespace ImageHandlingLibrary.InterFaces
|
||||
public interface IFiling
|
||||
{
|
||||
BitmapImage ConvertFromDrawImage(Image _image);
|
||||
string ShowText();
|
||||
}
|
||||
}
|
||||
|
||||
65
ImageHandlingLibrary/Models/LocalPicture.cs
Normal file
65
ImageHandlingLibrary/Models/LocalPicture.cs
Normal file
@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ImageHandlingLibrary.Models
|
||||
{
|
||||
public class LocalPicture
|
||||
{
|
||||
public string PictureFileName { get; set; }
|
||||
public string InitialPath { get; set; }
|
||||
public string PictureFullPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(InitialPath, PictureFileName);
|
||||
}
|
||||
}
|
||||
public Image AktImage { get; set; }
|
||||
public int AktImWidth { get; set; }
|
||||
public int AktImHeight { get; set; }
|
||||
public string CreatedDate { get; set; }
|
||||
public bool CreatedDateChanged { get; set; } = false;
|
||||
public string AarManDir
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(CreatedDate)) return RootPosition;
|
||||
else
|
||||
{
|
||||
DateTime dttd = DateTime.Parse(CreatedDate.Substring(0, 10).Replace(":", "-"));
|
||||
string subDir = dttd.Year.ToString("0000") + "-" + dttd.Month.ToString("00") + @"\";
|
||||
return Path.Combine(RootPosition + subDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
public string AarManDayDir
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(CreatedDate)) return RootPosition;
|
||||
else
|
||||
{
|
||||
DateTime dttd = DateTime.Parse(CreatedDate.Substring(0, 10).Replace(":", "-"));
|
||||
string subDir = dttd.Year.ToString("0000") + "_" + dttd.Month.ToString("00") + "_" + dttd.Day.ToString("00") + @"\";
|
||||
return Path.Combine(AarManDir + subDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string ImageNewFullpath
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(AarManDayDir + PictureFileName);
|
||||
}
|
||||
}
|
||||
public string RootPosition { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -60,6 +60,16 @@ namespace ImageHandlingUI.ViewModels
|
||||
_rootCatalog = value; }
|
||||
}
|
||||
|
||||
|
||||
private string _groundPath;
|
||||
|
||||
public string GroundPath
|
||||
{
|
||||
get {
|
||||
_groundPath = _filing.ShowText();
|
||||
return _groundPath;
|
||||
}
|
||||
set { _groundPath = value; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user