/// <summary>Creates a new NitroCode with the given nitro code, type to derive from and security manager.</summary> /// <param name="code">The code to compile.</param> /// <param name="baseType">The type that the compiled code will inherit. /// This is the type to cast <see cref="Nitro.NitroCode.Instance"/> to.</param> /// <param name="manager">The security manager which defines what the code can access.</param> /// <param name="aotFile">A DLL path to write the compiled code to (For e.g. AOT compilation).</param> public NitroCode(string code, Type baseType, NitroDomainManager manager, string aotFile, string aotAssemblyName) { if (manager == null) { manager = NitroDomainManager.GetDefaultManager(); } ScriptDomainManager = manager; References = manager.GetDefaultReferences(); if (code != null) { Compile(code, baseType, aotFile, aotAssemblyName); } }
/// <summary>Creates a new NitroCode with the given nitro code, type to derive from and security manager.</summary> /// <param name="code">The code to compile.</param> /// <param name="baseType">The type that the compiled code will inherit. /// This is the type to cast <see cref="Nitro.NitroCode.Instance"/> to.</param> /// <param name="manager">The security manager which defines what the code can access.</param> public NitroCode(string code, Type baseType, NitroDomainManager manager) : this(code, baseType, manager, null, null) { }
/// <summary>Creates a new NitroCode with the given security manager. /// You'll need to call <see cref="Nitro.NitroCode.Compile"/> manually.</summary> /// <param name="manager">The security manager which defines what the code can access.</param> public NitroCode(NitroDomainManager manager) : this(null, null, manager, null, null) { }
/// <summary>Creates a new NitroCode with the given nitro code and security manager.</summary> /// <param name="code">The code to compile.</param> /// <param name="manager">The security manager which defines what the code can access.</param> public NitroCode(string code, NitroDomainManager manager) : this(code, null, manager, null, null) { }
/// <summary>Creates a new NitroCode with the given nitro code and security manager.</summary> /// <param name="code">The code to compile.</param> /// <param name="manager">The security manager which defines what the code can access.</param> public NitroCode(string code,NitroDomainManager manager):this(code,null,manager,null,null){}
/// <summary>Creates a new NitroCode with the given security manager. /// You'll need to call <see cref="Nitro.NitroCode.Compile"/> manually.</summary> /// <param name="manager">The security manager which defines what the code can access.</param> public NitroCode(NitroDomainManager manager):this(null,null,manager,null,null){}
/// <summary>Creates a new NitroCode with the given nitro code, type to derive from and security manager.</summary> /// <param name="code">The code to compile.</param> /// <param name="baseType">The type that the compiled code will inherit. /// This is the type to cast <see cref="Nitro.NitroCode.Instance"/> to.</param> /// <param name="manager">The security manager which defines what the code can access.</param> /// <param name="aotFile">A DLL path to write the compiled code to (For e.g. AOT compilation).</param> public NitroCode(string code,Type baseType,NitroDomainManager manager,string aotFile,string aotAssemblyName){ if(manager==null){ manager=NitroDomainManager.GetDefaultManager(); } ScriptDomainManager=manager; References=manager.GetDefaultReferences(); if(code!=null){ Compile(code,baseType,aotFile,aotAssemblyName); } }
/// <summary>Creates a new NitroCode with the given nitro code, type to derive from and security manager.</summary> /// <param name="code">The code to compile.</param> /// <param name="baseType">The type that the compiled code will inherit. /// This is the type to cast <see cref="Nitro.NitroCode.Instance"/> to.</param> /// <param name="manager">The security manager which defines what the code can access.</param> public NitroCode(string code,Type baseType,NitroDomainManager manager):this(code,baseType,manager,null,null){}
/// <summary>Creates a new document which will be rendered with the given renderer.</summary> /// <param name="renderer">The renderer to use when rendering this document.</param> /// <param name="parentWindow">The window that will become the parent window. Used in e.g. iframes.</param> /// <param name="aot">True if this is a Nitro AOT document (used in the Editor only).</param> public Document(Renderman renderer,Window parentWindow,bool aot):base(){ AotDocument=aot; if(!aot && DefaultStyleSheet==null){ // No default styles loaded yet. Load them now. string styleText=((TextAsset)Resources.Load("style")).text; // Have they applied any overrides? TextAsset extraStyle=Resources.Load("customStyle") as TextAsset; if(extraStyle!=null && extraStyle.text!=null){ styleText+="\n\n"+extraStyle.text; } DefaultStyleSheet=new Css.StyleSheet(this); DefaultStyleSheet.ParseCss(styleText); } #if !NoNitroRuntime // Get the default security domain: SecurityDomain=UI.DefaultSecurityDomain; #endif Renderer=renderer; window=new Window(); window.document=this; window.parent=parentWindow; if(parentWindow!=null){ window.top=parentWindow.top; }else{ window.top=window; } ActiveFonts=new Dictionary<string,DynamicFont>(); Style=new Css.StyleSheet(this); html=new Element(this,null); html.SetTag("html"); string ddbox=""; if(parentWindow==null){ // Dropdown box belongs to the top window only: ddbox="<ddbox></ddbox>"; } html.innerHTML="<body></body>"+ddbox; }