The Labs \ Source Viewer \ SSCLI \ Microsoft.JScript \ IEngine2

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. //*************************************************************************************
  16. // Vsa2.cs
  17. //
  18. // Contain the definitons of all the extra interfaces needed to make IActiveScript work
  19. //*************************************************************************************
  20. namespace Microsoft.JScript
  21. {
  22.    
  23.     using Microsoft.JScript.Vsa;
  24.     using System;
  25.     using Microsoft.Vsa;
  26.     using System.Reflection;
  27.     using System.Reflection.Emit;
  28.     using System.Runtime.InteropServices;
  29.     using System.Security;
  30.     using System.Security.Permissions;
  31.    
  32.     //*************************************************************************************
  33.     // IEngine2
  34.     //
  35.     // Implemented by the VsaEngine, provide the extra functionality needed by an
  36.     // IActiveScript host
  37.     //*************************************************************************************
  38.     [System.Runtime.InteropServices.GuidAttribute("BFF6C97F-0705-4394-88B8-A03A4B8B4CD7")]
  39.     [System.Runtime.InteropServices.ComVisible(true)]
  40.     public interface IEngine2
  41.     {
  42.         System.Reflection.Assembly GetAssembly();
  43.         [PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
  44.         void Run(System.AppDomain domain);
  45.         bool CompileEmpty();
  46.         [PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
  47.         void RunEmpty();
  48.         [PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
  49.         void DisconnectEvents();
  50.         [PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
  51.         void ConnectEvents();
  52.         [PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
  53.         void RegisterEventSource(string name);
  54.         [PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
  55.         void Interrupt();
  56.         [PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
  57.         void InitVsaEngine(string rootMoniker, IVsaSite site);
  58.         IVsaScriptScope GetGlobalScope();
  59.         Module GetModule();
  60.         [PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
  61.         IVsaEngine Clone(System.AppDomain domain);
  62.         [PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
  63.         void Restart();
  64.     }
  65.    
  66.     //*************************************************************************************
  67.     // ISite2
  68.     //
  69.     // Implemented by the IActiveScript site, provide the extra functionality needed by
  70.     // the VsaEngine
  71.     //*************************************************************************************
  72.     [System.Runtime.InteropServices.GuidAttribute("BFF6C980-0705-4394-88B8-A03A4B8B4CD7")]
  73.     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  74.     [System.Runtime.InteropServices.ComVisible(true)]
  75.     public interface ISite2
  76.     {
  77.         object[] GetParentChain(object obj);
  78.     }
  79.    
  80.    
  81.     //*************************************************************************************
  82.     // VSAITEMTYPE2
  83.     //
  84.     // Extendion to the types of Item Type available
  85.     //*************************************************************************************
  86.     [System.Runtime.InteropServices.GuidAttribute("581AD3D9-2BAA-3770-B92B-38607E1B463A")]
  87.     [System.Runtime.InteropServices.ComVisible(true)]
  88.     public enum VSAITEMTYPE2
  89.     {
  90.         None = 0,
  91.         HOSTOBJECT = 16,
  92.         HOSTSCOPE,
  93.         HOSTSCOPEANDOBJECT,
  94.         SCRIPTSCOPE
  95.     }
  96.    
  97.    
  98.     //*************************************************************************************
  99.     // IVsaScriptScope
  100.     //
  101.     // What was known to be a module in the IActiveScript interface. This functionality
  102.     // is what behavior in IE will use.
  103.     //*************************************************************************************
  104.     [System.Runtime.InteropServices.GuidAttribute("ED4BAE22-2F3C-419a-B487-CF869E716B95")]
  105.     [System.Runtime.InteropServices.ComVisible(true)]
  106.     public interface IVsaScriptScope : IVsaItem
  107.     {
  108.         IVsaScriptScope Parent {
  109.             get;
  110.         }
  111.        
  112.         IVsaItem AddItem(string itemName, VsaItemType type);
  113.         IVsaItem GetItem(string itemName);
  114.         void RemoveItem(string itemName);
  115.         void RemoveItem(IVsaItem item);
  116.        
  117.         int GetItemCount();
  118.         IVsaItem GetItemAtIndex(int index);
  119.         void RemoveItemAtIndex(int index);
  120.         object GetObject();
  121.        
  122.         IVsaItem CreateDynamicItem(string itemName, VsaItemType type);
  123.     }
  124.    
  125.    
  126.     //*************************************************************************************
  127.     // IVsaFullErrorInfo
  128.     //
  129.     // Used by the authoring environment to get extra information about errors
  130.     //*************************************************************************************
  131.     [System.Runtime.InteropServices.GuidAttribute("DC3691BC-F188-4b67-8338-326671E0F3F6")]
  132.     [System.Runtime.InteropServices.ComVisible(true)]
  133.     public interface IVsaFullErrorInfo : Microsoft.Vsa.IVsaError
  134.     {
  135.         int EndLine {
  136.             get;
  137.         }
  138.     }
  139.    
  140. }

Developer Fusion