{
[EditorBrowsable(EditorBrowsableState.Never)]
[StructLayout(LayoutKind.Sequential)]
- public struct GestureInfoType {
+ public struct GestureInfoType : IEquatable<GestureInfoType>
+ {
[EditorBrowsable(EditorBrowsableState.Never)]
public AccessibilityGesture type { get; set; }
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(System.Object obj)
{
- if ((obj == null) || !this.GetType().Equals(obj.GetType()))
+ if(obj is GestureInfoType)
+ {
+ return this.Equals((GestureInfoType)obj);
+ }
+ return false;
+ }
+
+ public bool Equals(GestureInfoType other)
+ {
+ if ((other == null) || !this.GetType().Equals(other.GetType()))
return false;
- GestureInfoType sec = (GestureInfoType)obj;
+ GestureInfoType sec = (GestureInfoType)other;
return
type == sec.type &&
xBeg == sec.xBeg &&
}
[EditorBrowsable(EditorBrowsableState.Never)]
+ public static bool operator ==(GestureInfoType arg1, GestureInfoType arg2)
+ {
+ return arg1.Equals(arg2);
+ }
+
+ /// <summary>
+ /// The != operator.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static bool operator !=(GestureInfoType arg1, GestureInfoType arg2)
+ {
+ return !arg1.Equals(arg2);
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode()
{
return Tuple.Create((int)type, xBeg, xEnd, yBeg, yEnd, (int)state, eventTime).GetHashCode();
}
}
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class GestureInfoEventArgs : EventArgs
+ {
+ public GestureInfoType GestureInfo { get; internal set; }
+ public int Consumed { get; set; }
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class GetDescriptionEventArgs : EventArgs
+ {
+ public string Description { get; internal set; }
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class GetNameEventArgs : EventArgs
+ {
+ public string Description { get; internal set; }
+ }
+
/// <summary>
/// View is the base class for all views.
/// </summary>
private GestureInfoHandlerType gestureInfoCallback;
private EventHandler<GestureInfoEventArgs> gestureInfoHandler;
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class GestureInfoEventArgs : EventArgs
- {
- public GestureInfoType gestureInfo { get; internal set; }
- public int boolValue { get; set; }
- }
-
private void OnGestureInfoEvent(IntPtr data) {
if (data == IntPtr.Zero)
return;
var arg = new GestureInfoEventArgs();
- arg.boolValue = AccessibilityDoGestureSignal.GetResult(data);
- arg.gestureInfo = (GestureInfoType)Marshal.PtrToStructure(data, typeof(GestureInfoType));
+ arg.Consumed = AccessibilityDoGestureSignal.GetResult(data);
+ arg.GestureInfo = (GestureInfoType)Marshal.PtrToStructure(data, typeof(GestureInfoType));
gestureInfoHandler?.Invoke(this, arg);
- AccessibilityDoGestureSignal.SetResult(data, Convert.ToInt32(arg.boolValue));
+ AccessibilityDoGestureSignal.SetResult(data, Convert.ToInt32(arg.Consumed));
}
// This uses DoGestureInfo signal from C++ API.
private GetDescriptionHandlerType getDescriptionCallback;
private EventHandler<GetDescriptionEventArgs> getDescriptionHandler;
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class GetDescriptionEventArgs : EventArgs
- {
- public string description { get; internal set; }
- }
-
private void OnGetDescriptionEvent(IntPtr data) {
if (data == IntPtr.Zero)
return;
var arg = new GetDescriptionEventArgs();
- arg.description = StringToVoidSignal.ConvertParam1(data);
+ arg.Description = StringToVoidSignal.ConvertParam1(data);
getDescriptionHandler?.Invoke(this, arg);
}
private GetNameHandlerType getNameCallback;
private EventHandler<GetNameEventArgs> getNameHandler;
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class GetNameEventArgs : EventArgs
- {
- public string description { get; internal set; }
- }
-
private void OnGetNameEvent(IntPtr data) {
if (data == IntPtr.Zero)
return;
var arg = new GetNameEventArgs();
- arg.description = StringToVoidSignal.ConvertParam1(data);
+ arg.Description = StringToVoidSignal.ConvertParam1(data);
getNameHandler?.Invoke(this, arg);
}