protected CodeDocProperty ToPropertyModel(ICodeDocMember member)
            {
                if (member == null)
                    return null;
                if (member is CodeDocProperty)
                    return (CodeDocProperty)member;

                var propertyModel = new CodeDocProperty(member.CRef.WithTargetType("P"));

                var simpleMember = member as CodeDocSimpleMember;
                if(simpleMember != null)
                    CopySimpleMemberAttributes(propertyModel, simpleMember);

                return propertyModel;
            }
            private CodeDocProperty ConvertToModel(PropertyInfo propertyInfo, CodeDocMemberDetailLevel detailLevel, ICodeDocMemberDataProvider extraMemberDataProvider = null)
            {
                Contract.Requires(propertyInfo != null);
                Contract.Ensures(Contract.Result<CodeDocProperty>() != null);
                Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<CodeDocProperty>().ShortName));
                Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<CodeDocProperty>().FullName));
                Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<CodeDocProperty>().Title));
                Contract.Ensures(Contract.Result<CodeDocProperty>().Title == Contract.Result<CodeDocProperty>().ShortName);
                Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<CodeDocProperty>().SubTitle));

                var includeExceptions = detailLevel != CodeDocMemberDetailLevel.Minimum;
                var appendXmlDoc = detailLevel.HasFlag(CodeDocMemberDetailLevel.Summary) || detailLevel.HasFlag(CodeDocMemberDetailLevel.AdditionalContents);
                var provideXmlDoc = includeExceptions || detailLevel != CodeDocMemberDetailLevel.Minimum;
                var includeInheritance = detailLevel.HasFlag(CodeDocMemberDetailLevel.Inheritance);
                var includeParameters = detailLevel != CodeDocMemberDetailLevel.Minimum;

                var propertyCRef = GetCRefIdentifier(propertyInfo);
                var model = new CodeDocProperty(propertyCRef);
                model.Uri = GetUri(propertyInfo);

                var memberDataProvider = new CodeDocMemberInfoProvider<PropertyInfo>(propertyInfo);

                XmlDocMember xmlDocs = null;
                if (provideXmlDoc) {
                    xmlDocs = XmlDocs.GetMember(propertyCRef.FullCRef);
                    if (xmlDocs != null)
                        memberDataProvider.Add(new CodeDocMemberXmlDataProvider(xmlDocs));
                }

                if (extraMemberDataProvider != null)
                    memberDataProvider.Add(extraMemberDataProvider);

                if (includeInheritance) {
                    var propertyBase = propertyInfo.FindNextAncestor();
                    if (propertyBase != null) {
                        var propertyBaseModel = GetOnly(GetCRefIdentifier(propertyBase), detailLevel);
                        if (propertyBaseModel != null)
                            memberDataProvider.Add(new CodeDocMemberDataProvider(propertyBaseModel));
                    }
                }

                if (appendXmlDoc) {
                    ApplyContentXmlDocs(model, memberDataProvider);
                    model.ValueDescriptionContents = memberDataProvider.GeValueDescriptionContents().ToArray();
                }

                model.ExternalVisibility = memberDataProvider.ExternalVisibility ?? ExternalVisibilityKind.Public;
                model.ShortName = RegularTypeDisplayNameOverlay.GetDisplayName(propertyInfo);
                model.FullName = FullTypeDisplayNameOverlay.GetDisplayName(propertyInfo);
                model.Title = model.ShortName;
                Contract.Assume(propertyInfo.DeclaringType != null);
                model.NamespaceName = propertyInfo.DeclaringType.Namespace;
                model.SubTitle = propertyInfo.IsItemIndexerProperty() ? "Indexer" : "Property";

                model.IsStatic = memberDataProvider.IsStatic.GetValueOrDefault();
                model.IsObsolete = memberDataProvider.IsObsolete.GetValueOrDefault();

                model.ValueType = GetOrConvert(propertyInfo.PropertyType, CodeDocMemberDetailLevel.Minimum);
                Contract.Assume(propertyInfo.DeclaringType != null);
                model.Namespace = GetOrCreateNamespaceByName(propertyInfo.DeclaringType.Namespace);
                model.Assembly = GetCodeDocAssembly(propertyInfo.DeclaringType.Assembly);
                model.DeclaringType = GetOrConvert(propertyInfo.DeclaringType, CodeDocMemberDetailLevel.Minimum);

                if (includeParameters) {
                    var parameters = propertyInfo.GetIndexParameters();
                    if (parameters.Length > 0)
                        model.Parameters = Array.ConvertAll(parameters, p => CreateArgument(p, memberDataProvider));
                }

                var getterMethodInfo = propertyInfo.GetGetMethod(true);
                if (getterMethodInfo != null && ReflectionRepository.MemberFilter(getterMethodInfo, true)) {
                    var accessorExtraProvider = (xmlDocs != null && xmlDocs.HasGetterElement)
                        ? new CodeDocMemberXmlDataProvider(xmlDocs.GetterElement)
                        : null;
                    model.Getter = ConvertToModel(getterMethodInfo, detailLevel, accessorExtraProvider);
                }

                var setterMethodInfo = propertyInfo.GetSetMethod(true);
                if (setterMethodInfo != null && ReflectionRepository.MemberFilter(setterMethodInfo, true)) {
                    var accessorExtraProvider = (xmlDocs != null && xmlDocs.HasSetterElement)
                        ? new CodeDocMemberXmlDataProvider(xmlDocs.SetterElement)
                        : null;
                    model.Setter = ConvertToModel(setterMethodInfo, detailLevel, accessorExtraProvider);
                }

                return model;
            }