Catel.Runtime.Serialization.SerializationManager.GetRegularPropertyNames C# (CSharp) Method

GetRegularPropertyNames() public method

Gets the regular property names.
The is null.
public GetRegularPropertyNames ( Type type ) : HashSet
type System.Type Type of the model.
return HashSet
        public HashSet<string> GetRegularPropertyNames(Type type)
        {
            Argument.IsNotNull("type", type);

            return _regularPropertyNamesCache.GetFromCacheOrFetch(type, () =>
            {
                var regularPropertyNames = GetRegularProperties(type);

                var finalProperties = new HashSet<string>();
                foreach (var propertyName in regularPropertyNames)
                {
                    finalProperties.Add(propertyName.Key);
                }

                return finalProperties;
            });
        }

Usage Example

        /// <summary>
        /// Gets the member group.
        /// </summary>
        /// <param name="modelType">Type of the model.</param>
        /// <param name="memberName">Name of the member.</param>
        /// <returns>The <see cref="SerializationMemberGroup"/>.</returns>
        protected SerializationMemberGroup GetMemberGroup(Type modelType, string memberName)
        {
            var catelProperties = SerializationManager.GetCatelPropertyNames(modelType);

            if (catelProperties.Contains(memberName))
            {
                return(SerializationMemberGroup.CatelProperty);
            }

            var regularProperties = SerializationManager.GetRegularPropertyNames(modelType);

            if (regularProperties.Contains(memberName))
            {
                return(SerializationMemberGroup.RegularProperty);
            }

            return(SerializationMemberGroup.Field);
        }
All Usage Examples Of Catel.Runtime.Serialization.SerializationManager::GetRegularPropertyNames