exeptions in WFA
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							@ -183,7 +183,22 @@ namespace WindowsFormsApp01
 | 
			
		||||
 | 
			
		||||
        private void Button4_Click(object sender, EventArgs e)
 | 
			
		||||
        {
 | 
			
		||||
            calc.CalcIt();
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
                calc.CalcIt();
 | 
			
		||||
            }
 | 
			
		||||
            catch (DivideByZeroException)
 | 
			
		||||
            {
 | 
			
		||||
                label4.Text = "Fehler: div by zero";
 | 
			
		||||
            }
 | 
			
		||||
            catch (Exception)
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                label4.Text = "Fehler";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void CalcFinished(CalcEventArgs e)
 | 
			
		||||
@ -214,6 +229,7 @@ namespace WindowsFormsApp01
 | 
			
		||||
        {
 | 
			
		||||
            int res = DateTime.Now.Second;
 | 
			
		||||
 | 
			
		||||
            res = res / 0;
 | 
			
		||||
 | 
			
		||||
            var e = new CalcEventArgs(res);
 | 
			
		||||
            //trigger handler
 | 
			
		||||
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user