Пример #1
0
        private void servicesSettingToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            ServiceSetup frm = new ServiceSetup();

            frm.MdiParent = this;
            frm.Show();
        }
Пример #2
0
        public static void Main(string[] args)
        {
            var directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            if (!File.Exists(Path.Combine(directory, "appsettings.json")))
            {
                log.Error("Configuration file appsettings.json not found");
                return;
            }

            try
            {

                log.Info("Starting {0} version utility...", Assembly.GetExecutingAssembly().GetName().Version);
                List<Command> commandsList = new List<Command>();
                commandsList.Add(new DiscoverButtonsCommand());
                commandsList.Add(new SetupBridgeCommand());
                var commands = commandsList.ToDictionary(item => item.Name, item => item, StringComparer.OrdinalIgnoreCase);

                if (args.Length == 0 ||
                    !commands.TryGetValue(args[0], out var command))
                {
                    log.Info("Starting as service");
                    var setup = new ServiceSetup();
                    setup.StartService(directory);
                    return;
                }

                command.ParseArguments(args.Skip(1));
                command.Execute();
            }
            catch (Exception e)
            {
                log.Error(e);
            }
        }
Пример #3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();

            services.AddDbContext <DoenerOrderContext>(options =>
            {
                options.UseNpgsql(Configuration.GetConnectionString("DefaultConnection"));
            });
            services.AddDbContext <AppIdentityDbContext>(options =>
            {
                options.UseNpgsql(Configuration.GetConnectionString("IdentityConnection"));
            });

            IdentitySetup.ConfigureService(services);
            JwtSetup.ConfigureService(services, Configuration);
            SwaggerSetup.ConfigureService(services);

            services.AddMediatR(typeof(CreateSupplierCommand).Assembly);
            services.AddValidatorsFromAssembly(typeof(CreateSupplierCommand).Assembly);
            services.AddTransient(typeof(IPipelineBehavior <,>), typeof(ValidationBehavior <,>));

            ServiceSetup.ConfigureService(services);

            services.AddCors(options =>
                             options.AddPolicy("AllowAll", builder => { builder.WithOrigins("*").AllowAnyMethod(); })
                             );
        }
Пример #4
0
        public void ConfigureServices(IServiceCollection services)
        {
            //Set up database
            var databaseSetup = new DatabaseSetup(Configuration, services);

            databaseSetup.Configure();

            //Confirgure services (DI)
            var serviceSetup = new ServiceSetup(Configuration, services);

            serviceSetup.ConfigureBasic();
            serviceSetup.ConfigureAuthentication();
            serviceSetup.ConfigureServices();
            serviceSetup.ConfigureLogging();

            var identitySetup = new IdentitySetup(Configuration, services);

            identitySetup.Configure();

            var emailSetup = new EmailSetup(Configuration, services);

            emailSetup.Configure();

            services.AddApplicationInsightsTelemetry();
        }
Пример #5
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <AppSettings>(Configuration);

            ServiceSetup.SetupService(services, Configuration);


            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
        }
Пример #6
0
        private bool GetIsValid(ServiceSetup setup)
        {
            bool   isValid = false;
            Config cfg     = Config.Instance;

            Config.CredentialInfo info = cfg.FindCredentials(setup.ServiceID);
            if (info != null)
            {
                if ((!string.IsNullOrEmpty(info.m_URL) && !string.IsNullOrEmpty(info.m_Password)) || !string.IsNullOrEmpty(info.m_Apikey))
                {
                    isValid = true;
                }
            }

            return(isValid);
        }
Пример #7
0
 public VirtualFileTemplateContributorTests()
 {
     _services = ServiceSetup.GetTextTemplatingServiceProvider();
     _templateDefinitionManager             = _services.GetRequiredService <ITemplateDefinitionManager>();
     _virtualFileTemplateContentContributor = _services.GetRequiredService <VirtualFileTemplateContentContributor>();
 }
Пример #8
0
        public LocalizedTemplateContentReaderFactoryTests()
        {
            IServiceProvider services = ServiceSetup.GetTextTemplatingServiceProvider();

            _templateDefinitionManager = services.GetRequiredService <ITemplateDefinitionManager>();
        }