Example #1
0
        public void SetObjectTmpValue(Doer doer, string key, object objectValue, bool isAdd)
        {
            if (StringConst.String_nil.Equals(objectValue))
            {
                doer.RemoveTmp <object>(key);
                return;
            }

            if (!isAdd)
            {
                doer.SetTmp(key, objectValue);
                return;
            }

            // add
            if (objectValue is int i)
            {
                doer.AddTmp(key, i);
                return;
            }

            if (objectValue is float f)
            {
                doer.AddTmp(key, f);
                return;
            }

            if (objectValue is string s)
            {
                doer.AddTmp(key, s);
                return;
            }
        }