public SessionDefinitionInfo Create(SessionDefinitionCreate session) { session.ThrowIfNull(nameof(session)); var definition = _mapper.Map <SessionDefinition>(session); _definitions.Add(definition); return(_mapper.Map <SessionDefinitionInfo>(definition)); }
public void Open(SessionDefinitionCreate session) { session.ThrowIfNull(nameof(session)); var definition = _mapper.Map <SessionDefinition>(session); // force default Local recorder if (definition.Recorders.Any(r => r.Name.Equals("Local", StringComparison.CurrentCultureIgnoreCase)) == false) { definition.Recorders.Add(new SessionRecorderDefinition("Local")); } if (session.Save) { _definitions.Add(definition); } var recording = _control.Record(definition); recording.OpenAsync(CancellationToken.None).Forget(); }