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

C# JsExpression类代码示例

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

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



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

示例1: JsObjectLiteralProperty

		public JsObjectLiteralProperty(string name, JsExpression value) {
			if (name == null) throw new ArgumentNullException("name");
			if (value == null) throw new ArgumentNullException("value");

			Name  = name;
			Value = value;
		}
开发者ID:ShuntaoChen,项目名称:SaltarelleCompiler,代码行数:7,代码来源:JsObjectLiteralProperty.cs


示例2: JsVariableDeclaration

 public JsVariableDeclaration(string name, JsExpression initializer)
 {
     if (name == null) throw new ArgumentNullException("name");
     if (!name.IsValidJavaScriptIdentifier()) throw new ArgumentException("name");
     Name        = name;
     Initializer = initializer;
 }
开发者ID:JimmyJune,项目名称:SaltarelleCompiler,代码行数:7,代码来源:JsVariableDeclaration.cs


示例3: BindBaseCall

        public JsExpression BindBaseCall(IType baseType, string methodName, IList<IType> typeArguments, JsExpression @this)
        {
            JsExpression method = JsExpression.Member(JsExpression.Member(GetScriptType(baseType, TypeContext.BindBaseCall), "prototype"), methodName);

            if (typeArguments != null && typeArguments.Count > 0)
                method = InstantiateGenericMethod(method, typeArguments);

            return JsExpression.Invocation(JsExpression.Member(_createTypeReferenceExpression(KnownTypeReference.Delegate), "mkdel"), @this, method);
        }
开发者ID:koczkatamas,项目名称:SaltarelleCompiler,代码行数:9,代码来源:ScriptSharpRuntimeLibrary.cs


示例4: CloneDelegate

 public JsExpression CloneDelegate(JsExpression source, IType sourceType, IType targetType)
 {
     if (Equals(sourceType, targetType)) {
         // The user does something like "D d1 = F(); var d2 = new D(d1)". Assume he does this for a reason and create a clone of the delegate.
         return JsExpression.Invocation(JsExpression.Member(_createTypeReferenceExpression(KnownTypeReference.Delegate), "clone"), source);
     }
     else {
         return source;	// The clone is just to convert the delegate to a different type. The risk of anyone comparing the references is small, so just return the original as delegates are immutable anyway.
     }
 }
开发者ID:koczkatamas,项目名称:SaltarelleCompiler,代码行数:10,代码来源:ScriptSharpRuntimeLibrary.cs


示例5: EnsureCanBeEvaluatedMultipleTimes

		public static JsExpression EnsureCanBeEvaluatedMultipleTimes(IList<JsStatement> statementList, JsExpression expression, IList<JsExpression> expressionsThatMustBeEvaluatedBefore, Func<string> createTemporaryVariable) {
			if (IsJsExpressionComplexEnoughToGetATemporaryVariable.Analyze(expression)) {
				CreateTemporariesForAllExpressionsThatHaveToBeEvaluatedBeforeNewExpression(statementList, expressionsThatMustBeEvaluatedBefore, expression, createTemporaryVariable);
				var temp = createTemporaryVariable();
				statementList.Add(new JsVariableDeclarationStatement(temp, expression));
				return JsExpression.Identifier(temp);
			}
			else
				return expression;
		}
开发者ID:pdavis68,项目名称:SaltarelleCompiler,代码行数:10,代码来源:Utils.cs


示例6: JsClass

 public JsClass(ITypeDefinition csharpTypeDefinition, string name, ClassTypeEnum classType, IEnumerable<string> typeArgumentNames, JsExpression baseClass, IEnumerable<JsExpression> implementedInterfaces)
     : base(csharpTypeDefinition, name)
 {
     BaseClass             = baseClass;
     ClassType             = classType;
     TypeArgumentNames     = new List<string>(typeArgumentNames ?? new string[0]);
     ImplementedInterfaces = new List<JsExpression>(implementedInterfaces ?? new JsExpression[0]);
     NamedConstructors     = new List<JsNamedConstructor>();
     InstanceMethods       = new List<JsMethod>();
     StaticMethods         = new List<JsMethod>();
     StaticInitStatements  = new List<JsStatement>();
 }
开发者ID:arnauddias,项目名称:SaltarelleCompiler,代码行数:12,代码来源:JsClass.cs


示例7: CreateObject

        public JsExpression CreateObject(JsExpression containingType, IMethodSymbol constructor, params JsExpression[] arguments)
        {
            var constructorReference = containingType.Member("prototype").Member(constructor.GetMemberName());

            if (constructor.IsBuiltIn())
            {
                // If the constructor is built-in, then we don't want it invoked at all, since it's just a shim for the built-in
                // version.  Therefore, just call the types constructor passing in the arguments as usual for a normal JS new.
                return Js.New(containingType, arguments);
            }
            else
            {
                // Object creation gets transformed into:
                // new T(T.prototype.ctor, arg1, arg2, arg3...)
                return constructorReference.Member(SpecialNames.New).Invoke(arguments);
            }
        }
开发者ID:x335,项目名称:WootzJs,代码行数:17,代码来源:Idioms.cs


