internal void ChangeActiveProfile(Profile profile, ArtemisSurface surface) { if (profile != null && profile.Module != this) { throw new ArtemisCoreException($"Cannot activate a profile of module {profile.Module} on a module of plugin {PluginInfo}."); } if (!IsActivated) { throw new ArtemisCoreException("Cannot activate a profile on a deactivated module"); } lock (this) { if (profile == ActiveProfile) { return; } ActiveProfile?.Dispose(); ActiveProfile = profile; ActiveProfile?.Activate(surface); } OnActiveProfileChanged(); }
public void ChangeActiveProfile(Profile profile) { lock (this) { if (profile == null) { throw new ArgumentNullException(nameof(profile)); } ActiveProfile?.Deactivate(); ActiveProfile = profile; ActiveProfile.Activate(); } }
internal void ChangeActiveProfile(Profile profile, ArtemisSurface surface) { if (profile != null && profile.PluginInfo != PluginInfo) { throw new ArtemisCoreException($"Cannot activate a profile of plugin {profile.PluginInfo} on a module of plugin {PluginInfo}."); } lock (this) { if (profile == ActiveProfile) { return; } ActiveProfile?.Deactivate(); ActiveProfile = profile; ActiveProfile?.Activate(surface); } OnActiveProfileChanged(); }