forked from SergiyStoyan/PdfDocumentParser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFieldControl.cs
55 lines (49 loc) · 1.78 KB
/
FieldControl.cs
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
49
50
51
52
53
54
55
//********************************************************************************************
//Author: Sergiy Stoyan
// s.y.stoyan@gmail.com, sergiy.stoyan@outlook.com, stoyan@cliversoft.com
// http://www.cliversoft.com
//********************************************************************************************
using System;
using System.Windows.Forms;
using System.Collections.Generic;
namespace Cliver.PdfDocumentParser
{
public partial class FieldControl : UserControl
{
public FieldControl()
{
InitializeComponent();
Leave += delegate (object sender, EventArgs e)
{
SetTagFromControl();
};
}
public void Initialize(DataGridViewRow row, object value, Template template/*, IEnumerable<Template.Field> fields*//*, TemplateForm templateForm*/, Action<DataGridViewRow> onLeft)
{
Row = row;
this.template = template;
//this.fields = fields;
//this.templateForm = templateForm;
this.onLeft = onLeft;
initialize(row, value);
}
public DataGridViewRow Row;
//protected TemplateForm templateForm;
protected Action<DataGridViewRow> onLeft = null;
//protected IEnumerable<Template.Field> fields = null;
protected Template template;
virtual protected void initialize(DataGridViewRow row, object value/*, TemplateForm templateForm*/)
{
throw new Exception("Not overridden!");
}
virtual protected object getObject()
{
throw new Exception("Not overridden!");
}
virtual public void SetTagFromControl()
{
Row.Tag = getObject();
onLeft?.Invoke(Row);
}
}
}