예제 #1
0
        public PropertyGetSetResult <TMarshal> Execute(PropertySetExecution <TMarshal> propertySetExecution)
        {
            GetPropertyDescriptor(propertySetExecution.ObjectId, propertySetExecution.PropertyId, out var propertyDescriptor, out var objectDescriptor);

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

            try
            {
                propertyDescriptor.Setter(objectDescriptor.Object, this.BindToNet(
                                              new Binding <TMarshal>
                {
                    Value      = propertySetExecution.Value,
                    TargetType = propertyDescriptor.Type
                }));
                result.Success = true;
            }
            catch (Exception e)
            {
                result.Error = e.Message;
            }

            return(result);
        }
예제 #2
0
        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);
        }