Refactor QueueDataWidget print actions for extensibility

- Add types for PrintItem actions and plugins
 - Refactor QueueDataWidget to support new actions and plugins
 - Switch from TupleList to List<PrintItemAction> for menu objects
 - Remove unused xxx_click and xxx_selected delegates
This commit is contained in:
John Lewin 2016-02-12 19:21:43 -08:00
parent 27a2504ece
commit 5cf91949d5
2 changed files with 66 additions and 54 deletions

View file

@ -35,6 +35,7 @@ using MatterHackers.MatterControl.DataStorage;
using MatterHackers.MatterControl.PrinterCommunication;
using MatterHackers.VectorMath;
using System;
using System.Collections.Generic;
using System.IO;
namespace MatterHackers.MatterControl.PrintQueue
@ -642,4 +643,16 @@ namespace MatterHackers.MatterControl.PrintQueue
return GetPrintQueueItem(SelectedIndex);
}
}
public class PrintItemAction
{
public string Title { get; set; }
public Action<IEnumerable<QueueRowItem>> Action { get; set; }
public bool SingleItemOnly { get; set; } = false;
}
public abstract class PrintItemMenuExtension
{
public abstract IEnumerable<PrintItemAction> GetMenuItems();
}
}