< Summary

Information
Class: ImpromptuInterface.Build.ActLikeProxySerializationHelper
Assembly: ImpromptuInterface
File(s): /home/runner/work/impromptu-interface/impromptu-interface/ImpromptuInterface/src/EmitProxy/ActLikeProxySerializationHelper.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 3
Coverable lines: 3
Total lines: 53
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
GetRealObject(...)0%620%

File(s)

/home/runner/work/impromptu-interface/impromptu-interface/ImpromptuInterface/src/EmitProxy/ActLikeProxySerializationHelper.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Runtime.Serialization;
 5using System.Text;
 6
 7namespace ImpromptuInterface.Build
 8{
 9#if !SILVERLIGHT
 10
 11
 12
 13    /// <summary>
 14    /// Support Deserializing the proxy since on separate runs of an executable
 15    /// </summary>
 16    [Serializable]
 17    public class ActLikeProxySerializationHelper : IObjectReference
 18    {
 19        /// <summary>
 20        /// Original Object
 21        /// </summary>
 22        public object Original;
 23        /// <summary>
 24        /// Intefaces
 25        /// </summary>
 26    public Type[] Interfaces;
 27        /// <summary>
 28        /// Interfaces by name for Mono workaround
 29        /// </summary>
 30        public string[] MonoInterfaces;
 31        /// <summary>
 32        /// Type Context
 33        /// </summary>
 34    public Type Context;
 35
 36        /// <summary>
 37        /// Returns the real object that should be deserialized, rather than the object that the serialized stream speci
 38        /// </summary>
 39        /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> from which the curre
 40        /// <returns>
 41        /// Returns the actual object that is put into the graph.
 42        /// </returns>
 43        /// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. The 
 44        public object GetRealObject(StreamingContext context)
 45        {
 046       var tInterfaces = Interfaces ?? MonoInterfaces.Select(it=>Type.GetType(it)).ToArray();
 047           var tType =BuildProxy.DefaultProxyMaker.BuildType(Context, tInterfaces.First(), tInterfaces.Skip(1).ToArray()
 048           return ActLikeMaker.InitializeProxy(tType, Original, tInterfaces, maker:BuildProxy.DefaultProxyMaker);
 49        }
 50
 51    }
 52#endif
 53}