protected ServiceBase(IServiceProvider serviceProvider, Stream stream, IEnumerable <JsonConverter>?jsonConverters = null) { InstanceId = Interlocked.Add(ref s_instanceId, 1); TestData = (RemoteHostTestData?)serviceProvider.GetService(typeof(RemoteHostTestData)); WorkspaceManager = TestData?.WorkspaceManager ?? RemoteWorkspaceManager.Default; Logger = (TraceSource)serviceProvider.GetService(typeof(TraceSource)); Log(TraceEventType.Information, "Service instance created"); // invoke all calls incoming over the stream on this service instance: EndPoint = new RemoteEndPoint(stream, Logger, incomingCallTarget: this, jsonConverters); }
protected ServiceBase(IServiceProvider serviceProvider, Stream stream, IEnumerable <JsonConverter>?jsonConverters = null) { InstanceId = Interlocked.Add(ref s_instanceId, 1); TestData = (RemoteHostTestData?)serviceProvider.GetService(typeof(RemoteHostTestData)); // in unit test, service provider will return asset storage, otherwise, use the default one AssetStorage = TestData?.AssetStorage ?? AssetStorage.Default; _workspaceManager = TestData?.WorkspaceManager ?? s_defaultWorkspaceManager; Logger = (TraceSource)serviceProvider.GetService(typeof(TraceSource)); Log(TraceEventType.Information, "Service instance created"); // invoke all calls incoming over the stream on this service instance: EndPoint = new RemoteEndPoint(stream, Logger, incomingCallTarget: this, jsonConverters); }
public RemoteHostTestData(AssetStorage assetStorage, RemoteWorkspaceManager workspaceManager, bool isInProc) { AssetStorage = assetStorage; WorkspaceManager = workspaceManager; IsInProc = isInProc; }
public RemoteHostTestData(RemoteWorkspaceManager workspaceManager, bool isInProc) { WorkspaceManager = workspaceManager; IsInProc = isInProc; }