public PostfixCalculatorCreator(IRecognizer recognizer, WayToGetOperation wayToGet, IPluginReader pluginReader = null) { this.recognizer = recognizer; this.pluginReader = pluginReader; if (pluginReader != null) { this.pluginReader = pluginReader; } operations = new List <IOperation>(); GetOperationsFromWay(wayToGet); }
private void GetOperationsFromWay(WayToGetOperation wayToGetOperation) { switch (wayToGetOperation) { case WayToGetOperation.Internal: operations = GetAllOperations(); break; case WayToGetOperation.External: if (pluginReader != null) { operations = pluginReader .ReadPluginsFrom(Environment.CurrentDirectory + "\\Plugins"); } else { throw new ArgumentNullException("PluginReader instance is null"); } break; } }