示例#1
0
        private void ShowClientInfor(Client newClient)
        {
            var clientViewModel = new ClientViewModel(newClient);
            var uc = new UcClient(clientViewModel, _editType);

            uc.AddRequest   = AddRequestDelegate;
            uc.ShowRequests = ShowAllRequestDelegate;
            var mainStack = MainStackPanel;

            mainStack.Children.Clear();

            mainStack.Children.Add(uc);
            DisableEnable();
        }
示例#2
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddSingleton <OiCamera>((x) =>
     {
         var camera = OiCameraBootstraper.Connect();
         var result = camera.Result;
         result.TryStart();
         return(result);
     });
     services.AddSingleton <IReceiverProducer <object, RawFrame>, FakePacketProducer>();
     services.AddSingleton <SerialPortDescriptor>(s => UcClient.GetFirstConnected());
     services.AddSingleton(x =>
     {
         var spd    = x.GetService <SerialPortDescriptor>();
         var result = default(IUcScannerClient);
         if (spd != null)
         {
             result = new UcClient(spd);
         }
         else
         {
             result = new FakeUcClient();
         }
         result.TryStartAsync();
         return(result);
     });
     services.AddSingleton <Notifier>();
     services.AddCors(options => options.AddPolicy("CorsPolicy", builder =>
     {
         builder
         .AllowAnyMethod()
         .AllowAnyHeader()
         .AllowCredentials()
         .WithOrigins("http://localhost:3001")
         .WithOrigins("http://localhost:3000")
         ;
     }));
     services.AddSignalR();
     services.AddControllers();
     services.AddApplicationInsightsTelemetry();
 }