using System;
|
using System.Collections.Generic;
|
using CoreAnimation;
|
using CoreGraphics;
|
using UIKit;
|
|
//两个问题,第一个是RCU协议,第二个是WIFI过多 23个
|
namespace Shared{
|
|
/// <summary>
|
/// 根视图,所有视图的父视图
|
/// </summary>
|
class RootView : ViewGroup { }
|
/// <summary>
|
/// 所有类的基类,已经全面检查
|
/// </summary>
|
public abstract class View
|
{
|
~View()
|
{
|
#if DEBUG
|
System.Console.WriteLine("=====" + GetType() + " " + Name);
|
#endif
|
if (this is ViewGroup)
|
{
|
var viewGroup = this as ViewGroup;
|
if (viewGroup.realViewGroup != RealView)
|
{
|
foreach (var view in viewGroup.viewList)
|
{
|
view.RealView.Dispose();
|
}
|
viewGroup.realViewGroup?.Dispose();
|
}
|
}
|
|
RealView?.Dispose();
|
}
|
|
|
/// <summary>
|
/// 是否需要更新控件
|
/// </summary>
|
/// <value>The is need refresh.</value>
|
protected bool IsCanRefresh
|
{
|
get
|
{
|
View tempView = Parent;
|
while (tempView != null)
|
{
|
//如果父视图是RootView,那说明视图已经加载完成,可以刷新视图
|
if (tempView.GetType() == typeof(RootView))
|
{
|
return true;
|
}
|
tempView = tempView.Parent;
|
}
|
return false;
|
}
|
}
|
|
|
/// <summary>
|
/// 当前对应的IOS控件
|
/// </summary>
|
protected UIView uiView;
|
|
/// <summary>
|
/// 内边距
|
/// </summary>
|
/// <value>The padding.</value>
|
public virtual Padding Padding
|
{
|
get;
|
set;
|
}
|
|
/// <summary>
|
/// 是否使能
|
/// </summary>
|
/// <value><c>true</c> if enable; otherwise, <c>false</c>.</value>
|
public virtual bool Enable
|
{
|
get;
|
set;
|
}
|
|
int height=LayoutParams.MatchParent;
|
/// <summary>
|
/// 控件的高度
|
/// </summary>
|
/// <value>The height.</value>
|
public virtual int Height
|
{
|
get
|
{
|
return IsCanRefresh ? (int)uiView.Frame.Height : height;
|
}
|
set
|
{
|
|
height = value;
|
|
if (!IsCanRefresh)
|
return;
|
|
var frame = uiView.Frame;
|
var beforeValue = frame.Height;
|
if (value == LayoutParams.MatchParent)
|
{
|
frame.Height = Parent.Height;
|
uiView.Frame = frame;
|
}
|
else
|
{
|
frame.Height = value;
|
uiView.Frame = frame;
|
}
|
|
if (frame.Height != beforeValue)
|
{
|
SizeChangeEventHandler?.Invoke(this, new Size((int)frame.Width, (int)frame.Height));
|
}
|
|
//如果父视图是VerticalScrolViewLayout,那需要重新刷新排列
|
if (Parent is VerticalScrolViewLayout)
|
{
|
(Parent as VerticalScrolViewLayout).ReLocation();
|
}
|
|
if (Parent is VerticalRefreshLayout)
|
{
|
(Parent as VerticalRefreshLayout).ReLocation();
|
}
|
}
|
}
|
|
int width = LayoutParams.MatchParent;
|
/// <summary>
|
/// 控件宽度
|
/// </summary>
|
/// <value>The width.</value>
|
public virtual int Width
|
{
|
get
|
{
|
return IsCanRefresh ? (int)uiView.Frame.Width : width;
|
}
|
set
|
{
|
width = value;
|
|
if (!IsCanRefresh)
|
return;
|
|
|
var frame = uiView.Frame;
|
var beforeValue = frame.Width;
|
if (value == LayoutParams.MatchParent)
|
{
|
frame.Width = Parent.Width;
|
uiView.Frame = frame;
|
}
|
else
|
{
|
frame.Width = value;
|
uiView.Frame = frame;
|
}
|
|
if (frame.Width != beforeValue)
|
{
|
SizeChangeEventHandler?.Invoke(this, new Size((int)frame.Width, (int)frame.Height));
|
}
|
|
//如果父视图是HorizontalScrolViewLayout,那需要重新刷新排列
|
if (Parent is HorizontalScrolViewLayout)
|
{
|
(Parent as HorizontalScrolViewLayout).ReLocation();
|
}
|
|
}
|
}
|
|
Gravity gravity = Gravity.Frame;
|
/// <summary>
|
/// 当前视图对齐方式
|
/// </summary>
|
/// <value>The gravity.</value>
|
public Gravity Gravity
|
{
|
get
|
{
|
return gravity;
|
}
|
set
|
{
|
gravity = value;
|
if (uiView.Superview == null)
|
{
|
return;
|
}
|
switch (value)
|
{
|
case Gravity.TopLeft:
|
X = 0;
|
Y = 0;
|
break;
|
case Gravity.TopCenter:
|
X = ((int)uiView.Superview.Frame.Width - Width) / 2;
|
Y = 0;
|
break;
|
case Gravity.TopRight:
|
X = (int)uiView.Superview.Frame.Width - Width;
|
Y = 0;
|
break;
|
case Gravity.CenterLeft:
|
X = 0;
|
Y = ((int)uiView.Superview.Frame.Height - Height) / 2;
|
break;
|
case Gravity.Center:
|
X = ((int)uiView.Superview.Frame.Width - Width) / 2;
|
Y = ((int)uiView.Superview.Frame.Height - Height) / 2;
|
break;
|
case Gravity.CenterRight:
|
X = (int)uiView.Superview.Frame.Width - Width;
|
Y = ((int)uiView.Superview.Frame.Height - Height) / 2;
|
break;
|
case Gravity.BottomLeft:
|
X = 0;
|
Y = (int)uiView.Superview.Frame.Height - Height;
|
break;
|
case Gravity.BottomCenter:
|
X = ((int)uiView.Superview.Frame.Width - Width) / 2;
|
Y = (int)uiView.Superview.Frame.Height - Height;
|
break;
|
case Gravity.BottomRight:
|
X = (int)uiView.Superview.Frame.Width - Width;
|
Y = (int)uiView.Superview.Frame.Height - Height;
|
break;
|
case Gravity.CenterVertical:
|
Y = ((int)uiView.Superview.Frame.Height - Height) / 2;
|
break;
|
case Gravity.CenterHorizontal:
|
X = ((int)uiView.Superview.Frame.Width - Width) / 2;
|
break;
|
default:
|
break;
|
}
|
}
|
}
|
|
/// <summary>
|
/// 创新需要创新的信息
|
/// </summary>
|
public virtual void Refresh()
|
{
|
Width = width;
|
Height = height;
|
Gravity = gravity;
|
Animate = animate;
|
Radius = radius;
|
}
|
|
/// <summary>
|
/// 左边线位置
|
/// </summary>
|
/// <value>The bottom.</value>
|
public int Bottom
|
{
|
get
|
{
|
return Height + Y;
|
}
|
}
|
|
/// <summary>
|
/// 右边线位置
|
/// </summary>
|
/// <value>The right.</value>
|
public int Right
|
{
|
get
|
{
|
return Width + X;
|
}
|
}
|
|
/// <summary>
|
/// 名称
|
/// </summary>
|
/// <value>The name.</value>
|
public string Name { get; set; }
|
|
int x;
|
/// <summary>
|
/// X轴坐标
|
/// </summary>
|
/// <value>The x.</value>
|
public virtual int X
|
{
|
get
|
{
|
if (Parent != null && Parent is HorizontalScrolViewLayout)
|
{
|
return (int)uiView.Frame.X;
|
}
|
else
|
{
|
return x;
|
}
|
}
|
set
|
{
|
x = value;
|
|
//这个部局,不需要处理坐标
|
if (Parent != null && Parent is HorizontalScrolViewLayout)
|
{
|
return;
|
}
|
else
|
{
|
var frame = uiView.Frame;
|
frame.X = value;
|
uiView.Frame = frame;
|
}
|
}
|
}
|
|
int y;
|
/// <summary>
|
/// Y轴坐标
|
/// </summary>
|
/// <value>The y.</value>
|
public virtual int Y
|
{
|
get
|
{
|
if (Parent != null && (Parent is VerticalScrolViewLayout || Parent is VerticalRefreshLayout))
|
{
|
return (int)uiView.Frame.Y;
|
}
|
else
|
{
|
return y;
|
}
|
}
|
set
|
{
|
y = value;
|
|
//这个部局,不需要处理坐标
|
if (Parent != null && (Parent is VerticalScrolViewLayout || Parent is VerticalRefreshLayout))
|
{
|
return;
|
}
|
else {
|
var frame = uiView.Frame;
|
frame.Y = value;
|
uiView.Frame = frame;
|
}
|
}
|
}
|
|
/// <summary>
|
/// 当前窗口大小及位置
|
/// </summary>
|
/// <value>The frame.</value>
|
public virtual Size Size
|
{
|
get
|
{
|
return new Size(Width, Height);
|
}
|
set
|
{
|
Width = value.Width;
|
Height = value.Height;
|
}
|
}
|
|
/// <summary>
|
/// 父容器
|
/// </summary>
|
/// <value>The parent.</value>
|
public ViewGroup Parent;
|
bool isUp;
|
bool longClicked;
|
System.Threading.Thread thread;
|
/// <summary>
|
/// 点击事件
|
/// </summary>
|
/// <returns>反馈当前事件是否已经处理</returns>
|
/// <param name="e">事件</param>
|
/// <param name="point">当前点击位置</param>
|
internal virtual bool TouchEvent(EventActions eventAction, CGPoint point)
|
{
|
switch (eventAction)
|
{
|
case EventActions.Down:
|
isUp = false;
|
longClicked = false;
|
|
MouseDownEventHandler?.Invoke(this, new MouseEventArgs { X = (int)point.X, Y = (int)point.Y });
|
if (MouseLongEventHandler != null)
|
{
|
try
|
{
|
if (thread != null && thread.IsAlive)
|
{
|
thread.Abort();
|
}
|
thread = new System.Threading.Thread(() =>
|
{
|
System.Threading.Thread.Sleep(800);
|
if (!isUp)
|
{
|
longClicked = true;
|
Application.RunOnMainThread(() =>
|
{
|
MouseLongEventHandler(this, new MouseEventArgs { X = (int)point.X, Y = (int)point.Y });
|
});
|
}
|
})
|
{ IsBackground = true };
|
thread.Start();
|
}
|
catch { }
|
}
|
break;
|
case EventActions.Move:
|
MouseMoveEventHandler?.Invoke(this, new MouseEventArgs { X = (int)point.X, Y = (int)point.Y });
|
break;
|
case EventActions.Up:
|
isUp = true;
|
if (!longClicked)
|
{
|
MouseUpEventHandler?.Invoke(this, new MouseEventArgs { X = (int)point.X, Y = (int)point.Y });
|
}
|
break;
|
case EventActions.Cancel:
|
isUp = true;
|
break;
|
}
|
|
return false;
|
}
|
|
/// <summary>
|
/// 点击按下事件
|
/// </summary>
|
public EventHandler<MouseEventArgs> MouseDownEventHandler;
|
/// <summary>
|
/// 控件上移动事件
|
/// </summary>
|
public EventHandler<MouseEventArgs> MouseMoveEventHandler;
|
|
/// <summary>
|
/// 点击弹起事件
|
/// </summary>
|
public EventHandler<MouseEventArgs> MouseUpEventHandler;
|
|
public EventHandler<MouseEventArgs> MouseLongEventHandler;
|
|
/// <summary>
|
/// 大小变化事件
|
/// </summary>
|
public EventHandler<Size> SizeChangeEventHandler;
|
|
|
uint backgroundColor;
|
/// <summary>
|
/// 背景颜色
|
/// </summary>
|
/// <value>The color of the background.</value>
|
public virtual uint BackgroundColor
|
{
|
get
|
{
|
return backgroundColor;
|
}
|
set
|
{
|
backgroundColor = value;
|
if (!IsCanRefresh)
|
{
|
return;
|
}
|
byte r, g, b, a;
|
r = (byte)(backgroundColor / 256 / 256 % 256);
|
g = (byte)(backgroundColor / 256 % 256);
|
b = (byte)(backgroundColor % 256);
|
a = (byte)(backgroundColor / 256 / 256 / 256 % 256);
|
uiView.BackgroundColor = UIKit.UIColor.FromRGBA(r, g, b, a);
|
}
|
}
|
|
/// <summary>
|
/// 获取真实的控件
|
/// </summary>
|
/// <value>The real view.</value>
|
internal UIKit.UIView RealView
|
{
|
get { return uiView; }
|
}
|
|
/// <summary>
|
/// 将控制移到最前
|
/// </summary>
|
public virtual void BringToFront()
|
{
|
if (!IsCanRefresh)
|
{
|
return;
|
}
|
uiView.Superview.BringSubviewToFront(uiView);
|
}
|
|
/// <summary>
|
/// 将控件移到最后
|
/// </summary>
|
public virtual void SendToBack()
|
{
|
if (!IsCanRefresh)
|
{
|
return;
|
}
|
uiView.Superview.SendSubviewToBack(uiView);
|
}
|
|
System.Collections.Generic.Dictionary<string, object> tag;
|
|
/// <summary>
|
/// 键值对,方便开发用
|
/// </summary>
|
/// <param name="key">Key.</param>
|
/// <param name="value">Value.</param>
|
public void AddTag(string key, object value)
|
{
|
if (tag == null)
|
{
|
tag = new System.Collections.Generic.Dictionary<string, object>();
|
}
|
tag.Remove(key);
|
tag.Add(key, value);
|
}
|
|
/// <summary>
|
/// 删除指定键值对
|
/// </summary>
|
/// <param name="key">Key.</param>
|
public void RemoveTag(string key)
|
{
|
if (tag == null)
|
{
|
return;
|
}
|
tag.Remove(key);
|
}
|
|
/// <summary>
|
/// 根据键获取值
|
/// </summary>
|
/// <returns>The tag by key.</returns>
|
/// <param name="key">Key.</param>
|
public object GetTagByKey(string key)
|
{
|
if (tag == null)
|
{
|
return null;
|
}
|
object value;
|
tag.TryGetValue(key, out value);
|
return value;
|
}
|
|
/// <summary>
|
/// 全部删除Tag
|
/// </summary>
|
/// <returns>The tag.</returns>
|
public void ClearTag()
|
{
|
if (tag != null)
|
{
|
tag.Clear();
|
}
|
}
|
|
/// <summary>
|
/// 方便开发者开发用
|
/// </summary>
|
public object Tag;
|
|
/// <summary>
|
/// 是否显示
|
/// </summary>
|
/// <value><c>true</c> if visible; otherwise, <c>false</c>.</value>
|
public bool Visible
|
{
|
get
|
{
|
return !uiView.Hidden;
|
}
|
set
|
{
|
uiView.Hidden = !value;
|
}
|
}
|
|
|
/// <summary>
|
/// 从父视图里面移除掉
|
/// </summary>
|
public virtual void RemoveFromParent()
|
{
|
if (Parent == null)
|
{
|
return;
|
}
|
|
Parent.Remove(this);
|
}
|
|
|
|
Animate animate = Animate.None;
|
/// <summary>
|
/// 动画方式
|
/// </summary>
|
/// <value>The animate.</value>
|
public Animate Animate
|
{
|
get
|
{
|
return animate;
|
}
|
set
|
{
|
animate = value;
|
if (!IsCanRefresh)
|
{
|
return;
|
}
|
|
var frameBefore = RealView.Frame;
|
var frame = frameBefore;
|
switch (animate)
|
{
|
case Animate.DownToUp:
|
frame.Y += RealView.Frame.Height;
|
RealView.Frame = frame;
|
UIView.AnimateNotify(0.6f, 0.001f, UIViewAnimationOptions.CurveLinear, () =>
|
{
|
RealView.Frame = frameBefore;
|
}, null);
|
break;
|
case Animate.UpToDown:
|
frame.Y -= RealView.Frame.Height;
|
RealView.Frame = frame;
|
UIView.AnimateNotify(0.6f, 0.001f, UIViewAnimationOptions.CurveLinear, () =>
|
{
|
RealView.Frame = frameBefore;
|
}, null);
|
break;
|
case Animate.LeftToRight:
|
System.Threading.Tasks.Task.Run(() =>
|
{
|
System.Threading.Thread.Sleep(1);
|
Application.RunOnMainThread(() =>
|
{
|
UIView.BeginAnimations("");
|
UIView.SetAnimationCurve(UIViewAnimationCurve.EaseInOut);
|
UIView.SetAnimationDuration(1.0);
|
UIView.SetAnimationTransition(UIViewAnimationTransition.FlipFromLeft, RealView, true);// cache:YES];
|
UIView.CommitAnimations();
|
});
|
});
|
break;
|
case Animate.RightToLeft:
|
System.Threading.Tasks.Task.Run(() =>
|
{
|
System.Threading.Thread.Sleep(1);
|
Application.RunOnMainThread(() =>
|
{
|
UIView.BeginAnimations("");
|
UIView.SetAnimationCurve(UIViewAnimationCurve.EaseInOut);
|
UIView.SetAnimationDuration(1.0);
|
UIView.SetAnimationTransition(UIViewAnimationTransition.FlipFromRight, RealView, true);// cache:YES];
|
UIView.CommitAnimations();
|
});
|
});
|
break;
|
case Animate.Rotation:
|
rotation();
|
break;
|
|
}
|
|
}
|
}
|
void rotation()
|
{
|
UIView.Animate(4, 0, UIViewAnimationOptions.CurveLinear, () =>
|
{
|
RealView.Transform = CGAffineTransform.Rotate(RealView.Transform, 3.1415926535898f / 2);
|
}, () =>
|
{
|
if (IsCanRefresh)
|
rotation();
|
});
|
}
|
|
/// <summary>
|
/// 透明度设置
|
/// </summary>
|
/// <value>The alpha.</value>
|
public nfloat Alpha
|
{
|
get
|
{
|
return uiView.Alpha;
|
}
|
set
|
{
|
uiView.Alpha = value;
|
}
|
}
|
|
|
|
|
|
//4个圆角分别对应的值
|
//float topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius;
|
///未实现,代完善
|
//public void SetAloneRadius(float topLeft, float topRight, float bottomLeft, float bottomRight)
|
//{
|
// IsSetAloneRadius = true;
|
// topLeftRadius = topLeft;
|
// topRightRadius = topRight;
|
// bottomLeftRadius = bottomLeft;
|
// bottomRightRadius = bottomRight;
|
// RefreshAloneCorner();
|
//}
|
|
//是否单独设置圆角
|
private bool IsSetAloneRadius;
|
float mAloneRadius;
|
float mRadiusId;
|
/// <summary>
|
/// 指定位置 设置相同的圆角
|
/// </summary>
|
public void SetCornerWithSameRadius(float mRadius, int mSetID)
|
{
|
//bool btopLeft, btopRight, bbottomLeft, bbottomRight;
|
IsSetAloneRadius = true;
|
mAloneRadius = mRadius;
|
mRadiusId = mSetID;
|
RefreshAloneCorner();
|
}
|
|
/// <summary>
|
/// 更新圆角
|
/// </summary>
|
/// <returns>The corner.</returns>
|
private void RefreshAloneCorner()
|
{
|
BackgroundColor = backgroundColor;
|
uiView.Layer.MasksToBounds = true;
|
UIRectCorner corner = (UIRectCorner)(mRadiusId);
|
if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
|
{
|
uiView.Layer.CornerRadius = mAloneRadius;
|
uiView.Layer.MaskedCorners = (CACornerMask)corner;
|
}
|
else
|
{
|
UIBezierPath mUIBezierPath = UIBezierPath.FromRoundedRect(uiView.Bounds, corner, new CoreGraphics.CGSize(mAloneRadius, mAloneRadius));
|
CAShapeLayer mCAShapeLayer = new CAShapeLayer();
|
mCAShapeLayer.Frame = uiView.Bounds;
|
mCAShapeLayer.Path = mUIBezierPath.CGPath;
|
uiView.Layer.Mask = mCAShapeLayer;
|
}
|
uiView.Layer.BorderWidth = BorderWidth;
|
byte r, g, b, a;
|
r = (byte)(borderColor / 256 / 256 % 256);
|
g = (byte)(borderColor / 256 % 256);
|
b = (byte)(borderColor % 256);
|
a = (byte)(borderColor / 256 / 256 / 256 % 256);
|
uiView.Layer.BorderColor = new CGColor(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);
|
|
}
|
|
|
|
uint radius;
|
/// <summary>
|
/// 圆角大小
|
/// </summary>
|
/// <value>The corner.</value>
|
public uint Radius
|
{
|
get
|
{
|
return radius;
|
}
|
set
|
{
|
IsSetAloneRadius = false;
|
radius = value;
|
if (!IsCanRefresh)
|
{
|
return;
|
}
|
refreshCorner();
|
}
|
}
|
|
|
/// <summary>
|
/// 更新圆角
|
/// </summary>
|
/// <returns>The corner.</returns>
|
void refreshCorner()
|
{
|
BackgroundColor = backgroundColor;
|
|
if (Radius == 0)
|
{
|
return;
|
}
|
|
uiView.Layer.MasksToBounds = true;
|
uiView.Layer.CornerRadius = Radius;
|
uiView.Layer.BorderWidth = BorderWidth;
|
|
byte r, g, b, a;
|
r = (byte)(borderColor / 256 / 256 % 256);
|
g = (byte)(borderColor / 256 % 256);
|
b = (byte)(borderColor % 256);
|
a = (byte)(borderColor / 256 / 256 / 256 % 256);
|
uiView.Layer.BorderColor = new CGColor(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);
|
|
}
|
|
|
uint borderWidth;
|
/// <summary>
|
/// 边框线大小
|
/// </summary>
|
/// <value>The width of the border.</value>
|
public uint BorderWidth
|
{
|
get
|
{
|
return borderWidth;
|
}
|
set
|
{
|
borderWidth = value;
|
Radius = radius;
|
}
|
}
|
|
uint borderColor = 0xFFCCCCCC;
|
/// <summary>
|
/// 边框线颜色
|
/// </summary>
|
public uint BorderColor
|
{
|
get
|
{
|
return borderColor;
|
}
|
set
|
{
|
borderColor = value;
|
Radius = radius;
|
}
|
}
|
|
/// <summary>
|
/// 旋转View
|
/// </summary>
|
/// <value>旋转角度</value>
|
public void SetRotation(float mRotation)
|
{
|
if (mRotation > 180) {
|
mRotation = mRotation - 360f;
|
}
|
var mCGAffineTransform = CGAffineTransform.MakeRotation((nfloat)(mRotation * Math.PI / 180.0));
|
uiView.Transform = mCGAffineTransform;
|
}
|
|
/// <summary>
|
/// 设置阴影效果
|
/// </summary>
|
/// <value>是否显示阴影</value>
|
public void SetViewShadow(bool bShow, float mOffsetY = 5.0f)
|
{
|
if (bShow)
|
{
|
uiView.Layer.ShadowOffset = new CGSize(0, mOffsetY);
|
uiView.Layer.ShadowOpacity = 0.5f;
|
uiView.Layer.ShadowColor = UIColor.Gray.CGColor;
|
uiView.ClipsToBounds = false;
|
}
|
else
|
{
|
//uiView.Layer.ShadowOffset = new CGSize(0, 0);
|
//uiView.Layer.ShadowOpacity = 0f;
|
uiView.ClipsToBounds = true;
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
/// 视图大小
|
/// </summary>
|
public class Size
|
{
|
/// <summary>
|
/// 视图大小
|
/// </summary>
|
/// <param name="width">Width.</param>
|
/// <param name="height">Height.</param>
|
public Size(int width,int height)
|
{
|
Width = width;
|
Height = height;
|
}
|
|
|
/// <summary>
|
/// 宽度
|
/// </summary>
|
public int Width {
|
get;
|
set;
|
}
|
/// <summary>
|
/// 高度
|
/// </summary>
|
public int Height {
|
get;
|
set;
|
}
|
|
}
|
|
/// <summary>
|
/// 内边距
|
/// </summary>
|
public class Padding
|
{
|
/// <summary>
|
/// 内边距
|
/// </summary>
|
/// <param name="top">Top.</param>
|
/// <param name="left">Left.</param>
|
/// <param name="bottom">Bottom.</param>
|
/// <param name="right">Right.</param>
|
public Padding(int top,int left,int bottom,int right)
|
{
|
Top = top;
|
Left = left;
|
Bottom = bottom;
|
Right = right;
|
}
|
/// <summary>
|
/// 顶部
|
/// </summary>
|
public int Top {
|
get;
|
set;
|
}
|
/// <summary>
|
/// 左边
|
/// </summary>
|
public int Left {
|
get;
|
set;
|
}
|
/// <summary>
|
/// 底部
|
/// </summary>
|
public int Bottom {
|
get;
|
set;
|
}
|
/// <summary>
|
/// 右边
|
/// </summary>
|
public int Right {
|
get;
|
set;
|
}
|
}
|
|
/// <summary>
|
/// 点击时基本参数
|
/// </summary>
|
public class MouseEventArgs : EventArgs
|
{
|
/// <summary>
|
/// X坐标
|
/// </summary>
|
public float X;
|
/// <summary>
|
/// Y坐标
|
/// </summary>
|
public float Y;
|
}
|
|
/// <summary>
|
/// 点击事件
|
/// </summary>
|
enum EventActions
|
{
|
/// <summary>
|
/// Down
|
/// </summary>
|
Down,
|
/// <summary>
|
/// Move
|
/// </summary>
|
Move,
|
/// <summary>
|
/// UP
|
/// </summary>
|
Up,
|
/// <summary>
|
/// Cancel
|
/// </summary>
|
Cancel,
|
}
|
}
|