Exemple #1
0
        // move factories to ScriptEngine/ScriptHost?

        public static SourceUnit Create(IScriptEngine engine, SourceContentProvider contentProvider, string id, SourceCodeKind kind)
        {
            Contract.RequiresNotNull(engine, "engine");
            Contract.RequiresNotNull(contentProvider, "contentProvider");

            return(new SourceUnit(engine, contentProvider, id, kind));
        }
Exemple #2
0
        private SourceUnit(IScriptEngine engine, SourceContentProvider contentProvider, string id, SourceCodeKind kind)
        {
            Assert.NotNull(engine, contentProvider);

            _engine          = engine;
            _contentProvider = contentProvider;
            _kind            = kind;
            _id = id;
        }
Exemple #3
0
 public void SetContent(string content)
 {
     Contract.RequiresNotNull(content, "content");
     _contentProvider = new SourceStringContentProvider(content);
     ContentChanged();
 }