private CodeDocEvent ConvertToModel(EventInfo eventInfo, CodeDocMemberDetailLevel detailLevel, ICodeDocMemberDataProvider extraMemberDataProvider = null)
            {
                Contract.Requires(eventInfo != null);
                Contract.Ensures(Contract.Result<CodeDocEvent>() != null);
                Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<CodeDocEvent>().ShortName));
                Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<CodeDocEvent>().FullName));
                Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<CodeDocEvent>().Title));
                Contract.Ensures(Contract.Result<CodeDocEvent>().Title == Contract.Result<CodeDocEvent>().ShortName);
                Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<CodeDocEvent>().SubTitle));

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

                var eventCRef = GetCRefIdentifier(eventInfo);
                var model = new CodeDocEvent(eventCRef);
                model.Uri = GetUri(eventInfo);

                var memberDataProvider = new CodeDocMemberInfoProvider<EventInfo>(eventInfo);

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

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

                if (includeInheritance) {
                    var baseEvent = eventInfo.FindNextAncestor();
                    if (baseEvent != null) {
                        var baseEventModel = GetOnly(GetCRefIdentifier(baseEvent), detailLevel);
                        if (baseEventModel != null)
                            memberDataProvider.Add(new CodeDocMemberDataProvider(baseEventModel));
                    }
                }

                if (appendXmlDoc)
                    ApplyContentXmlDocs(model, memberDataProvider);

                model.ExternalVisibility = memberDataProvider.ExternalVisibility ?? ExternalVisibilityKind.Public;
                model.ShortName = RegularTypeDisplayNameOverlay.GetDisplayName(memberDataProvider.Member);
                model.FullName = FullTypeDisplayNameOverlay.GetDisplayName(memberDataProvider.Member);
                model.Title = model.ShortName;
                Contract.Assume(memberDataProvider.Member.DeclaringType != null);
                model.NamespaceName = memberDataProvider.Member.DeclaringType.Namespace;
                model.SubTitle = "Event";

                model.DelegateType = GetOrConvert(eventInfo.EventHandlerType, CodeDocMemberDetailLevel.Minimum);
                Contract.Assume(eventInfo.DeclaringType != null);
                model.Namespace = GetOrCreateNamespaceByName(eventInfo.DeclaringType.Namespace);
                model.Assembly = GetCodeDocAssembly(eventInfo.DeclaringType.Assembly);
                model.DeclaringType = GetOrConvert(eventInfo.DeclaringType, CodeDocMemberDetailLevel.Minimum);
                model.IsStatic = memberDataProvider.IsStatic.GetValueOrDefault();
                model.IsObsolete = memberDataProvider.IsObsolete.GetValueOrDefault();

                return model;
            }