Пример #1
0
        public IList <CodeAttributeArgument> CreatePropertyExpressions()
        {
            List <CodeAttributeArgument> lst = new List <CodeAttributeArgument>();

            if (_values != null && _values.Count > 0)
            {
                if (_defValues == null)
                {
                    _defValues = new Dictionary <string, object>();
                }
                if (_defValues.Count == 0)
                {
                    GetProperties();
                }
                foreach (KeyValuePair <string, object> kv in _values)
                {
                    if (_defValues.ContainsKey(kv.Key))
                    {
                        if (VPLUtil.IsValueEqual(kv.Value, _defValues[kv.Key]))
                        {
                            continue;
                        }
                    }
                    lst.Add(new CodeAttributeArgument(kv.Key, ObjectCreationCodeGen.ObjectCreationCode(kv.Value)));
                }
            }
            return(lst);
        }