static Container()
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(System.Environment.CurrentDirectory)
                          .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
                          //per user config that is not committed to repo, use this to override settings (e.g. connection string) based on your local environment.
                          .AddJsonFile($"appsettings.local.json", optional: true);

            builder.AddEnvironmentVariables();

            Configuration = builder.Build();

            Settings = Configuration.Load <ArangoDbSettings>("ArangoDbSettings");

            ArangoDbIdentityConfiguration = new ArangoDbIdentityConfiguration()
            {
                ArangoDbSettings      = Settings,
                IdentityOptionsAction = (options) =>
                {
                    options.Password.RequireDigit           = false;
                    options.Password.RequireLowercase       = false;
                    options.Password.RequireNonAlphanumeric = false;
                    options.Password.RequireUppercase       = false;
                    options.User.AllowedUserNameCharacters  = null;
                }
            };

            ArangoRepository = new ArangoRepository(Settings);
        }
Exemple #2
0
        public EmulatedDatabasesItem(
            ArangoRepository repository,
            IdAllocator idAllocator
            )
        {
            this.Repository  = repository;
            this.idAllocator = idAllocator;

            id          = idAllocator.NextId();
            displayName = "Emulated databases";
            icon        = (Texture2D)EditorGUIUtility.IconContent(
                "d_Profiler.Physics"
                ).image;

            BuildChildren();
        }
Exemple #3
0
        /// <summary>
        /// Registers services that need not be recreated
        /// when preferences change.
        /// </summary>
        private void RegisterIndependentServices()
        {
            Bind <ApiUrl>(_ => new ApiUrl(Preferences.ServerUrl));

            Singleton <SessionIdRepository>(_ => new SessionIdRepository());
            Singleton <DeviceIdRepository>(_ => new DeviceIdRepository());

            Bind <ArangoRepository>(_ => ArangoRepository.GetInstance());

            Bind <FacetCaller>(_ => {
                if (Preferences.AlwaysEmulate)
                {
                    return(Resolve <EmulatedFacetCaller>());
                }

                return(Resolve <UnisaveFacetCaller>());
            });

            Singleton <EmulatedFacetCaller>(_ => new EmulatedFacetCaller(this));

            Singleton <UnisaveFacetCaller>(_ => new UnisaveFacetCaller(this));
        }