Stop a loop inside a method in C#
问题 Is there any way to stop a running loop inside another method or insert a break statement dynamically in C#? Thanks Edit : I want to be able to dynamically intercept the method and insert a break to stop the loop when an event gets triggered in another function.I have several instances of the class and I want to stop the loop in each instance whenever required and manage all the instances. Consider multiple instances to be in a generic list Example : List<myclass> objlist=new List<myclass>();