Plugin Engine

From World Wind Wiki

Jump to: navigation, search

A C#/VB/JScript.NET Plugin Engine was added to World Wind in version 1.3.2.

Contents

[edit] Features

[edit] Engine logic

When World Wind starts the following steps are performed:

[edit] Benefits

[edit] Drawbacks

[edit] Problems

[edit] Security Lockdown Fix

Following this example we should be able to lockdown FileIO to the AppDir

public static string ReadFile(string filename)
{
  string appDir = Directory.GetCurrentDirectory();
  FileIOPermission f = new FileIOPermission(PermissionState.None);
  f.SetPathList(FileIOPermissionAccess.Read, appDir);
  f.SetPathList(FileIOPermissionAccess.PathDiscovery, appDir);
  f.PermitOnly(); 
  // Use Path.GetFilePath() to canonicalize the file name
  // Use FileStream.OpenRead to open the file
  // Use FileStream.Read to access and return the data
}

From Code Access Security in Practice – MSDN

[edit] Code Translator

C#<->VB [1] So no one can complain about languages. 🙂

[edit] External links