コード例 #1
0
        private void OnPropertyGetExecution(PropertyGetExecution propertyGetExecution)
        {
            var result = propertyExecutor.Execute(propertyGetExecution);

            connection.Send(new RpcRequest <TMarshal>()
            {
                PropertyResult = result
            });
        }
コード例 #2
0
ファイル: PropertyExecutor.cs プロジェクト: rpc-bindings/core
        public PropertyGetSetResult <TMarshal> Execute(PropertyGetExecution propertyGetExecution)
        {
            GetPropertyDescriptor(propertyGetExecution.ObjectId, propertyGetExecution.PropertyId, out var propertyDescriptor, out var objectDescriptor);

            var result = new PropertyGetSetResult <TMarshal>
            {
                ExecutionId = propertyGetExecution.ExecutionId
            };

            try
            {
                var getResult = propertyDescriptor.Getter(objectDescriptor.Object);
                result.Value   = this.BindToWire(getResult, null);
                result.Success = true;
            }
            catch (Exception e)
            {
                result.Error = e.Message;
            }

            return(result);
        }