Playing with a new web cache class
This commit is contained in:
parent
833b7c7141
commit
c93bb370bc
10 changed files with 258 additions and 197 deletions
|
|
@ -124,36 +124,6 @@ namespace MatterHackers.MatterControl.PrinterCommunication.Io
|
|||
Reset();
|
||||
}
|
||||
|
||||
public ImageBuffer LoadImageAsset(string uri)
|
||||
{
|
||||
string filePath = Path.Combine("Images", "Macros", uri);
|
||||
bool imageOnDisk = false;
|
||||
if (uri.IndexOfAny(Path.GetInvalidFileNameChars()) == -1)
|
||||
{
|
||||
try
|
||||
{
|
||||
imageOnDisk = AggContext.StaticData.FileExists(filePath);
|
||||
}
|
||||
catch
|
||||
{
|
||||
imageOnDisk = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (imageOnDisk)
|
||||
{
|
||||
return AggContext.StaticData.LoadImage(filePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
var imageBuffer = new ImageBuffer(320, 10);
|
||||
|
||||
ApplicationController.Instance.DownloadToImageAsync(imageBuffer, uri, true);
|
||||
|
||||
return imageBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ReadLine()
|
||||
{
|
||||
string lineToSend = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue