Пример #1
0
        public static FormatVerifier CreateFormatVerifier(FormatVerifierSerializationKind kind, bool isBatch)
        {
            FormatVerifier formatVerifier = new FormatVerifier();

            if (isBatch)
            {
                // do something interesting
            }
            else
            {
                switch (kind)
                {
                    case FormatVerifierSerializationKind.JSON:
                        formatVerifier.AddRule(new JsonFormatVerifier());
                        break;

                    case FormatVerifierSerializationKind.Atom:
                        formatVerifier.XmlNamespaceManager = FormatVerifyUtils.CreateNamespaceManager();

                        formatVerifier.AddRule(new AtomFeedVerifier(formatVerifier));
                        formatVerifier.AddRule(new AtomEntryVerifier(formatVerifier));
                        formatVerifier.AddRule(new AtomCategoryVerifier(formatVerifier));
                        formatVerifier.AddRule(new AtomAuthorVerifier(formatVerifier));
                        formatVerifier.AddRule(new AtomContentVerifier(formatVerifier));
                        formatVerifier.AddRule(new AtomContributorVerifier(formatVerifier));
                        formatVerifier.AddRule(new AtomLinkVerifier(formatVerifier));
                        formatVerifier.AddRule(new AtomTitleVerifier(formatVerifier));
                        formatVerifier.AddRule(new AtomUpdatedVerifier(formatVerifier));
                        break;

                    default:
                        break;
                }
            }

            return formatVerifier;
        }
Пример #2
0
        public static FormatVerifier CreateFormatVerifier(FormatVerifierSerializationKind kind, bool isBatch)
        {
            FormatVerifier formatVerifier = new FormatVerifier();

            if (isBatch)
            {
                // do something interesting
            }
            else
            {
                switch (kind)
                {
                case FormatVerifierSerializationKind.JSON:
                    formatVerifier.AddRule(new JsonFormatVerifier());
                    break;

                case FormatVerifierSerializationKind.Atom:
                    formatVerifier.XmlNamespaceManager = FormatVerifyUtils.CreateNamespaceManager();

                    formatVerifier.AddRule(new AtomFeedVerifier(formatVerifier));
                    formatVerifier.AddRule(new AtomEntryVerifier(formatVerifier));
                    formatVerifier.AddRule(new AtomCategoryVerifier(formatVerifier));
                    formatVerifier.AddRule(new AtomAuthorVerifier(formatVerifier));
                    formatVerifier.AddRule(new AtomContentVerifier(formatVerifier));
                    formatVerifier.AddRule(new AtomContributorVerifier(formatVerifier));
                    formatVerifier.AddRule(new AtomLinkVerifier(formatVerifier));
                    formatVerifier.AddRule(new AtomTitleVerifier(formatVerifier));
                    formatVerifier.AddRule(new AtomUpdatedVerifier(formatVerifier));
                    break;

                default:
                    break;
                }
            }

            return(formatVerifier);
        }
Пример #3
0
 public static FormatVerifier CreateFormatVerifier(FormatVerifierSerializationKind kind)
 {
     return FormatVerifier.CreateFormatVerifier(kind, false);
 }
Пример #4
0
 public static FormatVerifier CreateFormatVerifier(FormatVerifierSerializationKind kind)
 {
     return(FormatVerifier.CreateFormatVerifier(kind, false));
 }