110,534
社区成员
发帖
与我相关
我的任务
分享
private string _abase;
private string _acoating;
private string _aholding;
private string _amin;
public string Abase
{
get { return _abase; }
set
{
this._abase = value;
NotifyPropertyChanged("Abase");
}
}
public string Acoating
{
get { return _acoating; }
set
{
this._acoating = value;
NotifyPropertyChanged("Acoating");
}
}
public string Aholding
{
get { return _aholding; }
set
{
this._aholding = value;
NotifyPropertyChanged("Aholding");
}
}
public string Amin
{
get { return _amin; }
set
{
this._amin = value;
NotifyPropertyChanged("Amin");
}
}
public string Abase
{
get { return _abase; }
set
{
this._abase = value;
NotifyPropertyChanged("Abase");
}
}
<#@ template debug="true" hostspecific="false" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".cs" #>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 命名空间
{
partial class 类名
{
<#
// 属性名称数组。
string[] propertyNames = { "Abase" };
string fieldName;
foreach (var propertyName in propertyNames)
{
// 属性名称长度不小于 2 个字符。
fieldName = "_" + propertyName[0] + propertyName.Substring(1);
#>
public string <#= propertyName #>
{
get { return <#= fieldName #>; }
set
{
this.<#= fieldName #> = value;
NotifyPropertyChanged("<#= propertyName #>");
}
}
private string <#= fieldName #>;
<#
}
#>
}
}
public enum a { base, coating, holding, min }
string[] _ = new string[4];
string Get(a p){ return _[(int)p]; }
void Set(a p, string v){ _[(int)p] = v; }