using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace UserControlLib
|
|
{
|
|
public partial class UserReadOrWrite : UserControl
|
|
{
|
|
public UserReadOrWrite()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public string GroupId { get; set; }
|
|
|
|
public string ButtonLeftText
|
|
{
|
|
|
|
get
|
|
{
|
|
return button_Read.Text;
|
|
}
|
|
set
|
|
{
|
|
button_Read.Text = value;
|
|
}
|
|
|
|
}
|
|
|
|
public string ButtonRightText
|
|
{
|
|
|
|
get
|
|
{
|
|
return button_Write.Text;
|
|
}
|
|
set
|
|
{
|
|
button_Write.Text = value;
|
|
}
|
|
|
|
}
|
|
|
|
public string CheckBoxText
|
|
{
|
|
|
|
get
|
|
{
|
|
return checkBox_Monitor.Text;
|
|
}
|
|
set
|
|
{
|
|
checkBox_Monitor.Text = value;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
public event Action<int, string> UserReadOrWriteHandleEvent;
|
|
|
|
public event Action<bool> DataMonitorEvent;
|
|
|
|
private void button_Read_Click(object sender, EventArgs e)
|
|
{
|
|
UserReadOrWriteHandleEvent?.Invoke(0, GroupId);
|
|
}
|
|
|
|
private void button_Write_Click(object sender, EventArgs e)
|
|
{
|
|
UserReadOrWriteHandleEvent?.Invoke(1, GroupId);
|
|
}
|
|
|
|
private void checkBox_Monitor_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
DataMonitorEvent?.Invoke(checkBox_Monitor.Checked);
|
|
}
|
|
}
|
|
}
|