//define the actions to take when the event is raised public void AddCalculations(object sender, CustomEventArgs e) { //pass a byref xelement from the publisher's data XElement statElement = null; XElement linkedViewElement = null; if (e.CurrentElement != null) { statElement = new XElement(e.CurrentElement); } if (e.LinkedViewElement != null) { linkedViewElement = new XElement(e.LinkedViewElement); } LCA1CalculatorHelper.CALCULATOR_TYPES eCalculatorType = LCA1CalculatorHelper.GetCalculatorType( this.GCCalculatorParams.CalculatorType); //run the stats and add them to statelement //run normally and save the same statelement and linkedviewelement e.HasCalculations = RunLCA1Analysis( statElement, linkedViewElement); if (e.HasCalculations) { //pass the new statelement back to the publisher //by setting the CalculatedElement property of CustomEventArgs if (statElement != null) { e.CurrentElement = new XElement(statElement); } if (linkedViewElement != null) { e.LinkedViewElement = new XElement(linkedViewElement); } } }
private static void CheckForLastStepCalculator( CalculatorParameters lca1CalcParams, ContractHelpers.EXTENSION_STEPS stepNumber, ExtensionContentURI extDocToCalcURI) { LCA1CalculatorHelper.CALCULATOR_TYPES eCalculatorType = LCA1CalculatorHelper.GetCalculatorType( lca1CalcParams.CalculatorType); //other projects have code for handling different //numbers of steps in calculators }