protected virtual void ChangeStatus( IExecutionService executionService, Status status ) { var previousStatus = Status; Status = status; if (Status != previousStatus) { switch (Status) { case Status.Executing: OnExecuting(executionService); break; case Status.Executed: OnExecuted(executionService); if (Parent != null) { executionService.Execute(Parent); } break; default: break; } } }
protected StrategyBase(string name, string description) { this.metaStrategyBase = (MetaStrategyBase)null; this.name = name; this.description = description; this.isEnabled = true; this.isActive = true; this.ReportManager = StrategyComponentManager.GetComponent("getcom", (object)this) as ReportManager; this.MarketManager = StrategyComponentManager.GetComponent("getcom", (object)this) as MarketManager; this.portfolio = PortfolioManager.Portfolios[name]; if (this.portfolio == null) { this.portfolio = new Portfolio(name); } this.tester = new LiveTester(this.portfolio); this.stops = new StopList(); this.triggers = new TriggerList(); this.marketDataProvider = (IMarketDataProvider)null; this.executionProvider = (IExecutionProvider)null; this.newsProvider = (INewsProvider)null; this.executionService = (IExecutionService)null; this.orders = new OrderTable(); this.global = new Hashtable(); this.activeInstruments = new InstrumentList(); this.barSliceManager = new BarSliceManager(); this.componentTypeList = new List <ComponentType>(); this.componentTypeList.Add(ComponentType.MarketManager); this.componentTypeList.Add(ComponentType.ReportManager); this.activeStops = new Dictionary <Instrument, List <StopBase> >(); this.portfolios = new Dictionary <Instrument, Portfolio>(); this.testers = new Dictionary <Instrument, LiveTester>(); this.statisticsPerInstrumentEnabled = false; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="configJsonService"></param> /// <param name="userSettingsService"></param> /// <param name="executionService"></param> public PresetControlViewModel(IConfigJsonService configJsonService, IUserSettingsService userSettingsService, IExecutionService executionService) { ConfigJsonService = configJsonService; UserSettingsService = userSettingsService; ExecutionService = executionService; // モデルのプロパティ更新イベントリスナ登録 CompositeDisposable.Add(new PropertyChangedEventListener(UserSettingsService.UserSettings) { { nameof(UserSettings.PresetInfos), (_, __) => RaisePropertyChanged(nameof(Presets)) }, }); CompositeDisposable.Add(new PropertyChangedEventListener(ConfigJsonService) { { nameof(IConfigJsonService.CurrentPreset), (_, __) => { RaisePropertyChanged(nameof(CurrentPreset)); RaisePropertyChanged(nameof(SaveEnable)); RaisePropertyChanged(nameof(DeleteEnable)); } }, { nameof(IConfigJsonService.ConfigJson), (_, __) => SetConfigJsonEventListenr() } }); SetConfigJsonEventListenr(); }
private static void TestExerciseSlide(ExerciseSlide slide, IExecutionService executionService) { var solution = slide.Exercise.Solution.BuildSolution(slide.Exercise.EthalonSolution); if (solution.HasErrors) Assert.Fail("Template solution: " + slide.Exercise.EthalonSolution + "\n\n" + "source code: " + solution.SourceCode + "\n\n" + "solution has error in: " + slide.Info.UnitName + " - " + slide.Title + "\n" + "\terror: " + solution.ErrorMessage + "\n\n"); else { //ExperimentMethod(solution); Попытка научиться проводить тестирование, не отправляя на Ideon. var testName = TestContext.CurrentContext.Test.Name; var submition = executionService.Submit(solution.SourceCode, testName).Result; var output = submition.StdOut + "\n" + submition.StdErr; var isRightAnswer = output.NormalizeEoln().Equals(slide.Exercise.ExpectedOutput.NormalizeEoln()); var result = new RunSolutionResult { CompilationError = submition.CompilationErrorMessage, IsRightAnswer = isRightAnswer, ExpectedOutput = slide.Exercise.ExpectedOutput, ActualOutput = output }; if (!isRightAnswer) { Assert.Fail("mistake in: " + slide.Info.UnitName + " - " + slide.Title + "\n" + "\tActualOutput: " + result.ActualOutput + "\n" + "\tExpectedOutput: " + result.ExpectedOutput + "\n" + "\tCompilationError: " + result.CompilationError + "\n" + "\tSourceCode: " + solution.SourceCode + "\n\n"); } } }
/// <summary> /// コンストラクタ /// </summary> /// <param name="executionService"></param> /// <param name="uriConversionService"></param> /// <param name="configJsonService"></param> public NicovideoIdCollectionService( IExecutionService executionService, IUriConversionService uriConversionService, IConfigJsonService configJsonService) : base(executionService, uriConversionService, configJsonService, conf => conf.NicovideoIds) { }
/// <summary> /// Executes the reference upon its parent package. Descendants can change this /// behavior if something needs to be done before or after execution. /// </summary> /// <returns>An <see cref="ExecutionResult"/> that represents the result of the execution of the recipe.</returns> protected override ExecutionResult OnExecute() { IExecutionService executor = (IExecutionService) ServiceHelper.GetService(this, typeof(IExecutionService)); return(executor.Execute(this)); }
protected StrategyBase(string name, string description) { this.metaStrategyBase = null; this.name = name; this.description = description; this.isEnabled = true; this.isActive = true; this.ReportManager = (StrategyComponentManager.GetComponent("{5E7810DC-C9C1-427f-8CD9-1DFFE26E59B5}", this) as ReportManager); this.MarketManager = (StrategyComponentManager.GetComponent("{849E4CFE-C19E-4d1e-899D-0BB26DB12AAD}", this) as MarketManager); this.portfolio = PortfolioManager.Portfolios[name]; if (this.portfolio == null) { this.portfolio = new Portfolio(name); } this.tester = new LiveTester(this.portfolio); this.stops = new StopList(); this.triggers = new TriggerList(); this.marketDataProvider = null; this.executionProvider = null; this.newsProvider = null; this.executionService = null; this.orders = new OrderTable(); this.global = new Hashtable(); this.activeInstruments = new InstrumentList(); this.barSliceManager = new BarSliceManager(); this.componentTypeList = new List <ComponentType>(); this.componentTypeList.Add(ComponentType.MarketManager); this.componentTypeList.Add(ComponentType.ReportManager); this.activeStops = new Dictionary <Instrument, List <StopBase> >(); this.portfolios = new Dictionary <Instrument, Portfolio>(); this.testers = new Dictionary <Instrument, LiveTester>(); this.statisticsPerInstrumentEnabled = false; }
public override bool Choose( IExecutionService executionService, Alternative alternative ) { if (this != alternative) { ChangeStatus( executionService, Status.NotChosen); if (Guard != null) { Guard.NotChosen(executionService); } return(false); } ChangeStatus( executionService, Status.Executing); return(true); }
public ComponentController(IExecutionService executionService, IDashboardService dashboardService, IMemoryCache memoryCache, AutoReloader autoReloader) { _executionService = executionService; _dashboardService = dashboardService; _autoReloader = autoReloader; _memoryCache = memoryCache; }
public static IDataReader ExecuteReader(IDbCommand command, string description, bool isApplication, bool transformParameters, bool skipLog) { try { // Save the values before execution because sometimes the drivers clears them from the IDbCommand when an exception occurs IDbCommand cmd = ADOAdaptersUtils.GetADOCommand(command); IDbConnection conn = cmd.Connection; IDbTransaction trans = cmd.Transaction; IDatabaseAccessProvider provider = null; bool hasProvider = trans != null && DatabaseAccess.TryGetProviderForTransaction(trans, out provider); IExecutionService executionService = hasProvider ? provider.DatabaseServices.ExecutionService : GetExecutionForConnection(conn); ITransactionManager manager = provider.TransactionManager; IDataReader reader = null; try { if (transformParameters) { TransformParameters(cmd); } reader = executionService.ExecuteReader(cmd); // NOTE: This reader will be closed automatically by the transaction manager at the end of the request manager.AssociateReader(trans, reader); } catch (DbException e) { executionService.OnExecuteException(e, cmd, reader, conn, trans, manager); throw; } return(reader); } catch (InvalidDatabaseAccessException e) { throw new InvalidDBTransactionManagerAccess(e.Message); } }
public static DataSet CreateAndFillDataSet(IDbCommand command, IDbDataAdapter adapter, string description, bool isApplication) { // Save the values before execution because sometimes the drivers clears them from the IDbCommand when an exception occurs IDbCommand cmd = ADOAdaptersUtils.GetADOCommand(command); IDbConnection conn = cmd.Connection; IDbTransaction trans = cmd.Transaction; IDatabaseAccessProvider provider = null; bool hasProvider = trans != null && DatabaseAccess.TryGetProviderForTransaction(trans, out provider); IExecutionService executionService = hasProvider ? provider.DatabaseServices.ExecutionService : GetExecutionForConnection(conn); ITransactionManager manager = provider.TransactionManager; try { DataSet dataSet; { dataSet = new DataSet(); adapter.SelectCommand = cmd; adapter.Fill(dataSet); } return(dataSet); } catch (DbException e) { executionService.OnExecuteException(e, cmd, null, conn, trans, manager); throw; } }
public void Add(IExecutionService service) { if (!this.services.Contains(service)) { this.services.Add(service, null); } }
public static void Add(IService service) { // if (Framework.Installation.Edition == Edition.Research && (int)service.Id != 1) // return; ServiceManager.services.Add(service); ServiceManager.Load(service); service.StatusChanged += new EventHandler(ServiceManager.EmitServiceStatusChanged); service.Error += new ServiceErrorEventHandler(ServiceManager.EmitServiceError); if (service is IMarketService) { IMarketService marketService = service as IMarketService; marketService.Logon += new FIXLogonEventHandler(ServiceManager.EmitLogon); marketService.Logout += new FIXLogoutEventHandler(ServiceManager.EmitLogout); } if (service is IExecutionService) { IExecutionService executionService = service as IExecutionService; ServiceManager.executionServices.Add(executionService); executionService.NewOrderSingle += new FIXNewOrderSingleEventHandler(ServiceManager.nKWRNT2TM); executionService.OrderCancelRequest += new FIXOrderCancelRequestEventHandler(ServiceManager.NdSXrHt2W); executionService.OrderCancelReplaceRequest += new FIXOrderCancelReplaceRequestEventHandler(ServiceManager.iHPj7xf9A); } if (ServiceManager.ServiceAdded != null) { ServiceManager.ServiceAdded(typeof(ServiceManager), new ServiceEventArgs(service)); } }
private async Task<RunSolutionResult> CheckSolution(ExerciseSlide exerciseSlide, string code, IExecutionService executionService) { var exerciseBlock = exerciseSlide.Exercise; var solution = exerciseBlock.Solution.BuildSolution(code); if (solution.HasErrors) return new RunSolutionResult { IsCompileError = true, CompilationError = solution.ErrorMessage, ExecutionServiceName = "uLearn" }; if (solution.HasStyleIssues) return new RunSolutionResult { IsStyleViolation = true, CompilationError = solution.StyleMessage, ExecutionServiceName = "uLearn" }; var submissionDetails = await executionService.Submit(solution.SourceCode, GenerateSubmissionName(exerciseSlide)); if (submissionDetails == null) return new RunSolutionResult { IsCompillerFailure = true, CompilationError = "Ой-ой, штуковина, которая проверяет решения сломалась (или просто устала). Попробуйте отправить решение позже (когда она немного отдохнет).", ExecutionServiceName = executionService.Name }; var output = submissionDetails.GetOutput(); var expectedOutput = exerciseBlock.ExpectedOutput.NormalizeEoln(); var isRightAnswer = submissionDetails.IsSuccess && output.Equals(expectedOutput); return new RunSolutionResult { IsCompileError = submissionDetails.IsCompilationError, CompilationError = submissionDetails.CompilationErrorMessage, IsRightAnswer = isRightAnswer, ExpectedOutput = exerciseBlock.HideExpectedOutputOnError ? null : expectedOutput, ActualOutput = output, ExecutionServiceName = submissionDetails.ServiceName }; }
public ExampleController( IDatabaseService databaseService, IExecutionService executionService ) { this.DatabaseService = databaseService ?? new DatabaseService(); this.ExecutionService = executionService ?? new ExecutionService(); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="executionService"></param> /// <param name="uriConversionService"></param> /// <param name="configJsonService"></param> /// <param name="selectFunc"></param> public TextCollectionService( IExecutionService executionService, IUriConversionService uriConversionService, IConfigJsonService configJsonService, Func <ConfigJson, ObservableCollection <string> > selectFunc) : base(executionService, uriConversionService, configJsonService, selectFunc) { }
public static XmlReader ExecuteXmlReaderMethod(SqlCommand sqlCommand, IExecutionService executionService) { CheckType(executionService.GetType(), "OutSystems.HubEdition.DatabaseProvider.SqlServer.ExecutionService.ExecutionService"); MethodInfo executeXmlReaderMethod = executionService.GetType().GetMethod("ExecuteXmlReader", new Type[] { typeof(SqlCommand) }); return(executeXmlReaderMethod.Invoke(executionService, new Object[] { sqlCommand }) as XmlReader); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="executionService"></param> /// <param name="uriConversionService"></param> /// <param name="configJsonService"></param> /// <param name="selectFunc"></param> public DoubleImageCollectionService( IExecutionService executionService, IUriConversionService uriConversionService, IConfigJsonService configJsonService, Func <ConfigJson, ObservableCollection <ConfigJson.DoubleImageUrls> > selectFunc) : base(executionService, uriConversionService, configJsonService, selectFunc) { }
public static void RestoreComparisonSettings(IDbTransaction trans, IExecutionService executionService) { CheckType(executionService.GetType(), "OutSystems.HubEdition.DatabaseProvider.Oracle.ExecutionService.ExecutionService"); MethodInfo restoreComparisonSettings = executionService.GetType().GetMethod("RestoreComparisonSettings"); restoreComparisonSettings.Invoke(executionService, new object[] { trans }); }
public static bool IsConnectedUser(IDbConnection conn, string userName, IExecutionService executionService) { CheckType(executionService.GetType(), "OutSystems.HubEdition.DatabaseProvider.Oracle.ExecutionService.ExecutionService"); MethodInfo isConnectedUser = executionService.GetType().GetMethod("IsConnectedUser", new[] { typeof(IDbConnection), typeof(string) }); return((bool)isConnectedUser.Invoke(executionService, new object[] { conn, userName })); }
internal void NotChosen( IExecutionService executionService ) { base.ChangeStatus( executionService, Status.NotChosen); }
public static void ForceCSASSetting(IDbTransaction trans, IExecutionService executionService) { CheckType(executionService.GetType(), "OutSystems.HubEdition.DatabaseProvider.Oracle.ExecutionService.ExecutionService"); MethodInfo forceCSASSetting = executionService.GetType().GetMethod("ForceCSASSetting", new [] { typeof(IDbTransaction) }); forceCSASSetting.Invoke(executionService, new object[] { trans }); }
public static bool GetIsIntegratedSecurityOnly(IExecutionService executionService) { CheckType(executionService.GetType(), "OutSystems.HubEdition.DatabaseProvider.SqlServer.ExecutionService.ExecutionService"); PropertyInfo serverVersionProperty = executionService.GetType().GetProperty("IsIntegratedSecurityOnly", BindingFlags.Public | BindingFlags.Instance); return((bool)serverVersionProperty.GetValue(executionService, null)); }
public ComponentController(IExecutionService executionService, IDashboardService dashboardService, IMemoryCache memoryCache, StateRequestService stateRequestService, ConnectionManager connectionManager) { _executionService = executionService; _dashboardService = dashboardService; _memoryCache = memoryCache; _stateRequestService = stateRequestService; _connectionManager = connectionManager; }
public void Setup() { _executionService = new ExecutionService( new ExecutionObjectFactory(), new Repository <ExecutionObjectDetails>(), new SortService() ); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="uriConversionService"></param> /// <param name="configJsonService"></param> /// <param name="selectFunc"></param> public Nico3dIdCollectionService( IExecutionService executionService, IUriConversionService uriConversionService, IConfigJsonService configJsonService, Func <ConfigJson, ObservableCollection <int> > selectFunc) : base(executionService, uriConversionService, configJsonService, selectFunc) { }
public ApiController(IUniversitiesService universitiesService, IUpdatesService updatesService, IExecutionService executionService) { this.universitiesService = universitiesService; this.updatesService = updatesService; this.executionService = executionService; }
public static DBSqlServerVersion GetSqlServerVersion(IExecutionService executionService) { CheckType(executionService.GetType(), "OutSystems.HubEdition.DatabaseProvider.SqlServer.ExecutionService.ExecutionService"); PropertyInfo serverVersionProperty = executionService.GetType().GetProperty("ServerVersion", BindingFlags.Public | BindingFlags.Instance); return((DBSqlServerVersion)Enum.Parse(typeof(DBSqlServerVersion), serverVersionProperty.GetValue(executionService, null).ToString())); }
/// <summary> /// Initializes a new instance of the <see cref="CacheDatabaseServices"/> class. /// </summary> /// <param name="databaseConfiguration">The database configuration.</param> public CacheDatabaseServices(IRuntimeDatabaseConfiguration databaseConfiguration) { _configuration = databaseConfiguration; _objectFactory = new CacheDatabaseObjectFactory(this); _transactionService = new CacheTransactionService(this); _executionService = new CacheExecutionService(this); _dmlService = new CacheDMLService(this); _introspectionService = new CacheIntrospectionService(this); }
public DB2LUWDatabaseServices(IRuntimeDatabaseConfiguration databaseConfiguration) { configuration = databaseConfiguration; objectFactory = new DB2LUWDatabaseObjectFactory(this); transactionService = new DB2LUWTransactionService(this); executionService = new DB2LUWExecutionService(this); dmlService = new DB2LUWDMLService(this); introspectionService = new DB2LUWIntrospectionService(this); }
private void ValidateInsertedValue(IExecutionService service, IDbTransaction tran, int expectedValue, int returnedId, string executedSql) { string sql = "SELECT VAL FROM DUMMY" + MachineName + " WHERE ID = " + returnedId; using (IDbCommand cmd = service.CreateCommand(tran, sql)) { int insertedValue = (int)Convert.ChangeType(service.ExecuteScalar(cmd), typeof(int)); AssertEqual(expectedValue, insertedValue, string.Format(errorMessageFormat, "CreateEntityRetrievingId", executedSql)); } }
public DashboardHub(IExecutionService executionService, IMemoryCache memoryCache, StateRequestService stateRequestService, IDashboardService dashboardService) { Log.Debug("DashboardHub constructor"); _executionService = executionService; _stateRequestService = stateRequestService; _memoryCache = memoryCache; _dashboardService = dashboardService; }
public Cleaner(ITradeRepository tradeRepository, IAnalyticsService analyticsService, IExecutionService executionService, IPriceLastValueCache priceLastValueCache, ISchedulerService scheduler) { _tradeRepository = tradeRepository; _analyticsService = analyticsService; _executionService = executionService; _priceLastValueCache = priceLastValueCache; _scheduler = scheduler; }
public void SetUp() { _tradeRepo = Substitute.For<ITradeRepository>(); _analyticsService = Substitute.For<IAnalyticsService>(); _executionService = Substitute.For<IExecutionService>(); _lastValueCache = Substitute.For<IPriceLastValueCache>(); _scheduler = new HistoricalScheduler(); _scheduler.AdvanceTo(DateTimeOffset.Now); _schedulerService = Substitute.For<ISchedulerService>(); _schedulerService.ThreadPool.Returns(_scheduler); }
public NewOrderSingleEventArgs(IExecutionService service, FIXNewOrderSingle order) : base(service) { this.Order = order; }
public ExecutionHub(IExecutionService executionService) { _executionService = executionService; }
protected StrategyBase(string name, string description) { this.metaStrategyBase = (MetaStrategyBase) null; this.name = name; this.description = description; this.isEnabled = true; this.isActive = true; this.ReportManager = StrategyComponentManager.GetComponent("getcom", (object) this) as ReportManager; this.MarketManager = StrategyComponentManager.GetComponent("getcom", (object) this) as MarketManager; this.portfolio = PortfolioManager.Portfolios[name]; if (this.portfolio == null) this.portfolio = new Portfolio(name); this.tester = new LiveTester(this.portfolio); this.stops = new StopList(); this.triggers = new TriggerList(); this.marketDataProvider = (IMarketDataProvider) null; this.executionProvider = (IExecutionProvider) null; this.newsProvider = (INewsProvider) null; this.executionService = (IExecutionService) null; this.orders = new OrderTable(); this.global = new Hashtable(); this.activeInstruments = new InstrumentList(); this.barSliceManager = new BarSliceManager(); this.componentTypeList = new List<ComponentType>(); this.componentTypeList.Add(ComponentType.MarketManager); this.componentTypeList.Add(ComponentType.ReportManager); this.activeStops = new Dictionary<Instrument, List<StopBase>>(); this.portfolios = new Dictionary<Instrument, Portfolio>(); this.testers = new Dictionary<Instrument, LiveTester>(); this.statisticsPerInstrumentEnabled = false; }
public void TestSlides(ExerciseSlide slide, IExecutionService executionService) { TestExerciseSlide(slide, executionService); }
public ExecutionServiceEventArgs(IExecutionService service) : base(service) { }
public void SendExecutionReport(IExecutionService service, ExecutionReport report) { this.orders[report.OrderID].EmitExecutionReport(report); service.Send((FIXExecutionReport)report); this.EmitExecutionReport(report); }
private List<StrategyBase> BA5WlUco8U(IExecutionService obj0) { return this.EdxRkK8EdT[obj0]; }
public void TestSlides(ExerciseSlide slide, IExecutionService ideoneClient) { TestExerciseSlide(slide, ideoneClient); }