• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Vsa.VsaEngine类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.JScript.Vsa.VsaEngine的典型用法代码示例。如果您正苦于以下问题:C# VsaEngine类的具体用法?C# VsaEngine怎么用?C# VsaEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VsaEngine类属于Microsoft.JScript.Vsa命名空间,在下文中一共展示了VsaEngine类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: VsaItem

 internal VsaItem(VsaEngine engine, string name, VsaItemType type, VsaItemFlag flag)
 {
     this.engine = engine;
     this.name = name;
     this.type = type;
     this.flag = flag;
 }
开发者ID:mayatforest,项目名称:Refractor,代码行数:7,代码来源:VsaItem.cs


示例2: CallValue2

	// Perform a late binding call, with reversed arguments.
	public static Object CallValue2(Object val, Object thisob,
								    Object[] arguments, bool construct,
								    bool brackets, VsaEngine engine)
			{
				// TODO
				return null;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:LateBinding.cs


示例3: FunctionObject

 internal FunctionObject(Type t, string name, string method_name, string[] formal_parameters, JSLocalField[] fields, bool must_save_stack_locals, bool hasArgumentsObject, string text, VsaEngine engine) : base(engine.Globals.globalObject.originalFunction.originalPrototype, name, formal_parameters.Length)
 {
     base.engine = engine;
     this.formal_parameters = formal_parameters;
     this.argumentsSlotNumber = 0;
     this.body = null;
     this.method = TypeReflector.GetTypeReflectorFor(Globals.TypeRefs.ToReferenceContext(t)).GetMethod(method_name, BindingFlags.Public | BindingFlags.Static);
     this.parameterInfos = this.method.GetParameters();
     if (!Microsoft.JScript.CustomAttribute.IsDefined(this.method, typeof(JSFunctionAttribute), false))
     {
         this.isMethod = true;
     }
     else
     {
         JSFunctionAttributeEnum attributeValue = ((JSFunctionAttribute) Microsoft.JScript.CustomAttribute.GetCustomAttributes(this.method, typeof(JSFunctionAttribute), false)[0]).attributeValue;
         this.isExpandoMethod = (attributeValue & JSFunctionAttributeEnum.IsExpandoMethod) != JSFunctionAttributeEnum.None;
     }
     this.funcContext = null;
     this.own_scope = null;
     this.fields = fields;
     this.must_save_stack_locals = must_save_stack_locals;
     this.hasArgumentsObject = hasArgumentsObject;
     this.text = text;
     this.attributes = MethodAttributes.Public;
     this.globals = engine.Globals;
     this.superConstructor = null;
     this.superConstructorCall = null;
     this.enclosing_scope = this.globals.ScopeStack.Peek();
     base.noExpando = false;
     this.clsCompliance = CLSComplianceSpec.NotAttributed;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:31,代码来源:FunctionObject.cs


示例4: concat

 public static ArrayObject concat(object thisob, VsaEngine engine, params object[] args)
 {
     ArrayObject obj2 = engine.GetOriginalArrayConstructor().Construct();
     if (thisob is ArrayObject)
     {
         obj2.Concat((ArrayObject) thisob);
     }
     else
     {
         obj2.Concat(thisob);
     }
     for (int i = 0; i < args.Length; i++)
     {
         object obj3 = args[i];
         if (obj3 is ArrayObject)
         {
             obj2.Concat((ArrayObject) obj3);
         }
         else
         {
             obj2.Concat(obj3);
         }
     }
     return obj2;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:ArrayPrototype.cs


示例5: OnEngineClosed

 		public void OnEngineClosed ()
		{
			VsaEngine engine = new VsaEngine ();
			IVsaItems items;
			IVsaItem item;

			engine = new VsaEngine ();
			engine.RootMoniker = "com.foo://path/to/nowhere";
			engine.Site = new Site ();

			engine.InitNew ();
			items = engine.Items;
			engine.Close ();
		
			int size;

			try {
				size = items.Count;
			} catch (VsaException e) {
				Assert.AreEqual (VsaError.EngineClosed, e.ErrorCode, "#1");
			}

			try {
				item = items.CreateItem ("itemx", VsaItemType.Code, 
							 VsaItemFlag.Class);
			} catch (VsaException e) {
				Assert.AreEqual (VsaError.EngineClosed, e.ErrorCode, "#2");
			}
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:29,代码来源:VsaItemsTest.cs


示例6: CallValue

        public static object CallValue(object thisObj, object val, object [] arguments,
            bool construct, bool brackets, VsaEngine engine)
        {
            if (construct) {
                if (brackets) {
                }

                if (val is Closure)
                    return ((Closure) val).func.CreateInstance (arguments);
                else if (val is FunctionObject)
                    return ((FunctionObject) val).CreateInstance (arguments);
            } else if (brackets) {
                object first_arg = arguments.Length > 0 ? arguments [0] : null;
                return GetObjectProperty ((ScriptObject) Convert.ToObject (val, engine), Convert.ToString (first_arg));
            } else {
                if (val is Closure)
                    return ((Closure) val).func.Invoke (thisObj, arguments);
                else if (val is FunctionObject)
                    return ((FunctionObject) val).Invoke (thisObj, arguments);
                else if (val is RegExpObject) {
                    object first_arg = arguments.Length > 0 ? arguments [0] : null;
                    return RegExpPrototype.exec (val, first_arg);
                } else
                    return null;
            }

            Console.WriteLine ("CallValue: construct = {0}, brackets = {1}, this = {2}, val = {3} ({4}), arg[0] = {5}",
                construct, brackets, thisObj.GetType (), val, val.GetType (), arguments [0]);
            throw new NotImplementedException ();
        }
开发者ID:mayatforest,项目名称:Refractor,代码行数:30,代码来源:LateBinding.cs


示例7: AddDefinition

 private void AddDefinition(string def, Hashtable definitions, VsaEngine engine){
   int equalsIndex = def.IndexOf("=");
   string key;
   string strValue;
   object value = null;
   if (equalsIndex == -1){
     key = def.Trim();
     value = true;
   }else{
     key = def.Substring(0, equalsIndex).Trim();
     strValue = def.Substring(equalsIndex + 1).Trim();
     if (String.Compare(strValue, "true", StringComparison.OrdinalIgnoreCase) == 0)
       value = true;
     else if (String.Compare(strValue, "false", StringComparison.OrdinalIgnoreCase) == 0)
       value = false;
     else{
       try{
         value = Int32.Parse(strValue, CultureInfo.InvariantCulture);
       }catch{
         throw new CmdLineException(CmdLineError.InvalidDefinition, key, engine.ErrorCultureInfo);
       }
     }
   }
   if (key.Length == 0)
     throw new CmdLineException(CmdLineError.MissingDefineArgument, engine.ErrorCultureInfo);
   definitions[key] = value;
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:27,代码来源:jsinproccompiler.cs


示例8: Construct

 internal ScriptFunction Construct(object[] args, VsaEngine engine)
 {
     ScriptFunction function;
     StringBuilder builder = new StringBuilder("function anonymous(");
     int index = 0;
     int num2 = args.Length - 2;
     while (index < num2)
     {
         builder.Append(Microsoft.JScript.Convert.ToString(args[index]));
         builder.Append(", ");
         index++;
     }
     if (args.Length > 1)
     {
         builder.Append(Microsoft.JScript.Convert.ToString(args[args.Length - 2]));
     }
     builder.Append(") {\n");
     if (args.Length > 0)
     {
         builder.Append(Microsoft.JScript.Convert.ToString(args[args.Length - 1]));
     }
     builder.Append("\n}");
     Context context = new Context(new DocumentContext("anonymous", engine), builder.ToString());
     JSParser parser = new JSParser(context);
     engine.PushScriptObject(((IActivationObject) engine.ScriptObjectStackTop()).GetGlobalScope());
     try
     {
         function = (ScriptFunction) parser.ParseFunctionExpression().PartiallyEvaluate().Evaluate();
     }
     finally
     {
         engine.PopScriptObject();
     }
     return function;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:35,代码来源:FunctionConstructor.cs


示例9: GlobalScope

 internal GlobalScope(GlobalScope parent, VsaEngine engine, bool isComponentScope) : base(parent)
 {
     this.componentScopes = null;
     this.recursive = false;
     this.isComponentScope = isComponentScope;
     if (parent == null)
     {
         this.globalObject = engine.Globals.globalObject;
         this.globalObjectTR = TypeReflector.GetTypeReflectorFor(Globals.TypeRefs.ToReferenceContext(this.globalObject.GetType()));
         base.fast = !(this.globalObject is LenientGlobalObject);
     }
     else
     {
         this.globalObject = null;
         this.globalObjectTR = null;
         base.fast = parent.fast;
         if (isComponentScope)
         {
             ((GlobalScope) base.parent).AddComponentScope(this);
         }
     }
     base.engine = engine;
     base.isKnownAtCompileTime = base.fast;
     this.evilScript = true;
     this.thisObject = this;
     this.typeReflector = TypeReflector.GetTypeReflectorFor(Globals.TypeRefs.ToReferenceContext(base.GetType()));
     if (isComponentScope)
     {
         engine.Scopes.Add(this);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:31,代码来源:GlobalScope.cs


示例10: AddSourceFile

 private void AddSourceFile(VsaEngine engine, string filename)
 {
     string name = "$SourceFile_" + this.codeItemCounter++;
     IJSVsaCodeItem item = (IJSVsaCodeItem) engine.Items.CreateItem(name, JSVsaItemType.Code, JSVsaItemFlag.None);
     item.SetOption("codebase", filename);
     item.SourceText = this.ReadFile(filename, engine);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:JSInProcCompiler.cs


示例11: concat

        public static ArrayObject concat(object thisObj, VsaEngine engine,
            params object [] args)
        {
            uint i = 0;
            ArrayObject result = new ArrayObject ();
            int arg_idx = -1;
            int arg_count = args.Length;

            // TODO: Shouldn't this be generic!?
            SemanticAnalyser.assert_type (thisObj, typeof (ArrayObject));
            object cur_obj = thisObj;

            ArrayObject cur_ary;
            while (cur_obj != null) {
                if (cur_obj is ArrayObject) {
                    cur_ary = (ArrayObject) cur_obj;

                    uint n = (uint) cur_ary.length;
                    for (uint j = 0; j < n; j++, i++)
                        result.elems [i] = cur_ary.elems [j];
                } else
                    result.elems [i++] = cur_obj;

                arg_idx++;
                cur_obj = arg_idx < arg_count ? args [arg_idx] : null;
            }

            result.length = i;

            return result;
        }
开发者ID:mayatforest,项目名称:Refractor,代码行数:31,代码来源:ArrayPrototype.cs


示例12: EngineInstance

	// Constructor.
	public EngineInstance(VsaEngine engine)
			{
				// Initialize the local state.
				this.engine = engine;
				this.outStream = null;
				this.errorStream = null;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:EngineInstance.cs


示例13: VsaScriptScope

 internal VsaScriptScope(VsaEngine engine, string itemName, VsaScriptScope parent) 
   : base(engine, itemName, (VsaItemType)(int)VSAITEMTYPE2.SCRIPTSCOPE, VsaItemFlag.None){ 
   this.parent = parent;
   this.scope = null;
   this.items = new ArrayList(8);
   this.isCompiled = false;
   this.isClosed = false;
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:8,代码来源:vsascriptscope.cs


示例14: VsaScriptScope

 internal VsaScriptScope(VsaEngine engine, string itemName, VsaScriptScope parent) : base(engine, itemName, (JSVsaItemType) 0x13, JSVsaItemFlag.None)
 {
     this.parent = parent;
     this.scope = null;
     this.items = new ArrayList(8);
     this.isCompiled = false;
     this.isClosed = false;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:VsaScriptScope.cs


示例15: VsaItem

 internal VsaItem(VsaEngine engine, string itemName, VsaItemType type, VsaItemFlag flag){ 
   this.engine = engine;
   this.type = type;
   this.name = itemName;
   this.flag = flag;
   this.codebase = null;
   this.isDirty = true;
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:8,代码来源:vsaitem.cs


示例16:

 VsaEngine INeedEngine.GetEngine()
 {
     if (this.vsaEngine == null)
     {
         this.vsaEngine = VsaEngine.CreateEngineWithType(typeof(Playground.JSEvaluator.Evaluator).TypeHandle);
     }
     return this.vsaEngine;
 }
开发者ID:xeno-by,项目名称:relinq,代码行数:8,代码来源:Evaluator.cs


示例17: JScriptWith

 public static Object JScriptWith(Object withOb, VsaEngine engine){
   Object ob = Convert.ToObject(withOb, engine);
   if (ob == null)
     throw new JScriptException(JSError.ObjectExpected);
   Globals glob = engine.Globals;
   glob.ScopeStack.GuardedPush(new WithObject(glob.ScopeStack.Peek(), ob));
   return ob;
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:8,代码来源:with.cs


示例18: ScriptObject

      public VsaEngine engine; //This is only really useful for ScriptFunctions, IActivation objects and prototype objects. It lives here for the sake of simplicity.
      //Prototype objects do not need the scope stack, so in fast mode, all prototype objects can share a common engine.

      internal ScriptObject(ScriptObject parent){
        this.parent = parent;
        this.wrappedMemberCache = null;
        if (this.parent != null)
          this.engine = parent.engine;
        else
          this.engine = null;
      }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:11,代码来源:scriptobject.cs


示例19: VsaNamedItemScope

 internal VsaNamedItemScope(Object hostObject, ScriptObject parent, VsaEngine engine)
   : base(parent){
   this.namedItem = hostObject;
   if ((this.reflectObj = hostObject as IReflect) == null)
     this.reflectObj = hostObject.GetType();
   this.recursive = false;
   this.engine = engine;
 }
开发者ID:ArildF,项目名称:masters,代码行数:8,代码来源:vsanameditemscope.cs


示例20: WrappedNamespace

 internal WrappedNamespace(String name, VsaEngine engine, bool AddReferences)
   : base(null) {
   this.name = name;
   this.engine = engine;
   this.isKnownAtCompileTime = true;
   if (name.Length > 0 && AddReferences)
     engine.TryToAddImplicitAssemblyReference(name);
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:8,代码来源:wrappednamespace.cs



注:本文中的Microsoft.JScript.Vsa.VsaEngine类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Kinect.ColorImageFrame类代码示例发布时间:2022-05-26
下一篇:
C# JScript.ScriptObject类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap