private static void CheckForLastStepCalculator( CalculatorParameters me2CalcParams, ContractHelpers.EXTENSION_STEPS stepNumber, ExtensionContentURI extDocToCalcURI) { ME2CalculatorHelper.CALCULATOR_TYPES eCalculatorType = ME2CalculatorHelper.GetCalculatorType( me2CalcParams.CalculatorType); //other projects have code for handling different //numbers of steps in calculators }
//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); } //run the stats and add them to statelement ME2CalculatorHelper.CALCULATOR_TYPES eCalculatorType = ME2CalculatorHelper.GetCalculatorType( this.GCCalculatorParams.CalculatorType); if (eCalculatorType == ME2CalculatorHelper.CALCULATOR_TYPES.me2) { e.HasCalculations = RunME2Calculation(eCalculatorType, statElement, linkedViewElement); } else { //run normally and save the same statelement and linkedviewelement e.HasCalculations = RunME2Analysis( 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); } } }