Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SessionRequest"/> class.
        /// </summary>
        /// <param name="reportSettings">Report settings with the project and job names to report.</param>
        /// <param name="capabilities">Capabilities that should be sent to the Agent for driver initialization.</param>
        public SessionRequest(ReportSettings reportSettings, DriverOptions capabilities)
        {
            if (reportSettings != null)
            {
                this.ProjectName = reportSettings.ProjectName;
                this.JobName     = reportSettings.JobName;
            }

            // Convert DriverOptions to a format that preserves arguments and extensions when serializing it.
            if (capabilities.GetType().Equals(typeof(GenericOptions)))
            {
                this.Capabilities = ((GenericOptions)capabilities).ToDictionary();
            }
            else
            {
                this.Capabilities = capabilities.ToString().FromJson <Dictionary <string, object> >();
            }
        }