コード例 #1
0
        private static SDataExtensionContext GetContext(IExtensibleSyndicationObject entry, bool createIfMissing)
        {
            Guard.ArgumentNotNull(entry, "entry");
            var extension = entry.Extensions.OfType <SDataExtension>().FirstOrDefault();

            if (extension == null)
            {
                if (!createIfMissing)
                {
                    return(null);
                }

                extension = new SDataExtension();
                entry.AddExtension(extension);
            }

            return(extension.Context);
        }
コード例 #2
0
        private static SDataExtensionContext GetContext(IExtensibleSyndicationObject entry, bool createIfMissing)
        {
            Guard.ArgumentNotNull(entry, "entry");
            var extension = entry.Extensions.OfType<SDataExtension>().FirstOrDefault();

            if (extension == null)
            {
                if (!createIfMissing)
                {
                    return null;
                }

                extension = new SDataExtension();
                entry.AddExtension(extension);
            }

            return extension.Context;
        }