示例8: InitializeField

		JsExpression IRuntimeLibrary.InitializeField(JsExpression jsMember, string scriptName, IMember member, JsExpression initialValue, IRuntimeContext context) {
			return InitializeField(jsMember, scriptName, member, initialValue, context);
		}
开发者ID:kumar0190,项目名称:SaltarelleCompiler,代码行数:3,代码来源:MockRuntimeLibrary.cs


示例9: GetExpressionForLocal

		JsExpression IRuntimeLibrary.GetExpressionForLocal(string name, JsExpression accessor, IType type, IRuntimeContext context) {
			return GetExpressionForLocal(name, accessor, type, context);
		}
开发者ID:kumar0190,项目名称:SaltarelleCompiler,代码行数:3,代码来源:MockRuntimeLibrary.cs


示例10: ApplyConstructor

		JsExpression IRuntimeLibrary.ApplyConstructor(JsExpression constructor, JsExpression argumentsArray, IRuntimeContext context) {
			return ApplyConstructor(constructor, argumentsArray, context);
		}
开发者ID:kumar0190,项目名称:SaltarelleCompiler,代码行数:3,代码来源:MockRuntimeLibrary.cs


示例11: SetAsyncException

		JsExpression IRuntimeLibrary.SetAsyncException(JsExpression taskCompletionSource, JsExpression exception, IRuntimeContext context) {
			return SetAsyncException(taskCompletionSource, exception, context);
		}
开发者ID:kumar0190,项目名称:SaltarelleCompiler,代码行数:3,代码来源:MockRuntimeLibrary.cs


示例12: SetMultiDimensionalArrayValue

		JsExpression IRuntimeLibrary.SetMultiDimensionalArrayValue(JsExpression array, IEnumerable<JsExpression> indices, JsExpression value, IRuntimeContext context) {
			return SetMultiDimensionalArrayValue(array, indices, value, context);
		}
开发者ID:kumar0190,项目名称:SaltarelleCompiler,代码行数:3,代码来源:MockRuntimeLibrary.cs


示例13: MakeEnumerator

		JsExpression IRuntimeLibrary.MakeEnumerator(IType yieldType, JsExpression moveNext, JsExpression getCurrent, JsExpression dispose, IRuntimeContext context) {
			return MakeEnumerator(yieldType, moveNext, getCurrent, dispose, context);
		}
开发者ID:kumar0190,项目名称:SaltarelleCompiler,代码行数:3,代码来源:MockRuntimeLibrary.cs


示例14: IntegerDivision

		JsExpression IRuntimeLibrary.IntegerDivision(JsExpression numerator, JsExpression denominator, IRuntimeContext context) {
			return IntegerDivision(numerator, denominator, context);
		}
开发者ID:kumar0190,项目名称:SaltarelleCompiler,代码行数:3,代码来源:MockRuntimeLibrary.cs


示例15: MakeException

		JsExpression IRuntimeLibrary.MakeException(JsExpression operand, IRuntimeContext context) {
			return MakeException(operand, context);
		}
开发者ID:kumar0190,项目名称:SaltarelleCompiler,代码行数:3,代码来源:MockRuntimeLibrary.cs


示例16: CloneDelegate

		JsExpression IRuntimeLibrary.CloneDelegate(JsExpression source, IType sourceType, IType targetType, IRuntimeContext context) {
			return CloneDelegate(source, sourceType, targetType, context);
		}
开发者ID:kumar0190,项目名称:SaltarelleCompiler,代码行数:3,代码来源:MockRuntimeLibrary.cs


示例17: BindBaseCall

		JsExpression IRuntimeLibrary.BindBaseCall(IMethod method, JsExpression @this, IRuntimeContext context) {
			return BindBaseCall(method, @this, context);
		}
开发者ID:kumar0190,项目名称:SaltarelleCompiler,代码行数:3,代码来源:MockRuntimeLibrary.cs


示例18: FloatToInt

		JsExpression IRuntimeLibrary.FloatToInt(JsExpression operand, IRuntimeContext context) {
			return FloatToInt(operand, context);
		}
开发者ID:kumar0190,项目名称:SaltarelleCompiler,代码行数:3,代码来源:MockRuntimeLibrary.cs


示例19: MakeEnumerable

		JsExpression IRuntimeLibrary.MakeEnumerable(IType yieldType, JsExpression getEnumerator, IRuntimeContext context) {
			return MakeEnumerable(yieldType, getEnumerator, context);
		}
开发者ID:kumar0190,项目名称:SaltarelleCompiler,代码行数:3,代码来源:MockRuntimeLibrary.cs


示例20: Coalesce

		JsExpression IRuntimeLibrary.Coalesce(JsExpression a, JsExpression b, IRuntimeContext context) {
			return Coalesce(a, b, context);
		}
开发者ID:kumar0190,项目名称:SaltarelleCompiler,代码行数:3,代码来源:MockRuntimeLibrary.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# JsNumber类代码示例发布时间:2022-05-24
下一篇:
C# JsDictionaryObject类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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