当前位置: 首页>>代码示例>>C#>>正文


C# JsExpression类代码示例

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


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


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