public static void ComposeModelConfiguration(this DbModelBuilder modelBuilder) { var contextConfiguration = new ContextConfiguration(); using (var catalog = new AssemblyCatalog(Assembly.GetExecutingAssembly())) { using (var container = new CompositionContainer(catalog)) { container.ComposeParts(contextConfiguration); foreach (var configuration in contextConfiguration.Configurations) { configuration.AddConfiguration(modelBuilder.Configurations); } } } }
public EvaluatorSettings( string applicationId, string evaluatorId, int heartbeatPeriodInMs, int maxHeartbeatRetries, ContextConfiguration rootContextConfig, IClock clock, IRemoteManager <REEFMessage> remoteManager, IInjector injecor) { if (string.IsNullOrWhiteSpace(evaluatorId)) { throw new ArgumentNullException("evaluatorId"); } if (rootContextConfig == null) { throw new ArgumentNullException("rootContextConfig"); } if (clock == null) { throw new ArgumentNullException("clock"); } if (remoteManager == null) { throw new ArgumentNullException("remoteManager"); } if (injecor == null) { throw new ArgumentNullException("injecor"); } _applicationId = applicationId; _evaluatorId = evaluatorId; _heartBeatPeriodInMs = heartbeatPeriodInMs; _maxHeartbeatRetries = maxHeartbeatRetries; _rootContextConfig = rootContextConfig; _clock = clock; _remoteManager = remoteManager; _injector = injecor; _operationState = EvaluatorOperationState.OPERATIONAL; }
public void ContextConfiguration_Test() { //Type type = typeof(ProjectModel); //Type[] typeArgs = { type }; //var generic = typeof(ContextConfiguration<>).MakeGenericType(type); var contextConfig = new ContextConfiguration();//generic.GetMethod("Instance");//Activator.CreateInstance(generic); var catalog = new AssemblyCatalog(Assembly.GetAssembly(typeof(UpdateService))); var container = new CompositionContainer(catalog); container.ComposeParts(contextConfig); //var qweqwe = typeof(ContextConfigurationTests).GetMethod("Configs", BindingFlags.NonPublic | // BindingFlags.Static); //var t = qweqwe.MakeGenericMethod(typeof(ProjectModel)); //var qwe= t.Invoke(null, null); foreach (var configuration in contextConfig.Configurations) { Type modelType = configuration.GetType().BaseType.GetGenericArguments().Single(); Type shellType = typeof(IModelConfiguration <>); Type configModelType = shellType.MakeGenericType(modelType); // object predicate = predicateProperty.GetValue(invocation.InvocationTarget, null); //var item = ((dynamic)configModelType).Get((dynamic)configuration); //Activator.CreateInstance(modelType) var qwe = ModelBuilderHelper.CastToConfigurationType((dynamic)configuration, configuration); Assert.IsTrue(qwe is IModelConfiguration); //var bar = Convert.ChangeType(configuration, specificShellPropertyType); //var test = (IEnumerable<typeof(modelType)>)configuration; } //Assert.AreEqual(1,0); }
protected override void OnInit(EventArgs e) { base.OnInit(e); DataObjectType = BuildManager.GetType(DataObjectTypeName, true); // Make a generic type to give us a unique key to pass to the MetaModel API Type contextType = typeof(DummyContext <>).MakeGenericType(DataObjectType); // Set the context type and entity set name on ourselves. Note that in this scenario those // concept are somewhat artificial, since we don't have a real context. We can set the entity set name // to anything, but using the DataObjectType makes some Dynamic Data error messages clearer. ((IDynamicDataSource)this).ContextType = contextType; ((IDynamicDataSource)this).EntitySetName = DataObjectType.Name; MetaModel model = null; try { model = MetaModel.GetModel(contextType); } catch { var contextConfiguration = new ContextConfiguration() { MetadataProviderFactory = (type => new InMemoryMetadataTypeDescriptionProvider(type, new AssociatedMetadataTypeTypeDescriptionProvider(type))) }; var typeDescriptionProvider = contextConfiguration.MetadataProviderFactory(DataObjectType); var typeDescriptor = typeDescriptionProvider.GetTypeDescriptor(DataObjectType); model = new MetaModel(); model.RegisterContext( new SimpleModelProvider(contextType, DataObjectType, typeDescriptor), contextConfiguration); } Inserted += new ObjectDataSourceStatusEventHandler(DynamicObjectDataSource_Inserted); Updated += new ObjectDataSourceStatusEventHandler(DynamicObjectDataSource_Updated); }
private void ButtonImportConfigration_Click(object sender, EventArgs e) { OpenFileDialog fileDialog = new OpenFileDialog { Filter = "YAML files (*.yaml)|*.yaml", Title = "Select configuration files", Multiselect = true, InitialDirectory = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName }; if (fileDialog.ShowDialog() == DialogResult.OK) { var config = ContextConfiguration.ImportFromFile(fileDialog.FileName); if (configurationValidator(config)) { ConfigurationList.Add(config); ListBoxConfigurations.SetSelected(ConfigurationList.Count - 1, true); } else { MessageBox.Show("Configuration already exists!", "InTray Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } // start auto migration when start ContextConfiguration.RunMigrations(app); app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseSpaStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller}/{action=Index}/{id?}"); }); app.UseSpa(spa => { spa.Options.SourcePath = "ClientApp"; if (env.IsDevelopment()) { spa.UseReactDevelopmentServer(npmScript: "start"); } }); }
public FilterSteps(ContextConfiguration contextConfiguration) : base(contextConfiguration) { _contextConfiguration = contextConfiguration; _genericEntityPage = new GenericEntityPage(_contextConfiguration); _isFastText = contextConfiguration.SeleniumSettings.FastText; }
public RegistrationSuccessPage(ContextConfiguration contextConfiguration) : base(contextConfiguration) { }
public AssociationSteps(ContextConfiguration contextConfiguration) : base(contextConfiguration) { _contextConfiguration = contextConfiguration; _targetEntities = new List <BaseEntity>(); _sourceEntities = new List <BaseEntity>(); }
public UserRegistrationFeatureSteps(ContextConfiguration contextConfiguration) : base(contextConfiguration) { _contextConfiguration = contextConfiguration; _loginPage = new LoginPage(contextConfiguration); _registerUserSelectionPage = new RegisterUserSelectionPage(contextConfiguration); }
public AllUserPage(ContextConfiguration contextConfiguration) : base(contextConfiguration) { InitializeSelectors(); }
public LogoutPage(ContextConfiguration ContextConfiguration) : base(ContextConfiguration) { }
public RegisterUserSuccessfulPage(ContextConfiguration contextConfiguration) : base(contextConfiguration) { InitializeSelectors(); }
public KeyboardSteps(ContextConfiguration contextConfiguration) : base(contextConfiguration) { _contextConfiguration = contextConfiguration; }
public TimePickerComponent(ContextConfiguration contextConfiguration, IWebElement timePickerElement) : base(contextConfiguration) { TimePickerElement = timePickerElement; InitializeSelectors(); }
public LoginSteps(ContextConfiguration contextConfiguration) : base(contextConfiguration) { _contextConfiguration = contextConfiguration; _loginPage = new LoginPage(_contextConfiguration); }
/// <summary> /// Initializes a new instance of the <see cref="ProductRepository" /> class. /// </summary> /// <param name="unitOfWork">The unit of work.</param> /// <param name="configuration">The configuration.</param> public ProductRepository(EFUnitOfWork unitOfWork, ContextConfiguration <ProductRepository> configuration) : base(unitOfWork, configuration) { }
public TopBarAdminStepDefinitions(ContextConfiguration contextConfiguration) : base(contextConfiguration) { _contextConfiguration = contextConfiguration; _elementsAdminTopBar = new TopBarMenuAdmin(contextConfiguration); }
public DatePickerComponent(ContextConfiguration contextConfiguration, IWebElement datePickerElement) : base(contextConfiguration) { DatePickerElement = datePickerElement; _driver = contextConfiguration.WebDriver; initializeSelectors(); }
public DatePickerComponent(ContextConfiguration contextConfiguration) : base(contextConfiguration) { _driver = contextConfiguration.WebDriver; initializeSelectors(); }
public DatePickerComponent(ContextConfiguration contextConfiguration, string className) : base(contextConfiguration) { _driver = contextConfiguration.WebDriver; DatePickerElement = _driver.FindElement(By.CssSelector($".{className}")); initializeSelectors(); }
/// <summary> /// Initializes a new instance of the <see cref="OrderRepository" /> class. /// </summary> /// <param name="unitOfWork">The unit of work.</param> /// <param name="configuration">The configuration.</param> public OrderRepository(EFUnitOfWork unitOfWork, ContextConfiguration <OrderRepository> configuration) : base(unitOfWork, configuration) { }
public VisitorNavSection(ContextConfiguration contextConfiguration) : base(contextConfiguration) { }
public GenericEntityEditPage(string entityName, ContextConfiguration contextConfiguration) : base(contextConfiguration) { Url = baseUrl + "/admin/" + entityName + "/edit"; _entityName = entityName; detailsSection = EntityDetailUtils.GetEntityDetailsSection(entityName, contextConfiguration); }
public TimePickerComponent(ContextConfiguration contextConfiguration, string className) : base(contextConfiguration) { TimePickerElement = driver.FindElement(By.CssSelector($".{className}")); InitializeSelectors(); }
public GenericEntityEditPage(ContextConfiguration contextConfiguration) : base(contextConfiguration) { }
public AdminNavSection(ContextConfiguration contextConfiguration) : base(contextConfiguration) { InitializeSelectors(); }
public GerenciadorDeSessao(ContextConfiguration.Context context) { _context = context; }
public BaseChoiceSteps(ContextConfiguration contextConfiguration) : base(contextConfiguration) { _contextConfiguration = contextConfiguration; }
public TypingSteps(ContextConfiguration contextConfiguration) : base(contextConfiguration) { _contextConfiguration = contextConfiguration; }
public LoginPage(ContextConfiguration contextConfiguration) : base(contextConfiguration) { InitializeSelectors(); }
public BulkDeleteFeatureSteps(ContextConfiguration contextConfiguration) : base(contextConfiguration) { _contextConfiguration = contextConfiguration; _genericEntityPage = new GenericEntityPage(_contextConfiguration); _modalOnPage = new ModalOnPage(_contextConfiguration); }