public PDFItemVariableProvider(PDFItemCollection items, int index, object currentData) { if (null == items) { throw new ArgumentNullException(nameof(items)); } _items = items; _currentIndex = index; _currentData = currentData; }
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); }
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); }
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]); } }
public static IVariableProvider ValueProvider(this PDFItemCollection items, int index, object currentdata) { return(new PDFItemVariableProvider(items, index, currentdata)); }