-
-
Notifications
You must be signed in to change notification settings - Fork 401
Expand file tree
/
Copy pathRootList.cs
More file actions
53 lines (48 loc) · 1.26 KB
/
RootList.cs
File metadata and controls
53 lines (48 loc) · 1.26 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
//-----------------------------------------------------------------------
// <copyright file="RootList.cs" company="Marimer LLC">
// Copyright (c) Marimer LLC. All rights reserved.
// Website: https://cslanet.com
// </copyright>
// <summary>no summary</summary>
//-----------------------------------------------------------------------
namespace Csla.Test.Basic
{
[Serializable]
public class RootList : BusinessBindingListBase<RootList, RootListChild>
{
protected override object AddNewCore()
{
RootListChild child = new RootListChild();
Add(child);
return child;
}
[Create]
private void Create()
{
AllowNew = true;
AllowEdit = true;
AllowRemove = true;
}
}
[Serializable]
public class RootListChild : BusinessBase<RootListChild>
{
public static PropertyInfo<int> DataProperty = RegisterProperty<int>(c => c.Data);
public int Data
{
get { return GetProperty(DataProperty); }
set { SetProperty(DataProperty, value); }
}
public string[] GetRuleDescriptions()
{
string[] result = BusinessRules.GetRuleDescriptions();
if (result == null)
result = [];
return result;
}
public RootListChild()
{
MarkAsChild();
}
}
}