Esempio n. 1
0
        public void Apply(WindowsScriptEngine wse)
        {
            foreach (var item in Sources)
            {
                var src = new StreamReader(item.Value);

                if (item.Key.EndsWith(".js"))
                {
                    wse.Execute(src.ReadToEnd());
                }
            }
        }
Esempio n. 2
0
        public void Apply(WindowsScriptEngine wse)
        {
            foreach (var item in Sources)
            {
                var src = new StreamReader(item.Value);

                if (item.Key.EndsWith(".js"))
                {
                    wse.Execute(src.ReadToEnd());
                }
            }
        }
Esempio n. 3
0
        public void Dispose()
        {
            Events.Fire("OnDispose");

            Dependencies     = null;
            Filename         = null;
            Icons            = null;
            Info             = null;
            ItemTemplates    = null;
            ProjectTemplates = null;
            Properties       = null;
            _engine          = null;
        }
Esempio n. 4
0
 public void Dispose()
 {
     Dependencies     = null;
     Filename         = null;
     Highlightings    = null;
     Icons            = null;
     Info             = null;
     ItemTemplates    = null;
     Language         = null;
     ProjectTemplates = null;
     Properties       = null;
     _engine          = null;
 }
Esempio n. 5
0
        public static object Wrap(WindowsScriptEngine engine, object obj)
        {
            Debug.Assert(!(obj is IScriptMarshalWrapper));

            if (obj == null)
            {
                return(null);
            }

            var expando = obj as IExpando;

            if ((expando != null) && (obj.GetType().IsCOMObject))
            {
                return(new WindowsScriptItem(engine, expando));
            }

            return(obj);
        }
Esempio n. 6
0
 public static void Require(WindowsScriptEngine se, Assembly ass)
 {
     Type[] types = ass.GetTypes();
     foreach (Type type in types)
     {
         object[] ca = type.GetCustomAttributes(typeof(ModuleAttribute), false);
         if (ca != null)
         {
             foreach (MethodInfo method in type.GetMethods())
             {
                 se.AddHostObject(method.Name, Delegate.CreateDelegate(type, method));
             }
         }
         else
         {
             se.AddHostType(type.Name, type);
         }
     }
 }
Esempio n. 7
0
        public void Apply(WindowsScriptEngine wse, string Language)
        {
            foreach (var item in Sources)
            {
                var src = new StreamReader(item.Value);

                if(Language == "JavaScript")
                {
                    if(item.Key.EndsWith(".js"))
                    {
                        wse.Execute(src.ReadToEnd());
                    }
                }
                else
                {
                    if (item.Key.EndsWith(".vbs"))
                    {
                        wse.Execute(src.ReadToEnd());
                    }
                }
            }
        }
Esempio n. 8
0
        public void Apply(WindowsScriptEngine wse, string Language)
        {
            foreach (var item in Sources)
            {
                var src = new StreamReader(item.Value);

                if (Language == "JavaScript")
                {
                    if (item.Key.EndsWith(".js"))
                    {
                        wse.Execute(src.ReadToEnd());
                    }
                }
                else
                {
                    if (item.Key.EndsWith(".vbs"))
                    {
                        wse.Execute(src.ReadToEnd());
                    }
                }
            }
        }
 public ScriptSite(WindowsScriptEngine engine)
 {
     this.engine = engine;
 }
Esempio n. 10
0
 private WindowsScriptItem(WindowsScriptEngine engine, IExpando target)
 {
     this.engine = engine;
        this.target = target;
 }
Esempio n. 11
0
        public static object Wrap(WindowsScriptEngine engine, object obj)
        {
            Debug.Assert(!(obj is IScriptMarshalWrapper));

            if (obj == null)
            {
                return null;
            }

            var expando = obj as IExpando;
            if ((expando != null) && (obj.GetType().IsCOMObject))
            {
                return new WindowsScriptItem(engine, expando);
            }

            return obj;
        }
Esempio n. 12
0
 private WindowsScriptItem(WindowsScriptEngine engine, IExpando target)
 {
     this.engine = engine;
     this.target = target;
 }
Esempio n. 13
0
 public static void Require(WindowsScriptEngine se, string ass)
 {
     Require(se, Assembly.LoadFile(ass));
 }
Esempio n. 14
0
        public void Dispose()
        {
            Events.Fire("OnDispose");

            Dependencies = null;
            Filename = null;
            Icons = null;
            Info = null;
            ItemTemplates = null;
            ProjectTemplates = null;
            Properties = null;
            _engine = null;
        }
Esempio n. 15
0
 public void Dispose()
 {
     Dependencies = null;
     Filename = null;
     Highlightings = null;
     Icons = null;
     Info = null;
     ItemTemplates = null;
     Language = null;
     ProjectTemplates = null;
     Properties = null;
     _engine = null;
 }