Skip to content

Commit

Permalink
Removed Stylecop comments from IpcRequest, fixed IpcServiceClient to …
Browse files Browse the repository at this point in the history
…populate ParameterTypes
  • Loading branch information
Paolucci, Robert authored and Paolucci, Robert committed May 14, 2019
1 parent e0f7aa8 commit 7e15b31
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 28 deletions.
7 changes: 7 additions & 0 deletions src/JKang.IpcServiceFramework.Client/IpcServiceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using JKang.IpcServiceFramework.Services;
using System;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -123,6 +124,12 @@ private static IpcRequest GetRequest(Expression exp, MyInterceptor interceptor)
{
MethodName = interceptor.LastInvocation.Method.Name,
Parameters = interceptor.LastInvocation.Arguments,

ParameterTypes = interceptor.LastInvocation.Method.GetParameters()
.Select(p => p.ParameterType)
.ToArray(),


GenericArguments = interceptor.LastInvocation.GenericArguments,
};
}
Expand Down
34 changes: 6 additions & 28 deletions src/JKang.IpcServiceFramework.Core/IpcRequest.cs
Original file line number Diff line number Diff line change
@@ -1,45 +1,23 @@
// ---------------------------------------------------------------------------
// <copyright file="IpcRequest.cs" company="JKang">
// (c) All Rights Reserved.
// </copyright>
// ---------------------------------------------------------------------------
using System;

namespace JKang.IpcServiceFramework
{
using System;

/// <summary>
/// The request packet for an IPC call
/// </summary>
public class IpcRequest
{
/// <summary>
/// Contains the generic argument fields for the IPC method to call
/// </summary>
private Type[] genericArguments = new Type[0];

/// <summary>
/// Gets or sets the name of the IPC method to call
/// </summary>
public string MethodName { get; set; } = string.Empty;
private Type[] _genericArguments = new Type[0];

/// <summary>
/// Gets or sets the parameters of the IPC method to call
/// </summary>
public object[] Parameters { get; set; } = new object[0];
public string MethodName { get; set; }
public object[] Parameters { get; set; }

/// <summary>
/// Gets or sets the types of parameter of the IPC method to call
/// </summary>
public Type[] ParameterTypes { get; set; } = new Type[0];

/// <summary>
/// Gets or sets the generic arguments for the IPC method to call
/// </summary>
public Type[] GenericArguments
{
get => this.genericArguments ?? new Type[0];
set => this.genericArguments = value;
get => _genericArguments ?? new Type[0];
set => _genericArguments = value;
}
}
}

0 comments on commit 7e15b31

Please sign in to comment.