public bool AppendDataRule(DataRule dr) { if (dr != null) { if (!mDataRules.ContainsKey(dr.RuleName)) { dr.OnDefaultValueEvent += new DefaultValueEventHandle(GetDefaultValue); mDataRules.Add(dr.RuleName, dr); return(true); } } return(false); }
public DataRule GetDataRule(string rulename, RefreshType rt) { switch (rt) { case RefreshType.OnlyCache: return(FindDataRule(rulename)); case RefreshType.NoCache: return(DataServices.LoadInfo(rulename)); default: DataRule dr = FindDataRule(rulename); if (dr == null) { dr = DataServices.LoadInfo(rulename); AppendDataRule(dr); } return(dr); } }