Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TypeBrowser"/> class with a view model and an
        /// assembly discovery service.
        /// </summary>
        /// <param name="viewModel">The <see cref="TypeBrowserViewModel"/>.</param>
        /// <param name="assemblyDiscoveryService">The assembly discovery service.</param>
        public TypeBrowser(TypeBrowserViewModel viewModel, IAssemblyDiscoveryService assemblyDiscoveryService)
            : this()
        {
            this.assemblyDiscoveryService = assemblyDiscoveryService;
            viewModel.UpdateAssemblyGroups(GetAssemblyGroups());
            this.DataContext = viewModel;

            // Consider rearranging this
            this.AddFromFile.GetBindingExpression(Button.VisibilityProperty).UpdateTarget();
            this.AddFromGac.GetBindingExpression(Button.VisibilityProperty).UpdateTarget();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TypeBrowser"/> class with a view model and an
        /// assembly discovery service.
        /// </summary>
        /// <param name="viewModel">The <see cref="TypeBrowserViewModel"/>.</param>
        /// <param name="assemblyDiscoveryService">The assembly discovery service.</param>
        public TypeBrowser(TypeBrowserViewModel viewModel, IAssemblyDiscoveryService assemblyDiscoveryService)
            : this()
        {
            this.assemblyDiscoveryService = assemblyDiscoveryService;
            viewModel.UpdateAssemblyGroups(GetAssemblyGroups());
            this.DataContext = viewModel;

            // Consider rearranging this
            this.AddFromFile.GetBindingExpression(Button.VisibilityProperty).UpdateTarget();
            this.AddFromGac.GetBindingExpression(Button.VisibilityProperty).UpdateTarget();
        }
        public TypePickingCollectionElementAddCommand(IUIServiceWpf uiService, IAssemblyDiscoveryService discoveryService, TypePickingCommandAttribute commandAttribute, ConfigurationElementType configurationElementType, ElementCollectionViewModel elementCollectionModel)
            : base(commandAttribute, configurationElementType, elementCollectionModel, uiService)
        {
            Guard.ArgumentNotNull(commandAttribute, "commandAttribute");

            this.discoveryService = discoveryService;
            this.propertyToSet = commandAttribute.Property;

            if (propertyToSet == null)
            {
                throw new ArgumentException(
                    "Target ConfigurationElement must have an accessible property named TypeName or a specified property of type string.");
            }
        }
        public TypePickingCollectionElementAddCommand(IUIServiceWpf uiService, IAssemblyDiscoveryService discoveryService, TypePickingCommandAttribute commandAttribute, ConfigurationElementType configurationElementType, ElementCollectionViewModel elementCollectionModel)
            : base(commandAttribute, configurationElementType, elementCollectionModel, uiService)
        {
            Guard.ArgumentNotNull(commandAttribute, "commandAttribute");

            this.discoveryService = discoveryService;
            this.propertyToSet    = commandAttribute.Property;

            if (propertyToSet == null)
            {
                throw new ArgumentException(
                          "Target ConfigurationElement must have an accessible property named TypeName or a specified property of type string.");
            }
        }
Exemplo n.º 5
0
        public static void RegisterComponents()
        {
            assemblyDiscoveryService = Ioc.Instance.Resolve<IAssemblyDiscoveryService>();
            assemblyDiscoveryService.GenerateDependencyList();

            IControllerRegistrationService controllerRegistrationService = Ioc.Instance.Resolve<IControllerRegistrationService>();
            controllerRegistrationService.RegisterControllers();
            // Data
            Ioc.Instance.AddComponentWithLifestyle("IDataContext", typeof(IDataContext), typeof(DataContext), LifestyleType.PerWebRequest);
            Ioc.Instance.AddComponentWithLifestyle("IUserService", typeof(IUserService), typeof(UserService), LifestyleType.PerWebRequest);


            // Identity
            //Ioc.Instance.AddComponentWithLifestyle("GroupManager", typeof(IGroupManager), typeof(ApplicationRoleManager), LifestyleType.PerWebRequest);
            Ioc.Instance.AddComponentWithLifestyle("ApplicationSignInManager", typeof(IApplicationSignInManager), typeof(ApplicationSignInManager), LifestyleType.PerWebRequest);
            Ioc.Instance.AddComponentWithLifestyle("ApplicationUserManager", typeof(IApplicationUserManager), typeof(ApplicationUserManager), LifestyleType.PerWebRequest);
            Ioc.Instance.AddComponentWithLifestyle("AuthenticationManager", typeof(IAuthenticationManager),typeof(ApplicationAuthenticationManager), LifestyleType.PerWebRequest);
            Ioc.Instance.AddComponentWithLifestyle("IUserStore", typeof(IUserStore<User, int>), typeof(UserStoreProvider<User, int>), LifestyleType.Transient);
            Ioc.Instance.AddComponentWithLifestyle("ClaimsIdentityFactory", typeof(IClaimsIdentityFactory<User, int>), typeof(ApplicationClaimsIdentityFactory), LifestyleType.PerWebRequest);

            
            // Forums
            Ioc.Instance.AddComponentWithLifestyle("IForumRepository", typeof(IEntityRepository<Forum, int>),  typeof(EntityRepository<Forum, int>), LifestyleType.PerWebRequest);
            Ioc.Instance.AddComponentWithLifestyle("ITopicRepository", typeof(IEntityRepository<Topic, int>),  typeof(EntityRepository<Topic, int>), LifestyleType.PerWebRequest);
            Ioc.Instance.AddComponentWithLifestyle("IUserRepository",  typeof(IEntityRepository<User,   int>), typeof(EntityRepository<User,  int>), LifestyleType.PerWebRequest);
            Ioc.Instance.AddComponentWithLifestyle("IUserClaimRepository", typeof(IEntityRepository<UserClaim, int>), typeof(EntityRepository<UserClaim, int>), LifestyleType.PerWebRequest);
            Ioc.Instance.AddComponentWithLifestyle("IUserLoginRepository", typeof(IEntityRepository<UserLogin, int>), typeof(EntityRepository<UserLogin, int>), LifestyleType.PerWebRequest);
            Ioc.Instance.AddComponentWithLifestyle("ILogRepository", typeof(IEntityRepository<Log, int>), typeof(EntityRepository<Log, int>), LifestyleType.PerWebRequest);
            Ioc.Instance.AddComponentWithLifestyle("IWebsiteRepository", typeof(IEntityRepository<Website, int>), typeof(EntityRepository<Website, int>), LifestyleType.PerWebRequest);
            Ioc.Instance.AddComponentWithLifestyle("IPrivateMessageRepository", typeof(IEntityRepository<PrivateMessage, int>), typeof(EntityRepository<PrivateMessage, int>), LifestyleType.PerWebRequest);



            Ioc.Instance.AddComponentWithLifestyle("IPostRepository", typeof(IEntityRepository<Post, int>), typeof(EntityRepository<Post, int>), LifestyleType.PerWebRequest);
            Ioc.Instance.AddComponentWithLifestyle("ICategoryRepository", typeof(IEntityRepository<Category, int>), typeof(EntityRepository<Category, int>), LifestyleType.PerWebRequest);
            Ioc.Instance.AddComponentWithLifestyle("IGroupRepository", typeof(IEntityRepository<Group, int>), typeof(EntityRepository<Group, int>), LifestyleType.PerWebRequest);
            // container.Register(AllTypes.FromThisAssembly().BasedOn<IHttpController>().LifestyleTransient());

            // api registrations
            Ioc.Instance.AddComponentWithLifestyle("IForumApi", typeof(IApiRepository<Forum>), typeof(ApiRepository<Forum>), LifestyleType.PerWebRequest);
        }
 public SymmetricAlgorithmProviderAddCommand(IUIServiceWpf uiService, IAssemblyDiscoveryService discoveryService, TypePickingCommandAttribute commandAttribute, ConfigurationElementType configurationElementType, ElementCollectionViewModel elementCollectionModel)
     : base(uiService, discoveryService, commandAttribute, configurationElementType, elementCollectionModel)
 {
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ControllerRegistrationService"/> class.
 /// </summary>
 /// <param name="assemblyDiscoveryService">The dependency discovery service.</param>
 public ControllerRegistrationService(IAssemblyDiscoveryService assemblyDiscoveryService)
 {
     this.assemblyDiscoveryService = assemblyDiscoveryService;
 }
 public ValidationTypeReferenceAddCommand(IUIServiceWpf uiService, IAssemblyDiscoveryService discoveryService, TypePickingCommandAttribute commandAttribute, ConfigurationElementType configurationElementType, ElementCollectionViewModel elementCollectionModel)
     : base(uiService, discoveryService, commandAttribute, configurationElementType, elementCollectionModel)
 {
 }
 public ExceptionTypeAddCommand(TypePickingCommandAttribute commandAttribute, ConfigurationElementType configurationElementType, ElementCollectionViewModel elementCollectionModel, IUIServiceWpf uiService, IAssemblyDiscoveryService discoveryService)
     : base(uiService, discoveryService, commandAttribute, configurationElementType, elementCollectionModel)
 { }
Exemplo n.º 10
0
 public ExceptionTypeAddCommand(TypePickingCommandAttribute commandAttribute, ConfigurationElementType configurationElementType, ElementCollectionViewModel elementCollectionModel, IUIServiceWpf uiService, IAssemblyDiscoveryService discoveryService)
     : base(uiService, discoveryService, commandAttribute, configurationElementType, elementCollectionModel)
 {
 }
 public ValidationTypeReferenceAddCommand(IUIServiceWpf uiService, IAssemblyDiscoveryService discoveryService, TypePickingCommandAttribute commandAttribute, ConfigurationElementType configurationElementType, ElementCollectionViewModel elementCollectionModel)
     : base(uiService, discoveryService, commandAttribute, configurationElementType, elementCollectionModel)
 { }
Exemplo n.º 12
0
 public TestableTypePickingCollectionElementAddCommand(Type configurationElementType, ElementCollectionViewModel elementCollectionModel, string propertyToSet, IUIServiceWpf uiService, IAssemblyDiscoveryService discoveryService)
     : base(uiService, discoveryService, new TypePickingCommandAttribute(propertyToSet), new ConfigurationElementType(configurationElementType), elementCollectionModel)
 {
 }
 public TestableTypePickingCollectionElementAddCommand(Type configurationElementType, ElementCollectionViewModel elementCollectionModel, string propertyToSet, IUIServiceWpf uiService, IAssemblyDiscoveryService discoveryService)
     : base(uiService, discoveryService, new TypePickingCommandAttribute(propertyToSet), new ConfigurationElementType(configurationElementType), elementCollectionModel)
 {
 }
 public HashAlgorithmProviderAddCommand(IUIServiceWpf uiService, IAssemblyDiscoveryService discoveryService, TypePickingCommandAttribute commandAttribute, ConfigurationElementType configurationElementType, ElementCollectionViewModel elementCollectionModel)
     : base(uiService, discoveryService, commandAttribute, configurationElementType, elementCollectionModel)
 { }