コード例 #1
0
        public IILGenerator CreateAdaptedILGenerator(ILGenerator realILGenerator)
        {
            ArgumentUtility.CheckNotNull("realILGenerator", realILGenerator);

            // The OffsetTrackingILGenerator is defined by the DLR to add an ILOffsetProperty to ILGenerator under the CLR version 2 or Silverlight.
            // With .NET 4, the ILGenerator already has this property. When upgrading, we _could_ implement different ILGeneratorProvider and
            // ILGeneratorAdapter classes that directly use ILGenerator.
            var offsetTrackingILGenerator = new OffsetTrackingILGenerator(realILGenerator);

            return(new OffsetTrackingILGeneratorAdapter(offsetTrackingILGenerator));
        }
コード例 #2
0
 internal OffsetTrackingILGeneratorAdapter(OffsetTrackingILGenerator ilGenerator)
 {
     ArgumentUtility.CheckNotNull("ilGenerator", ilGenerator);
     _ilGenerator = ilGenerator;
 }