blob: 78f95634dd39ee4c4415e6c10704ec903d8c1c38 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
using System;
namespace Xamarin.PropertyEditing.Mac
{
internal enum ProxyRowType
{
SingleView,
FirstView,
LastView
}
internal class RowProxyResponder
{
protected WeakReference<PropertyEditorControl> editorControl;
readonly ProxyRowType rowType;
public RowProxyResponder (PropertyEditorControl editorControl, ProxyRowType rowType)
{
this.rowType = rowType;
this.editorControl = new WeakReference<PropertyEditorControl> (editorControl);
}
public bool NextResponder()
{
if (this.editorControl.TryGetTarget (out var editor))
{
if (this.rowType == ProxyRowType.LastView || this.rowType == ProxyRowType.SingleView) {
editor.OnNextResponderRequested ();
return true;
}
}
return false;
}
public bool PreviousResponder ()
{
if (this.editorControl.TryGetTarget (out var editor))
{
if (this.rowType == ProxyRowType.FirstView || this.rowType == ProxyRowType.SingleView) {
editor.OnPreviousResponderRequested ();
return true;
}
}
return false;
}
}
}
|