Last active
August 29, 2015 14:21
-
-
Save cromica/7299796351f364d93aa5 to your computer and use it in GitHub Desktop.
Disable global verifiers for an SDL Studio project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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