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


C# Tuple.Item2方法代码示例

本文整理汇总了C#中Tuple.Item2方法的典型用法代码示例。如果您正苦于以下问题:C# Tuple.Item2方法的具体用法?C# Tuple.Item2怎么用?C# Tuple.Item2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tuple的用法示例。


在下文中一共展示了Tuple.Item2方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Check_null_return

 public void Check_null_return(Tuple<string, TestAction> test)
 {
     var exception = Assert.Throws<ActionResultAssertionException>(() =>
         test.Item2(_controller.WithCallTo(c => c.Null()))
     );
     Assert.That(exception.Message, Is.EqualTo(string.Format("Received null action result when expecting {0}.", test.Item1)));
 }
开发者ID:mgmccarthy,项目名称:TestStack.FluentMVCTesting,代码行数:7,代码来源:ControllerResultTestTests.cs

示例2: Check_return_type

 public void Check_return_type(Tuple<string, TestAction> test)
 {
     var exception = Assert.Throws<ActionResultAssertionException>(() =>
         test.Item2(_controller.WithCallTo(c => c.RandomResult()))
     );
     Assert.That(exception.Message, Is.EqualTo(string.Format("Expected action result to be a {0}, but instead received a RandomResult.", test.Item1)));
 }
开发者ID:mgmccarthy,项目名称:TestStack.FluentMVCTesting,代码行数:7,代码来源:ControllerResultTestTests.cs

示例3: CreateExecutor

        /// <summary>
        /// Creates the executor which can resolve a passed type and hand it
        /// to the closure
        /// </summary>
        /// <param name="stateValuePair">The state value pair.</param>
        /// <returns>a lambda lifted closure</returns>
        private static Func<Tuple<IResolveTypes, object>, object, object, object> CreateExecutor(Tuple<Type, Func<object, object, object, object>> stateValuePair)
        {
            return (resolver, name, value) =>
                       {
                           object item = null;

                           if (stateValuePair.Item1 != null)
                               item = resolver.Item1.Resolve(stateValuePair.Item1);

                           return stateValuePair.Item2(resolver.Item2, item, value);
                       };
        }
开发者ID:stevehebert,项目名称:wormhole,代码行数:18,代码来源:PipelineCompiler.cs

示例4: Execute

        internal bool Execute(
            bool skipIfNoChanges, bool formValuesChanged, Action<EwfValidation, IEnumerable<string>> validationErrorHandler, bool performValidationOnly = false,
            Tuple<Action, Action> actionMethodAndPostModificationMethod = null)
        {
            var validationNeeded = validations.Any() && ( !skipIfNoChanges || formValuesChanged );
            if( validationNeeded ) {
                var topValidator = new Validator();
                foreach( var validation in validations ) {
                    if( topValidations.Contains( validation ) )
                        validation.Method( AppRequestState.Instance.EwfPageRequestState.PostBackValues, topValidator );
                    else {
                        var validator = new Validator();
                        validation.Method( AppRequestState.Instance.EwfPageRequestState.PostBackValues, validator );
                        if( validator.ErrorsOccurred )
                            topValidator.NoteError();
                        validationErrorHandler( validation, validator.ErrorMessages );
                    }
                }
                if( topValidator.ErrorsOccurred )
                    throw new DataModificationException( Translation.PleaseCorrectTheErrorsShownBelow.ToSingleElementArray().Concat( topValidator.ErrorMessages ).ToArray() );
            }

            var skipModification = !modificationMethods.Any() || ( skipIfNoChanges && !formValuesChanged );
            if( performValidationOnly || ( skipModification && actionMethodAndPostModificationMethod == null ) )
                return validationNeeded;

            DataAccessState.Current.DisableCache();
            try {
                if( !skipModification ) {
                    foreach( var method in modificationMethods )
                        method();
                }
                if( actionMethodAndPostModificationMethod != null )
                    actionMethodAndPostModificationMethod.Item1();
                DataAccessState.Current.ResetCache();
                AppRequestState.Instance.PreExecuteCommitTimeValidationMethodsForAllOpenConnections();
                if( actionMethodAndPostModificationMethod != null )
                    actionMethodAndPostModificationMethod.Item2();
            }
            catch {
                AppRequestState.Instance.RollbackDatabaseTransactions();
                DataAccessState.Current.ResetCache();
                throw;
            }

            return true;
        }
开发者ID:william-gross,项目名称:enterprise-web-library,代码行数:47,代码来源:BasicDataModification.cs

示例5: CreateButton

		private Button CreateButton(Tuple<string, Func<bool>> buttonInfo)
		{
			TextImageButtonFactory buttonFactory = new TextImageButtonFactory();

			buttonFactory.FixedHeight = this.FixedHeight;
			buttonFactory.normalFillColor = this.normalFillColor;
			buttonFactory.normalTextColor = this.normalTextColor;
			buttonFactory.hoverTextColor = this.hoverTextColor;
			buttonFactory.hoverFillColor = this.hoverFillColor;
			buttonFactory.borderWidth = 1;
			buttonFactory.normalBorderColor = this.normalBorderColor;
			buttonFactory.hoverBorderColor = this.hoverBorderColor;

			Button button = buttonFactory.Generate(buttonInfo.Item1, normalImageName: imageName, centerText: true);

			button.Click += (object sender, EventArgs e) =>
			{
				buttonInfo.Item2();
			};

			return button;
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:22,代码来源:SplitButtonFactory.cs

示例6: EmitExceptionBlockCore

		private void EmitExceptionBlockCore( Action<TracingILGenerator, Label> tryBlockEmitter, Tuple<Type, Action<TracingILGenerator, Label, Type>> firstCatchBlockEmitter, Tuple<Type, Action<TracingILGenerator, Label, Type>>[] remainingCatchBlockEmitters, Action<TracingILGenerator, Label> finallyBlockEmitter )
		{
			var endOfExceptionBlock = this.BeginExceptionBlock();
			tryBlockEmitter( this, endOfExceptionBlock );
			if ( firstCatchBlockEmitter != null )
			{
				this.BeginCatchBlock( firstCatchBlockEmitter.Item1 );
				firstCatchBlockEmitter.Item2( this, endOfExceptionBlock, firstCatchBlockEmitter.Item1 );
			}

			foreach ( var catchBlockEmitter in remainingCatchBlockEmitters )
			{
				this.BeginCatchBlock( catchBlockEmitter.Item1 );
				firstCatchBlockEmitter.Item2( this, endOfExceptionBlock, catchBlockEmitter.Item1 );
			}

			if ( finallyBlockEmitter != null )
			{
				this.BeginFinallyBlock();
				finallyBlockEmitter( this, endOfExceptionBlock );
			}

			this.EndExceptionBlock();
		}
开发者ID:nagyist,项目名称:msgpack-cli,代码行数:24,代码来源:TracingILGenerator.cs

示例7: ap_cmb

 private Action ap_cmb(Tuple<Action, Action> code)
 {
     return delegate() { code.Item1(); code.Item2(); };
 }
开发者ID:Jegqamas,项目名称:Beanulator,代码行数:4,代码来源:R6502.cs


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