コード例 #1
0
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, MonochromatorBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_Initialize, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.LightAnalysis.Monochromator.InitializeRequest, global::Instrosetta.Interfaces.LightAnalysis.Monochromator.InitializeResponse>(serviceImpl.Initialize));
     serviceBinder.AddMethod(__Method_Shutdown, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.LightAnalysis.Monochromator.ShutdownRequest, global::Instrosetta.Interfaces.LightAnalysis.Monochromator.ShutdownResponse>(serviceImpl.Shutdown));
     serviceBinder.AddMethod(__Method_GetWavelengthRange, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.LightAnalysis.Monochromator.GetWavelengthRangeRequest, global::Instrosetta.Interfaces.LightAnalysis.Monochromator.GetWavelengthRangeResponse>(serviceImpl.GetWavelengthRange));
     serviceBinder.AddMethod(__Method_GetWavelength, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.LightAnalysis.Monochromator.GetWavelengthRequest, global::Instrosetta.Interfaces.LightAnalysis.Monochromator.GetWavelengthResponse>(serviceImpl.GetWavelength));
     serviceBinder.AddMethod(__Method_SetWavelength, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.LightAnalysis.Monochromator.SetWavelengthRequest, global::Instrosetta.Interfaces.LightAnalysis.Monochromator.SetWavelengthResponse>(serviceImpl.SetWavelength));
     serviceBinder.AddMethod(__Method_GetGratingOptions, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.LightAnalysis.Monochromator.GetGratingOptionsRequest, global::Instrosetta.Interfaces.LightAnalysis.Monochromator.GetGratingOptionsResponse>(serviceImpl.GetGratingOptions));
     serviceBinder.AddMethod(__Method_GetGrating, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.LightAnalysis.Monochromator.GetGratingRequest, global::Instrosetta.Interfaces.LightAnalysis.Monochromator.GetGratingResponse>(serviceImpl.GetGrating));
     serviceBinder.AddMethod(__Method_SetGrating, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.LightAnalysis.Monochromator.SetGratingRequest, global::Instrosetta.Interfaces.LightAnalysis.Monochromator.SetGratingResponse>(serviceImpl.SetGrating));
     serviceBinder.AddMethod(__Method_GetSlitWidthRange, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.LightAnalysis.Monochromator.GetSlitWidthRangeRequest, global::Instrosetta.Interfaces.LightAnalysis.Monochromator.GetSlitWidthRangeResponse>(serviceImpl.GetSlitWidthRange));
     serviceBinder.AddMethod(__Method_GetSlitWidth, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.LightAnalysis.Monochromator.GetSlitWidthRequest, global::Instrosetta.Interfaces.LightAnalysis.Monochromator.GetSlitWidthResponse>(serviceImpl.GetSlitWidth));
     serviceBinder.AddMethod(__Method_SetSlitWidth, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Instrosetta.Interfaces.LightAnalysis.Monochromator.SetSlitWidthRequest, global::Instrosetta.Interfaces.LightAnalysis.Monochromator.SetSlitWidthResponse>(serviceImpl.SetSlitWidth));
 }
コード例 #2
0
 /// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(MonochromatorBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_Initialize, serviceImpl.Initialize)
            .AddMethod(__Method_Shutdown, serviceImpl.Shutdown)
            .AddMethod(__Method_GetWavelengthRange, serviceImpl.GetWavelengthRange)
            .AddMethod(__Method_GetWavelength, serviceImpl.GetWavelength)
            .AddMethod(__Method_SetWavelength, serviceImpl.SetWavelength)
            .AddMethod(__Method_GetGratingOptions, serviceImpl.GetGratingOptions)
            .AddMethod(__Method_GetGrating, serviceImpl.GetGrating)
            .AddMethod(__Method_SetGrating, serviceImpl.SetGrating)
            .AddMethod(__Method_GetSlitWidthRange, serviceImpl.GetSlitWidthRange)
            .AddMethod(__Method_GetSlitWidth, serviceImpl.GetSlitWidth)
            .AddMethod(__Method_SetSlitWidth, serviceImpl.SetSlitWidth).Build());
 }