Skip to content

Instantly share code, notes, and snippets.

@furkankaracan
Last active April 5, 2023 08:11
Embed
What would you like to do?
public void Execute(IServiceProvider serviceProvider)
{
// Obtain the tracing service
ITracingService tracingService = (ITracingService)serviceProvider.GetService(typeof(ITracingService));
// Obtain the execution context from the service provider.
IPluginExecutionContext executionContext = (IPluginExecutionContext)
serviceProvider.GetService(typeof(IPluginExecutionContext))
bool myFlag = false;
//Check existence of shared variable and fetch the value from executionContext
if (executionContext != null && executionContext.SharedVariables.ContainsKey("MyFlag"))
{
myFlag = (bool)executionContext.SharedVariables.ContainsKey("MyFlag");
}
//if(myFlag)
// your logic
//else
// your logic
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment