private InstrumentationService CreateInstrumentationService(params dynamic[] listeners) { dynamic service = new ExpandoObject(); service.ExecutionListeners = new List<dynamic>(listeners); InstrumentationService inst = new InstrumentationService(); inst.IsAvailable = true; inst.ExtractInstrumentationService = _ => new PageInstrumentationServiceAdapter(service); inst.CreateContext = CreateExpandoContext; return inst; }
public WebPageRazorHost(string virtualPath, string physicalPath) : this() { if (String.IsNullOrEmpty(virtualPath)) { throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, CommonResources.Argument_Cannot_Be_Null_Or_Empty, "virtualPath"), "virtualPath"); } VirtualPath = virtualPath; PhysicalPath = physicalPath; DefaultClassName = GetClassName(VirtualPath); CodeLanguage = GetCodeLanguage(); EnableInstrumentation = new InstrumentationService().IsAvailable; }