Repository navigation
Expand file tree
/
Copy pathAbstractProcessMethod.cs
More file actions
167 lines (115 loc) · 3.67 KB
/
Copy pathAbstractProcessMethod.cs
File metadata and controls
167 lines (115 loc) · 3.67 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Windows.Controls.WpfPropertyGrid;
using System.Windows.Controls.WpfPropertyGrid.Attributes;
using Hawk.Core.Utils;
using Hawk.Core.Utils.MVVM;
using Hawk.Core.Utils.Plugins;
namespace Hawk.ETL.Interfaces
{
[XFrmWorkIgnore]
public class AbstractProcessMethod : PropertyChangeNotifier, IDataProcess, IDictionarySerializable
{
#region Constants and Fields
protected string _name;
#endregion
#region Constructors and Destructors
public AbstractProcessMethod()
{
Name = TypeName;
}
#endregion
#region Events
#endregion
#region Properties
[Browsable(false)]
public IMainFrm MainFrm { get; set; }
[Browsable(false)]
public string MainPluginLocation { get; set; }
[Browsable(false)]
public PropertyGrid PropertyGrid
{
get
{
var property = new PropertyGrid();
property.SelectedObject=this;
return property;
}
}
/// <summary>
/// 模块名称
/// </summary>
[LocalizedCategory("1.基本信息")]
[LocalizedDisplayName("模块名称")]
public virtual string Name
{
get { return _name; }
set
{
if (_name == value) return;
_name = value;
OnPropertyChanged("Name");
if (MainDescription.IsUIForm)
{
var dock = MainFrm as IDockableManager;
var view = dock?.ViewDictionary.FirstOrDefault(d => d.Model == this);
if(view==null)
return;
dynamic container = view.Container;
container.Title = _name;
}
}
}
[Browsable(false)]
public bool IsOpen { get; set; }
[Browsable(false)]
public IDataManager SysDataManager { get; set; }
[Browsable(false)]
public IProcessManager SysProcessManager { get; set; }
[Browsable(false)]
public string TypeName => AttributeHelper.GetCustomAttribute(GetType()).Name;
[Browsable(false)]
public string LogoURL => AttributeHelper.GetCustomAttribute(GetType()).LogoURL;
#endregion
#region Implemented Interfaces
#region IBackgroundMethod
public virtual void ReportFinalResult()
{
}
#endregion
#region IDictionarySerializable
public virtual void DictDeserialize(IDictionary<string, object> dicts, Scenario scenario = Scenario.Database)
{
Name = dicts.Set("Name", Name);
}
public virtual FreeDocument DictSerialize(Scenario scenario = Scenario.Database)
{
var dict = new FreeDocument
{
{"Name", Name},
{"Type", this.GetType().Name},
};
return dict;
}
#endregion
#region IProcess
public virtual bool Close()
{
return true;
}
public virtual bool Process()
{
return true;
}
public virtual bool Init()
{
return true;
}
#endregion
#endregion
#region Methods
#endregion
}
}