예제 #1
0
 public PDFItemVariableProvider(PDFItemCollection items, int index, object currentData)
 {
     if (null == items)
     {
         throw new ArgumentNullException(nameof(items));
     }
     _items        = items;
     _currentIndex = index;
     _currentData  = currentData;
 }
예제 #2
0
        protected override void DoRegisterArtefacts(PDFLayoutContext context, PDFArtefactRegistrationSet set, Style fullstyle)
        {
            _orgitems = context.Items;

            if (this.HasParams)
            {
                PDFItemCollection updated = _orgitems.Clone();
                updated.Merge(this.Params);
                context.Items = updated;
            }

            base.DoRegisterArtefacts(context, set, fullstyle);
        }
예제 #3
0
        protected override void OnDataBinding(PDFDataContext context)
        {
            _orgitems = context.Items;

            if (this.HasParams)
            {
                PDFItemCollection updated = _orgitems.Clone();
                updated.Merge(this.Params);
                context.Items = updated;
            }

            base.OnDataBinding(context);
        }
예제 #4
0
        private static PDFDataBindEventArgs CreateDataBindArgs()
        {
            var config = Scryber.ServiceProvider.GetService <IScryberConfigurationService>();

            Assert.IsNotNull(config, "THere is no scryber config service");

            var log = config.TracingOptions.GetTraceLog();

            PDFItemCollection    items   = new PDFItemCollection(null);
            PDFDataContext       context = new PDFDataContext(items, log, new PDFPerformanceMonitor(true), null);
            PDFDataBindEventArgs args    = new PDFDataBindEventArgs(context);

            return(args);
        }
 protected override object DoGetMyValue(object parent, PDFDataContext context)
 {
     if (this.ItemName == CurrentDataContextName)
     {
         if (context.DataStack.HasData)
         {
             return(context.DataStack.Current);
         }
         else
         {
             return(null);
         }
     }
     else
     {
         PDFItemCollection items = (PDFItemCollection)parent;
         return(items[this.ItemName]);
     }
 }
예제 #6
0
 public static IVariableProvider ValueProvider(this PDFItemCollection items, int index, object currentdata)
 {
     return(new PDFItemVariableProvider(items, index, currentdata));
 }