Class ProfilerOptions
- Namespace
- Cuemon.Diagnostics
- Assembly
- Cuemon.Diagnostics.dll
Specifies options that is related to Profiler operations.
public class ProfilerOptions : IParameterObject
- Inheritance
-
ProfilerOptions
- Implements
- Derived
Examples
The following example demonstrates how to configure
using System;
using System.Reflection;
using Cuemon.Diagnostics;
using Cuemon.Reflection;
namespace MyApp.Examples;
public static class ProfilerOptionsExample
{
private sealed class SampleProfilerOptions : ProfilerOptions
{
}
public static void Demonstrate()
{
ProfilerOptions options = new SampleProfilerOptions
{
MethodDescriptor = () => MethodDescriptor.Create(MethodBase.GetCurrentMethod()!).AppendRuntimeArguments(500),
RuntimeParameters = new object[] { 500 }
};
Console.WriteLine(options.MethodDescriptor().MethodName);
Console.WriteLine(options.MethodDescriptor().RuntimeArguments.Count);
Console.WriteLine(options.RuntimeParameters.Length);
}
}
Constructors
ProfilerOptions()
Initializes a new instance of the ProfilerOptions class.
protected ProfilerOptions()
Remarks
The following table shows the initial property values for an instance of ProfilerOptions.
| Property | Initial Value |
|---|---|
| MethodDescriptor | null |
| RuntimeParameters | null |
Properties
MethodDescriptor
Gets or sets the callback function delegate that resolves a MethodDescriptor.
public Func<MethodDescriptor> MethodDescriptor { get; set; }
Property Value
- Func<MethodDescriptor>
The callback function delegate that resolves a MethodDescriptor.
RuntimeParameters
Gets or sets an Object array that represents runtime values.
public object[] RuntimeParameters { get; set; }