基线 SVN r240
SVN-Revision: r240
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Lskj.Interface.Api
|
||||
{
|
||||
public class PropertyBase
|
||||
{
|
||||
|
||||
private Dictionary<string, object> properties = new Dictionary<string, object>();
|
||||
|
||||
protected virtual object GetVal(string name, object defautVal = null)
|
||||
{
|
||||
object val;
|
||||
if (properties.ContainsKey(name) && (val = properties[name]) != null)
|
||||
{
|
||||
return val;
|
||||
}
|
||||
else
|
||||
{
|
||||
val = defautVal;
|
||||
properties[name] = val;
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void SetVal(string name, object val)
|
||||
{
|
||||
properties[name] = val;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user