Example #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddRazorPages();
            services.AddServerSideBlazor();
            services.AddSingleton <WeatherForecastService>();

            var ssi  = new SettingsServiceImplementation();
            var dp   = new DependencyService(ssi);
            var ss   = new SettingsService(dp);
            var ts   = new TokenService(ss);
            var rp   = new RequestProvider();
            var nec  = new HttpNeuronClient(rp, ts);
            var esf  = new IO.Process.Services.Events.EventSourceFactory();
            var nas  = new NotificationApplicationService(esf);
            var neas = new NeuronApplicationService(nec);
            var nqc  = new HttpNeuronQueryClient(rp, ts);
            var nqs  = new NeuronQueryService(nqc);

            services.AddSingleton <IDependencyService>(dp);
            services.AddSingleton <ISettingsService>(ss);
            services.AddSingleton <IRequestProvider>(rp);
            services.AddSingleton <IIdentityService>(new IdentityService(ss, rp));
            services.AddSingleton <IEventSourceFactory>(esf);
            services.AddSingleton <INotificationApplicationService>(nas);
            services.AddSingleton <INeuronClient>(nec);
            services.AddSingleton <INeuronApplicationService>(neas);
            services.AddSingleton <ITokenService>(ts);
            services.AddSingleton <INeuronQueryClient>(nqc);
            services.AddSingleton <INeuronQueryService>(nqs);
        }
Example #2
0
        public MainForm()
        {
            InitializeComponent();

            this.requestProvider          = new RequestProvider();
            this.dependencyService        = new DependencyService();
            this.settingsService          = new SettingsService(this.dependencyService);
            this.neuronGraphQueryClient   = new NeuronGraphQueryClient(this.requestProvider, this.settingsService);
            this.neuronQueryService       = new NeuronQueryService(this.neuronGraphQueryClient);
            this.neuronClient             = new NeuronClient(this.settingsService);
            this.neuronApplicationService = new NeuronApplicationService(this.neuronClient);

            this.candidateList = new ObservableCollection <Candidate>();
            this.candidateList.CollectionChanged += this.CandidateList_CollectionChanged;

            this.propertyGrid1.SelectedObject = Properties.Settings.Default;

            MainForm.logger.Info("Initializing...");
        }