Sanju Singh

Sanju Singh

  • NA
  • 280
  • 44.4k

unexpected code execution

Jan 16 2015 12:34 AM
hello,  in the following code 
                  
                                             
   
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// check if any kinect is available
if (Sensors.Count == 0)
{   
   MessageBox.Show("no sensor is available for listening !!");
   Application.Current.Shutdown();
}
 ///
/// 
 
PromptBuilder pb1 = new PromptBuilder();
pb1.AppendText("HELLO", System.Speech.Synthesis.PromptVolume.Loud);
this.speaker(pb1);
 
}
the last three lines are executed even though the ' if ' condition is satisfied! can anyone explain me why ? i think the application should shutdown .
 

Answers (13)