Game Development Reference
private NamedPermissionSet FindNamedPermissionSet(string name)
IEnumerator policyEnumerator = SecurityManager.PolicyHierarchy();
PolicyLevel currentLevel = policyEnumerator.Current
if (currentLevel.Label == “Machine”)
IList namedPermissions = currentLevel.NamedPermissionSets;
IEnumerator namedPerm = namedPermissions.GetEnumerator();
if (((NamedPermissionSet)namedPerm.Current).Name == name)
Each instance of the plugin library class represents a plugin assembly or source file
in the plugins directory. Therefore, each plugin has its own temporary AppDomain
that can be unloaded at will without affecting the rest of the system.
Reloading Plugins During Runtime
The majority of plugin-enabled applications load and initialize all plugins when
the application first launches, but plugins would not be reloaded if they had
changed on the file system. The new version of the plugins would not be visible
until the application had relaunched. It would be even better if the application
could detect file system changes and automatically reload plugins that had changed.
This would greatly speed up plugin debugging and development.