public int Calculate(int numberA, int numberB, CalculationTypes type) { return(type switch { CalculationTypes.Sum => Sum(numberA, numberB), CalculationTypes.Multiply => Multiply(numberA, numberB), });
public ICalcParser GetParser(CalculationTypes parserType) { switch (parserType) { case CalculationTypes.Max2Items: return(new Calculator2Items()); case CalculationTypes.AnyNumberItems: return(new CalculatorManyItems()); default: return(new CalculatorNull()); } }
private ViewSchedule FindViewSchedule(CalculationTypes calType) { ViewSchedule viewSchedule = null; try { var viewName = ""; switch (calType) { case CalculationTypes.BuildingArea: viewName = "LPD (BUILDING AREA METHOD)"; break; case CalculationTypes.SpaceBySpace: viewName = "LPD (SPACE BY SPACE METHOD)"; break; } var collector = new FilteredElementCollector(m_doc).OfClass(typeof(ViewSchedule)); foreach (var element in collector) { var vs = (ViewSchedule)element; #if RELEASE2015 || RELEASE2016 || RELEASE2017 || RELEASE2018 if (vs.ViewName != viewName) { continue; } #else if (vs.Name != viewName) { continue; } #endif viewSchedule = vs; break; } return(viewSchedule); } catch (Exception ex) { Log.AppendLog(LogMessageType.EXCEPTION, ex.Message); return(viewSchedule); } }
public ScheduleDataManager(UIApplication uiapp, CalculationTypes calType) { m_app = uiapp; m_doc = m_app.ActiveUIDocument.Document; calculationType = calType; SelectedSchedule = FindViewSchedule(calculationType); if (null == SelectedSchedule) { return; } if (!ValidateViewSchedule(SelectedSchedule)) { return; } if (!ExportViewSchedule(SelectedSchedule)) { return; } ScheduleData = GetScheduleDataTable(); RestoreFields(SelectedSchedule); }
public async Task <IAnnualSalary> ExecuteCreationAsync(CalculationTypes type, EmployeeEntity employee) => await factories[type].CreateAsync(employee);
void AddCalculationType(ICalculation calc) { CalculationTypes.Add(calc); Types.Add(new KeyValuePair <string, Type>(Path.Combine("CalculationTypes", calc.View.Title + ".xml"), calc.GetType())); }
public AnnotationProperties(FamilySymbol symbolType, CalculationTypes calType) { annotationType = symbolType; //calculationType = calType; }