You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kev/Drawer/DrawerInterface/IDrawerInteract.cs

78 lines
2.3 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DrawerInterface
{
/// <summary>
/// The interface data type.
/// </summary>
public enum InterfaceDataType
{
Unkown=0, // 原始数据或未知
PointOfSurface = 1001, // 曲面上的点,通过该类型的点可以获取曲面Z值
}
/// <summary>
/// 自定义事件参数类.
/// </summary>
public class RequestDataEventArgs : EventArgs
{
/// <summary>
/// 数据状态0-选择的数据1-所有数据
/// </summary>
public int DataStatus { get; set; }
/// <summary>
/// 数据类型, 0-所有数据1-点类2-线类数据
/// </summary>
public int DataType { get; set; } = 0;
/// <summary>
/// 数据的其它说明,例如图层、名称等
/// </summary>
public string DataInfo { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="RequestDataEventArgs"/> class.
/// </summary>
public RequestDataEventArgs()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="RequestDataEventArgs"/> class.
/// </summary>
/// <param name="dataStatus">The data status.</param>
/// <param name="dataType">The data type.</param>
/// <param name="dataInfo">The data info.</param>
public RequestDataEventArgs(int dataStatus, int dataType, string dataInfo)
{
this.DataStatus = dataStatus;
this.DataType = dataType;
this.DataInfo = dataInfo;
}
}
public class ResponseDataEventArgs : EventArgs
{
public int Operation { get; set; }
public string DataContent { get; set; }
public ResponseDataEventArgs() { }
public ResponseDataEventArgs(string dataContent)
{
this.DataContent = dataContent;
}
}
public interface IDrawerInteract
{
event EventHandler<RequestDataEventArgs> DataRequestEvent;
event EventHandler<ResponseDataEventArgs> DataResponseEvent;
Form UserForm { get; set; }
void RequestDataProcess(ResponseDataEventArgs e);
}
}