CSVAttribute.cs
715 字节
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; }
}
}
}