blob: 6f0784e523cff94903f8eb5c5d5c2622794354e9 (
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 ProxyRowResponder
{
protected WeakReference<PropertyEditorControl> editorControl;
readonly ProxyRowType rowType;
public ProxyRowResponder (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;
}
}
}
|