Browse Source

Handling of Evaluator.Globals

reports
Peter Forstmeier 12 years ago
parent
commit
788350e5b0
  1. 13
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/Ast/AstExtensions.cs

13
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/Ast/AstExtensions.cs

@ -19,7 +19,11 @@ namespace ICSharpCode.Reporting.Expressions.Irony.Ast
if (pageInfo == null) if (pageInfo == null)
throw new ArgumentNullException("pageInfo"); throw new ArgumentNullException("pageInfo");
app.Globals.Add("PageInfo",pageInfo); if (!app.Globals.ContainsKey("PageInfo")) {
app.Globals.Add("PageInfo",pageInfo);
} else {
app.Globals["PageInfo"] = pageInfo;
}
} }
@ -50,8 +54,11 @@ namespace ICSharpCode.Reporting.Expressions.Irony.Ast
public static void AddCurrentContainer (this ReportingExpressionEvaluator app,ExportContainer container){ public static void AddCurrentContainer (this ReportingExpressionEvaluator app,ExportContainer container){
if (container == null) if (container == null)
throw new ArgumentNullException("container"); throw new ArgumentNullException("container");
app.Globals.Add("CurrentContainer",container); if (!app.Globals.ContainsKey("CurrentContainer")) {
app.Globals.Add("CurrentContainer",container);
} else {
app.Globals["CurrentContainer"] = container;
}
} }
public static ExportContainer GetCurrentContainer (this ScriptThread thread){ public static ExportContainer GetCurrentContainer (this ScriptThread thread){

Loading…
Cancel
Save