Exemplo n.º 1
0
        public string GetString(string name)
        {
            name = name.ToLower();
            var returnValue = _dataNvc[name];

            if (returnValue == null && _dataObj != null)
            {
                var obj = ExtendAttributesUtils.Eval(_dataObj, name);
                if (obj != null)
                {
                    if (obj is string)
                    {
                        returnValue = _dataNvc[name] = obj as string;
                    }
                    else
                    {
                        returnValue = _dataNvc[name] = obj.ToString();
                    }
                }
            }

            if (!string.IsNullOrEmpty(returnValue))
            {
                returnValue = ExtendAttributesUtils.UnFilterSql(returnValue);
            }

            return(returnValue ?? string.Empty);
        }
Exemplo n.º 2
0
 public override string ToString()
 {
     if (_dataNvc != null && _dataNvc.Count > 0)
     {
         return(ExtendAttributesUtils.NameValueCollectionToString(_dataNvc));
     }
     return(string.Empty);
 }
Exemplo n.º 3
0
        public string ToString(List <string> lowerCaseExcludeAttributeNames)
        {
            if (_dataNvc == null || _dataNvc.Count <= 0 || lowerCaseExcludeAttributeNames == null)
            {
                return(string.Empty);
            }

            var nvc = new NameValueCollection();

            foreach (string key in _dataNvc.Keys)
            {
                if (!lowerCaseExcludeAttributeNames.Contains(key))
                {
                    nvc[key] = _dataNvc[key];
                }
            }
            return(ExtendAttributesUtils.NameValueCollectionToString(nvc));
        }
Exemplo n.º 4
0
        public bool ContainsKey(string name)
        {
            name = name.ToLower();
            var returnValue = _dataNvc[name];

            if (returnValue == null && _dataObj != null)
            {
                var obj = ExtendAttributesUtils.Eval(_dataObj, name);
                if (obj != null)
                {
                    if (obj is string)
                    {
                        returnValue = _dataNvc[name] = obj as string;
                    }
                    else
                    {
                        returnValue = _dataNvc[name] = obj.ToString();
                    }
                }
            }

            return(returnValue != null);
        }
Exemplo n.º 5
0
 public void Load(string str)
 {
     _dataNvc = ExtendAttributesUtils.ToNameValueCollection(str);
 }