Пример #1
0
        public ILForLoopSnippet(ILPointer initialValue, ILGenerationHandler <ILPointer> conditionHandler,
                                ILGenerationHandler <ILPointer> bodyHandler, ILPointer increment)
        {
            if (initialValue.Type != increment.Type)
            {
                throw new ArgumentException("The type of the initial value and the increment value must match");
            }

            _initialValue     = initialValue;
            _increment        = increment;
            _conditionHandler = new DelegatedILHandler <ILPointer>(conditionHandler);
            _bodyHandler      = new DelegatedILHandler <ILPointer>(bodyHandler);
        }
Пример #2
0
 public ILEnumerateSnippet(ILPointer enumerable, ILGenerationHandler <ILPointer> iterateBody)
 {
     _enumerable  = enumerable;
     _iterateBody = new DelegatedILHandler <ILPointer>(iterateBody);
 }
Пример #3
0
 public ILWhileLoopSnippet(ILGenerationHandler conditionHandler, ILGenerationHandler bodyHandler)
 {
     _conditionHandler = new DelegatedILHandler(conditionHandler);
     _bodyHandler      = new DelegatedILHandler(bodyHandler);
 }