當前位置: 首頁>>代碼示例>>C#>>正文


C# CSharp.ParameterReference類代碼示例

本文整理匯總了C#中Mono.CSharp.ParameterReference的典型用法代碼示例。如果您正苦於以下問題:C# ParameterReference類的具體用法?C# ParameterReference怎麽用?C# ParameterReference使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ParameterReference類屬於Mono.CSharp命名空間,在下文中一共展示了ParameterReference類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: HoistedParameter

		public HoistedParameter (AnonymousMethodStorey scope, ParameterReference par)
			: base (scope, par.Name, par.Type)
		{
			this.parameter = par;
		}
開發者ID:rabink,項目名稱:mono,代碼行數:5,代碼來源:anonymous.cs

示例2: CaptureParameter

		public void CaptureParameter (ResolveContext ec, ParametersBlock.ParameterInfo parameterInfo, ParameterReference parameterReference)
		{
			if (!(this is StateMachine)) {
				ec.CurrentBlock.Explicit.HasCapturedVariable = true;
			}

			var hoisted = parameterInfo.Parameter.HoistedVariant;

			if (parameterInfo.Block.StateMachine != null) {
				//
				// Another storey in same block exists but state machine does not
				// have parameter captured. We need to add it there as well to
				// proxy parameter value correctly.
				//
				if (hoisted == null && parameterInfo.Block.StateMachine != this) {
					var storey = parameterInfo.Block.StateMachine;

					hoisted = new HoistedParameter (storey, parameterReference);
					parameterInfo.Parameter.HoistedVariant = hoisted;

					if (storey.hoisted_params == null)
						storey.hoisted_params = new List<HoistedParameter> ();

					storey.hoisted_params.Add (hoisted);
				}

				//
				// Lift captured parameter from value type storey to reference type one. Otherwise
				// any side effects would be done on a copy
				//
				if (hoisted != null && hoisted.Storey != this && hoisted.Storey is StateMachine) {
					if (hoisted_local_params == null)
						hoisted_local_params = new List<HoistedParameter> ();

					hoisted_local_params.Add (hoisted);
					hoisted = null;
				}
			}

			if (hoisted == null) {
				hoisted = new HoistedParameter (this, parameterReference);
				parameterInfo.Parameter.HoistedVariant = hoisted;

				if (hoisted_params == null)
					hoisted_params = new List<HoistedParameter> ();

				hoisted_params.Add (hoisted);
			}

			//
			// Register link between current block and parameter storey. It will
			// be used when setting up storey definition to deploy storey reference
			// when parameters are used from multiple blocks
			//
			if (ec.CurrentBlock.Explicit != parameterInfo.Block) {
				hoisted.Storey.AddReferenceFromChildrenBlock (ec.CurrentBlock.Explicit);
			}
		}
開發者ID:rabink,項目名稱:mono,代碼行數:58,代碼來源:anonymous.cs

示例3: CaptureParameter

		public void CaptureParameter (ResolveContext ec, ParameterReference param_ref)
		{
			ec.CurrentBlock.Explicit.HasCapturedVariable = true;
			AddReferenceFromChildrenBlock (ec.CurrentBlock.Explicit);

			if (param_ref.GetHoistedVariable (ec) != null)
				return;

			if (hoisted_params == null)
				hoisted_params = new List<HoistedParameter> (2);

			var expr = new HoistedParameter (this, param_ref);
			param_ref.Parameter.HoistedVariant = expr;
			hoisted_params.Add (expr);
		}
開發者ID:nylen,項目名稱:SharpDevelop,代碼行數:15,代碼來源:anonymous.cs

示例4: GetAllParametersArguments

		//
		// Creates an arguments set from all parameters, useful for method proxy calls
		//
		public Arguments GetAllParametersArguments ()
		{
			int count = parameters.Count;
			Arguments args = new Arguments (count);
			for (int i = 0; i < count; ++i) {
				var arg_expr = new ParameterReference (parameter_info[i], parameters[i].Location);
				args.Add (new Argument (arg_expr));
			}

			return args;
		}
開發者ID:tgiphil,項目名稱:mono,代碼行數:14,代碼來源:statement.cs

示例5: CaptureParameter

		public void CaptureParameter (ResolveContext ec, ParametersBlock.ParameterInfo parameterInfo, ParameterReference parameterReference)
		{
			if (!(this is StateMachine)) {
				ec.CurrentBlock.Explicit.HasCapturedVariable = true;
			}

			var hoisted = parameterInfo.Parameter.HoistedVariant;
			if (hoisted == null) {
				var storey = parameterInfo.Block.StateMachine ?? this;
				var hp = new HoistedParameter (storey, parameterReference);
				hoisted = hp;
				parameterInfo.Parameter.HoistedVariant = hoisted;

				if (storey.hoisted_params == null)
					storey.hoisted_params = new List<HoistedParameter> (2);

				storey.hoisted_params.Add (hp);
			}

			//
			// Register link between current block and parameter storey. It will
			// be used when setting up storey definition to deploy storey reference
			// when parameters are used from multiple blocks
			//
			if (ec.CurrentBlock.Explicit != parameterInfo.Block) {
				hoisted.Storey.AddReferenceFromChildrenBlock (ec.CurrentBlock.Explicit);
			}
		}
開發者ID:zzlang,項目名稱:mono,代碼行數:28,代碼來源:anonymous.cs

示例6: CaptureParameter

		public void CaptureParameter (EmitContext ec, ParameterReference param_ref)
		{
			if (param_ref.HoistedVariable != null)
				return;

			if (hoisted_params == null)
				hoisted_params = new ArrayList (2);

			HoistedVariable expr = new HoistedParameter (this, param_ref);
			param_ref.Parameter.HoistedVariableReference = expr;
			hoisted_params.Add (expr);
		}
開發者ID:lewurm,項目名稱:benchmarker,代碼行數:12,代碼來源:anonymous.cs


注:本文中的Mono.CSharp.ParameterReference類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。