Exemple #1
0
        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);
        }
Exemple #2
0
        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);
            }
        }