コード例 #1
0
        private void Work(RulyCanceler canceler)
        {
            while (true)
            {
                canceler.ThrowIfCancellationRequested();

                try
                {
                    OtherMethod(canceler);
                }
                finally
                {
                    //cleanup resources
                }

            }
        }
コード例 #2
0
 private void OtherMethod(RulyCanceler canceler)
 {
     canceler.ThrowIfCancellationRequested();
 }