Add DragDrop support for image content
This commit is contained in:
parent
022c91910c
commit
d647cf8a86
3 changed files with 136 additions and 29 deletions
|
|
@ -56,11 +56,44 @@ namespace MatterHackers.MatterControl
|
|||
using Agg.Image;
|
||||
using System.Net;
|
||||
using CustomWidgets;
|
||||
using MatterHackers.DataConverters3D;
|
||||
|
||||
public class OemProfileDictionary : Dictionary<string, Dictionary<string, PublicDevice>>
|
||||
{
|
||||
}
|
||||
|
||||
public class ContentResult
|
||||
{
|
||||
public IObject3D Object3D { get; set; }
|
||||
public Task MeshLoaded { get; set; }
|
||||
}
|
||||
|
||||
public interface IContentProvider
|
||||
{
|
||||
ContentResult CreateItem(string filePath);
|
||||
}
|
||||
|
||||
public class SimpleContentProvider : IContentProvider
|
||||
{
|
||||
public Func<string, ContentResult> Generator { get; set; }
|
||||
|
||||
public ContentResult CreateItem(string filePath)
|
||||
{
|
||||
return this.Generator(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ExtensionMethods
|
||||
{
|
||||
public static void Add(this Dictionary<string, IContentProvider> list, IEnumerable<string> extensions, IContentProvider provider)
|
||||
{
|
||||
foreach(var extension in extensions)
|
||||
{
|
||||
list.Add(extension, provider);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PublicDevice
|
||||
{
|
||||
public string DeviceToken { get; set; }
|
||||
|
|
@ -224,6 +257,8 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public SlicePresetsWindow EditQualityPresetsWindow { get; set; }
|
||||
|
||||
public Dictionary<string, IContentProvider> SceneContentProviders = new Dictionary<string, IContentProvider>();
|
||||
|
||||
public ApplicationView MainView;
|
||||
|
||||
public event EventHandler ApplicationClosed;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue