Exemple #1
0
        public override void Process(FreshnessCheckArgs args)
        {
            Field field = args.Item.Fields[FieldNames.FreshnessExpiry];
            if (field == null || String.IsNullOrEmpty(field.Value) || !DateUtil.IsIsoDate(field.Value))
                return;

            DateTime freshnessExpiry = DateUtil.IsoDateToDateTime(field.Value);
            if (freshnessExpiry.Date <= DateTime.Now.Date)
            {
                args.IsStale = true;
                args.AbortPipeline();
            }
        }
Exemple #2
0
        protected override GutterIconDescriptor GetIconDescriptor(Item item)
        {
            Assert.ArgumentNotNull((object)item, "item");

            var freshnessCheckArgs = new FreshnessCheckArgs() { Item = item };
            CorePipeline.Run(PipelineNames.FreshnessCheck, freshnessCheckArgs);
            if (!freshnessCheckArgs.IsStale)
                return null;

            var descriptor = new GutterIconDescriptor();
            var args = new BuildGutterIconDescriptorArgs()
            {
                Item = item,
                Descriptor = descriptor
            };

            CorePipeline.Run(PipelineNames.BuildGutterIconDescriptor,args);
            return descriptor;
        }
 public abstract void Process(FreshnessCheckArgs args);
Exemple #4
0
 private bool ItemIsStale(Item item)
 {
     var freshnessCheckArgs = new FreshnessCheckArgs() { Item = item };
     CorePipeline.Run(PipelineNames.FreshnessCheck, freshnessCheckArgs);
     return freshnessCheckArgs.IsStale;
 }