예제 #1
0
 public override async Task <GrpcEnvironment.KeyValuePair> GetEnvironmentVariable(GrpcEnvironment.KeyValuePair request, ServerCallContext context)
 {
     GrpcEnvironment.KeyValuePair kvp = new GrpcEnvironment.KeyValuePair();
     kvp.Key   = request.Key;
     kvp.Value = System.Environment.GetEnvironmentVariable(request.Key);
     return(kvp);
 }
예제 #2
0
    public override async Task GetEnvironmentVariables(Google.Protobuf.WellKnownTypes.Empty request, IServerStreamWriter <GrpcEnvironment.KeyValuePair> responseStream, ServerCallContext context)
    {
        var env = Environment.GetEnvironmentVariables();

        foreach (DictionaryEntry entry in env)
        {
            GrpcEnvironment.KeyValuePair kvp = new GrpcEnvironment.KeyValuePair();
            kvp.Key   = entry.Key.ToString();
            kvp.Value = entry.Value.ToString();
            await responseStream.WriteAsync(kvp);
        }
    }
예제 #3
0
 public override async Task <Google.Protobuf.WellKnownTypes.Empty> SetEnvironmentVariable(GrpcEnvironment.KeyValuePair request, ServerCallContext context)
 {
     System.Environment.SetEnvironmentVariable(request.Key, request.Value);
     return(new Google.Protobuf.WellKnownTypes.Empty());
 }