Esempio n. 1
0
 public int Calculate(int numberA, int numberB, CalculationTypes type)
 {
     return(type switch
     {
         CalculationTypes.Sum => Sum(numberA, numberB),
         CalculationTypes.Multiply => Multiply(numberA, numberB),
     });
Esempio n. 2
0
        public ICalcParser GetParser(CalculationTypes parserType)
        {
            switch (parserType)
            {
            case CalculationTypes.Max2Items:
                return(new Calculator2Items());

            case CalculationTypes.AnyNumberItems:
                return(new CalculatorManyItems());

            default:
                return(new CalculatorNull());
            }
        }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 public async Task <IAnnualSalary> ExecuteCreationAsync(CalculationTypes type, EmployeeEntity employee) => await factories[type].CreateAsync(employee);
Esempio n. 6
0
 void AddCalculationType(ICalculation calc)
 {
     CalculationTypes.Add(calc);
     Types.Add(new KeyValuePair <string, Type>(Path.Combine("CalculationTypes", calc.View.Title + ".xml"), calc.GetType()));
 }
Esempio n. 7
0
 public AnnotationProperties(FamilySymbol symbolType, CalculationTypes calType)
 {
     annotationType = symbolType;
     //calculationType = calType;
 }