Пример #1
0
        private List<PropertyDef> GetSortedProperties()
        {
            // Poor man's cache refresh, assumes PropertyDefs are immutable, and property lists would only ever be changed by adding xor removing properties,
            // resulting in a different number of properties in the cached sorted property list.
            if (_sortedProperties != null && (_properties.Count != _sortedProperties.Count))
            {
                _sortedProperties = null;
            }

            if (_sortedProperties == null)
            {
                _sortedProperties = new List<PropertyDef>(_properties);
                _sortedProperties.Sort((a, b) => String.Compare(a.Name, b.Name, false, CultureInfo.InvariantCulture));
            }

            return _sortedProperties;
        }