CSVAttribute.cs
962 字节
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.LoadCSVLibrary
{
//这里利用AttributeUsage 来设置我们的自定义属性的应用范围,这里定义的可以用于类,结构和方法的声明
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
public class CSVAttribute : Attribute
{
public CSVAttribute(string fieldName)
{
FieldName = fieldName;
}
private string fieldName;
public string FieldName
{
get { return fieldName; }
set { fieldName = value; }
}
}
public class EditableAttribute : Attribute
{
public EditableAttribute(string axisname)
{
Axisname = axisname;
}
public string Axisname
{
get;
set;
}
}
}