Esempio n. 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));
        }
Esempio n. 2
0
        private SourceUnit(IScriptEngine engine, SourceContentProvider contentProvider, string id, SourceCodeKind kind)
        {
            Assert.NotNull(engine, contentProvider);

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