forked from zzzprojects/System.Linq.Dynamic.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProperty.cs
More file actions
50 lines (32 loc) · 1.22 KB
/
Property.cs
File metadata and controls
50 lines (32 loc) · 1.22 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
using System.Collections.Generic;
using System.Text;
using DynamicLinqWebDocs.Models;
namespace DynamicLinqWebDocs.ViewModels
{
public class Property
{
public string Namespace { get; set; }
public string Class { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string ValueType { get; set; }
public string ValueTypeDescription { get; set; }
public string Remarks { get; set; }
public bool IsStatic { get; set; }
public IList<Example> Examples { get; set; }
public Frameworks Frameworks { get; set; }
public PropertyAccessors Accessors { get; set; }
public string GenerateCSharpSyntaxCode()
{
var sb = new StringBuilder();
sb.Append("public");
if (IsStatic) sb.Append(" static");
sb.AppendFormat(" {0}", ValueType);
sb.AppendFormat(" {0} {{ ", Name);
if ((Accessors & PropertyAccessors.Get) > 0) sb.AppendFormat("get; ");
if ((Accessors & PropertyAccessors.Set) > 0) sb.AppendFormat("set; ");
sb.AppendFormat("}}");
return sb.ToString();
}
}
}