|
|
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);
|
|
|
}
|
|
|
}
|