|
|
|
@ -12,6 +12,7 @@ using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
|
|
|
|
|
|
|
|
|
namespace Rs.Controls
|
|
|
|
|
{
|
|
|
|
@ -34,6 +35,7 @@ namespace Rs.Controls
|
|
|
|
|
|
|
|
|
|
public partial class RsTray : UserControl
|
|
|
|
|
{
|
|
|
|
|
public event Action<RsTray,ESlotStatus,List<TraySlot>> DrawTrayAfterEvent;
|
|
|
|
|
public string ItemName { get; set; }
|
|
|
|
|
|
|
|
|
|
private ESortDir sortDir = ESortDir.LeftToRight;
|
|
|
|
@ -59,6 +61,10 @@ namespace Rs.Controls
|
|
|
|
|
get { return mShowStatus; }
|
|
|
|
|
set { mShowStatus = value;
|
|
|
|
|
lblStatus.Visible = mShowStatus;
|
|
|
|
|
if(!mShowStatus)
|
|
|
|
|
{
|
|
|
|
|
tableLayoutPanel1.SetColumnSpan(label1, 2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
@ -122,6 +128,22 @@ namespace Rs.Controls
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据穴位的状态获取穴位
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="status"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public List<TraySlot> GetSlots(ESlotStatus status)
|
|
|
|
|
{
|
|
|
|
|
List<TraySlot> slots = new List<TraySlot>();
|
|
|
|
|
foreach (KeyValuePair<int,TraySlot> item in traySlotsDic)
|
|
|
|
|
{
|
|
|
|
|
if (item.Value.SlotStatus == status)
|
|
|
|
|
slots.Add(item.Value);
|
|
|
|
|
}
|
|
|
|
|
return slots;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 通过穴位的索引获取穴位
|
|
|
|
|
/// </summary>
|
|
|
|
@ -471,6 +493,15 @@ namespace Rs.Controls
|
|
|
|
|
private void 禁用ToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
ChangeSlotStatus(ESlotStatus.Disable);
|
|
|
|
|
List<TraySlot> slots = new List<TraySlot>();
|
|
|
|
|
foreach (KeyValuePair<int, TraySlot> kvSlot in traySlotsDic)
|
|
|
|
|
{
|
|
|
|
|
if (drawRect.IntersectsWith(kvSlot.Value.Bound))
|
|
|
|
|
{
|
|
|
|
|
slots.Add(kvSlot.Value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DrawTrayAfterEvent?.Invoke(this, ESlotStatus.Disable, slots);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ChangeSlotStatus(ESlotStatus status)
|
|
|
|
@ -488,11 +519,29 @@ namespace Rs.Controls
|
|
|
|
|
private void 设置有料ToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
ChangeSlotStatus(ESlotStatus.Have);
|
|
|
|
|
List<TraySlot> slots = new List<TraySlot>();
|
|
|
|
|
foreach (KeyValuePair<int, TraySlot> kvSlot in traySlotsDic)
|
|
|
|
|
{
|
|
|
|
|
if (drawRect.IntersectsWith(kvSlot.Value.Bound))
|
|
|
|
|
{
|
|
|
|
|
slots.Add(kvSlot.Value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DrawTrayAfterEvent?.Invoke(this, ESlotStatus.Have,slots);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void 设置无料ToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
ChangeSlotStatus(ESlotStatus.NotHave);
|
|
|
|
|
List<TraySlot> slots = new List<TraySlot>();
|
|
|
|
|
foreach (KeyValuePair<int, TraySlot> kvSlot in traySlotsDic)
|
|
|
|
|
{
|
|
|
|
|
if (drawRect.IntersectsWith(kvSlot.Value.Bound))
|
|
|
|
|
{
|
|
|
|
|
slots.Add(kvSlot.Value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DrawTrayAfterEvent?.Invoke(this, ESlotStatus.NotHave,slots);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|