Beispiel #1
0
 private IAstNode Process_SourceFilter(IReadWriteOperation op, int operationId, IAstNode result)
 {
     return(Process_ValuesFilter(
                op,
                operationId,
                result,
                AstBuildHelper.ReadMembersChain(
                    AstBuildHelper.ReadLocalRA(locFrom),
                    op.Source.MembersChain
                    ),
                "SourceFilter",
                op.SourceFilter
                ));
 }
Beispiel #2
0
 private IAstNode Process_DestinationFilter(IReadWriteOperation op, int operationId, IAstNode result)
 {
     return(Process_ValuesFilter(
                op,
                operationId,
                result,
                AstBuildHelper.ReadMembersChain(
                    AstBuildHelper.ReadLocalRA(locTo),
                    op.Destination.MembersChain
                    ),
                "DestinationFilter",
                op.DestinationFilter
                ));
 }
Beispiel #3
0
 private IAstNode Process_ValuesFilter(
     IReadWriteOperation op,
     int operationId,
     IAstNode result,
     IAstRefOrValue value,
     string fieldName,
     Delegate filterDelegate
     )
 {
     result = new AstComplexNode
     {
         nodes = new List <IAstNode>
         {
             new AstIf
             {
                 condition = (IAstValue)AstBuildHelper.CallMethod(
                     filterDelegate.GetType().GetMethod("Invoke"),
                     new AstCastclassRef(
                         (IAstRef)AstBuildHelper.ReadMemberRV(
                             GetStoredObject(operationId, typeof(IReadWriteOperation)),
                             typeof(IReadWriteOperation).GetProperty(fieldName)
                             ),
                         filterDelegate.GetType()
                         ),
                     new List <IAstStackItem>()
                 {
                     value,
                     AstBuildHelper.ReadLocalRV(locState),
                 }
                     ),
                 trueBranch = new AstComplexNode {
                     nodes = new List <IAstNode> {
                         result
                     }
                 }
             }
         }
     };
     return(result);
 }
		private IAstNode Process_ValuesFilter(
			IReadWriteOperation op, 
			int operationId, 
			IAstNode result, 
			IAstRefOrValue value, 
			string fieldName,
			Delegate filterDelegate
		)
		{
			result = new AstComplexNode
			{
				nodes = new List<IAstNode>
					{
						new AstIf
						{
							condition = (IAstValue)AstBuildHelper.CallMethod(
								filterDelegate.GetType().GetMethod("Invoke"),
								new AstCastclassRef(
									(IAstRef)AstBuildHelper.ReadMemberRV(
										 GetStoredObject(operationId, typeof(IReadWriteOperation)),
										 typeof(IReadWriteOperation).GetProperty(fieldName)
									),
									filterDelegate.GetType()
								),
								new List<IAstStackItem>()
								{
									value,
									AstBuildHelper.ReadLocalRV(locState),
								}
							),
							trueBranch = new AstComplexNode{ nodes = new List<IAstNode> { result } }
						}
					}
			};
			return result;
		}
		private IAstNode Process_SourceFilter(IReadWriteOperation op, int operationId, IAstNode result)
		{
			return Process_ValuesFilter(
				op,
				operationId,
				result,
				AstBuildHelper.ReadMembersChain(
					AstBuildHelper.ReadLocalRA(locFrom),
					op.Source.MembersChain
				),
				"SourceFilter",
				op.SourceFilter
			);
		}
		private IAstNode Process_DestinationFilter(IReadWriteOperation op, int operationId, IAstNode result)
		{
			return Process_ValuesFilter(
				op,
				operationId,
				result,
				AstBuildHelper.ReadMembersChain(
					AstBuildHelper.ReadLocalRA(locTo),
					op.Destination.MembersChain
				),
				"DestinationFilter",
				op.DestinationFilter
			);
		}