/// <summary> /// Sets time period targets for steel design. /// </summary> /// <param name="periods">The periods.</param> /// <param name="modalCase">The modal case.</param> /// <param name="allSpecifiedTargetsActive">True: All specified targets are active. /// False: They are inactive.</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> private void set( List <TargetPeriod> periods, Modal modalCase, bool allSpecifiedTargetsActive) { _apiTargetPeriod.SetTargetPeriod( modalCase.Name, periods.Select(o => o.ModeNumber).ToArray(), periods.Select(o => o.Value).ToArray(), allSpecifiedTargetsActive); _allSpecifiedPeriodTargetsActive = allSpecifiedTargetsActive; _modalCaseName = modalCase.Name; _modalCase = modalCase; _targetPeriods = periods; }
/// <summary> /// Sets time period targets for steel design. /// </summary> /// <param name="allSpecifiedTargetsActive">True: All specified targets are active. /// False: They are inactive.</param> /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception> protected void setTargetPeriods(ITargetPeriod app, bool allSpecifiedTargetsActive) { int[] modeNumbers = new int[TargetPeriods.Count]; for (int i = 0; i < TargetPeriods.Count; i++) { modeNumbers[i] = TargetPeriods[i].ModeNumber; } double[] periodTargets = new double[TargetPeriods.Count]; for (int i = 0; i < TargetPeriods.Count; i++) { periodTargets[i] = TargetPeriods[i].Value; } app.SetTargetPeriod(ModalCase, modeNumbers, periodTargets, allSpecifiedTargetsActive); AllSpecifiedPeriodTargetsActive = allSpecifiedTargetsActive; }