void ReadManifest ()
{
XamlLoader loader = XamlLoader.CreateManagedXamlLoader (null, Surface.Native, PluginHost.Handle);
string app_manifest = Path.Combine (XapDir, "appmanifest.xaml");
if (!File.Exists (app_manifest))
throw new MoonException(2103, "Invalid or malformed application: Check manifest");
string app_manifest_contents;
using (StreamReader r = new StreamReader (app_manifest))
app_manifest_contents = r.ReadToEnd();
using (var v = Value.FromObject (this)) {
try {
loader.Hydrate (v, app_manifest_contents);
} catch (Exception e) {
throw new MoonException (7016, e.Message);
}
}
if (RuntimeVersion == null)
throw new MoonException (2105, "No RuntimeVersion specified in AppManifest");
CompareRuntimeVersions ();
if (EntryPointAssembly == null)
throw new MoonException (2103, "Invalid or malformed application: Check manifest");
if (EntryPointType == null)
throw new Exception ("No entrypoint defined in the AppManifest.xaml");
}