Skip to content

Instantly share code, notes, and snippets.

@cromica
Last active August 29, 2015 14:21
Show Gist options
  • Save cromica/7299796351f364d93aa5 to your computer and use it in GitHub Desktop.
Save cromica/7299796351f364d93aa5 to your computer and use it in GitHub Desktop.
Disable global verifiers for an SDL Studio project
//load the project
var studioProject = new FileBasedProject(@"{Project file path}");
//get the project settings as settings bundle
ISettingsBundle settingsBundle = studioProject.GetSettings();
//obtain all global verifiers registered
IExtensionPoint globalVerifiersExtensionPoint = PluginManager.DefaultPluginRegistry.GetExtensionPoint<GlobalVerifierAttribute>());
if (globalVerifiersExtensionPoint != null)
{
//iterate to all global verifiers
foreach (var extension in globalVerifiersExtensionPoint.Extensions)
{
//create an instance of the verifier to obtain the settings id which
//we use to obtain the specific group
var globalVerifier = (IGlobalVerifier) extension.CreateInstance();
var settingsGroup = settingsBundle.GetSettingsGroup(globalVerifier.SettingsId);
//update the Enabled setting for the current verifier settings group
settingsGroup.GetSetting("Enabled", true).Value = false;
}
}
//save the changes
studioProject.Save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment