-
Notifications
You must be signed in to change notification settings - Fork 1
/
Agent.cs
51 lines (47 loc) · 1.59 KB
/
Agent.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
namespace NonPersistentObjectsDemo.Module.BusinessObjects {
[DomainComponent]
public class Agent : NonPersistentObjectImpl {
public static int Sequence;
public Agent() : base() { }
[VisibleInDetailView(false)]
[VisibleInListView(false)]
[XmlIgnore]
[DevExpress.ExpressApp.Data.Key]
public int ID { get; set; }
private string _Name;
public string Name {
get { return _Name; }
set { SetPropertyValue<string>(ref _Name, value); }
}
private double _Progress;
public double Progress {
get { return _Progress; }
set { SetPropertyValue<double>(ref _Progress, value); }
}
}
class NPAgentAdapter : NonPersistentObjectAdapter<Agent, int> {
public NPAgentAdapter(NonPersistentObjectSpace npos) : base(npos) { }
protected override Agent LoadSameObject(Agent obj) {
Agent result = new Agent();
result.ID = obj.ID;
result.Name = obj.Name;
result.Progress = obj.Progress;
return result;
}
protected override bool ThrowOnAcceptingMismatchedObject => true;
}
/*
* Also, see the overridden GetObjectSpaceToShowDetailViewFrom method
* in the XafApplication (WinApplication / WebApplication) descendant.
*
*/
}