Click here to Skip to main content
15,894,410 members
Home / Discussions / C#
   

C#

 
AnswerRe: when does the assembly.exe.config file is created Pin
ramzg15-Mar-10 19:19
ramzg15-Mar-10 19:19 
QuestionVideo Overlay Pin
abalbo15-Mar-10 14:11
abalbo15-Mar-10 14:11 
AnswerRe: Video Overlay Pin
Super Lloyd15-Mar-10 17:37
Super Lloyd15-Mar-10 17:37 
QuestionWPF: how do I write output from methods invoked through an event to a textbox in window1? Pin
Bragee15-Mar-10 12:57
Bragee15-Mar-10 12:57 
AnswerRe: WPF: how do I write output from methods invoked through an event to a textbox in window1? Pin
Not Active15-Mar-10 14:12
mentorNot Active15-Mar-10 14:12 
GeneralRe: WPF: how do I write output from methods invoked through an event to a textbox in window1? Pin
Bragee16-Mar-10 1:16
Bragee16-Mar-10 1:16 
GeneralRe: WPF: how do I write output from methods invoked through an event to a textbox in window1? Pin
Pete O'Hanlon16-Mar-10 2:16
mvePete O'Hanlon16-Mar-10 2:16 
GeneralRe: WPF: how do I write output from methods invoked through an event to a textbox in window1? Pin
Not Active16-Mar-10 2:26
mentorNot Active16-Mar-10 2:26 
I see no reason for the BallInPlay event. An event is used when you want to be notified by the object that something has happened (Observer pattern). In this case it appears all you want to do is check a result, so just call a method.

private void button1_Click(object sender, RoutedEventArgs e)        
{
    Pitcher p = new Pitcher();
    textbox.text = p.BallInPlay(Convert.ToInt16(textBox1.Text), 
                                Convert.ToInt16 (textBox2.Text));        
}

public class Pitcher
{
  public string BallInPlay(int distance, int tragetroy)
  {
    if (distance > 400 && trajectory > 30)
    {                    
       return Homerun();
    }                
    else
    {
       return Cheer();
    }
}

}

I know the language. I've read a book. - _Madmatt

Questioncheck if 5 min have passed Pin
Yustme15-Mar-10 12:53
Yustme15-Mar-10 12:53 
AnswerRe: check if 5 min have passed Pin
Luc Pattyn15-Mar-10 13:00
sitebuilderLuc Pattyn15-Mar-10 13:00 
GeneralRe: check if 5 min have passed Pin
Yustme15-Mar-10 13:40
Yustme15-Mar-10 13:40 
GeneralRe: check if 5 min have passed Pin
Luc Pattyn15-Mar-10 13:46
sitebuilderLuc Pattyn15-Mar-10 13:46 
GeneralRe: check if 5 min have passed Pin
Yustme15-Mar-10 13:49
Yustme15-Mar-10 13:49 
GeneralRe: check if 5 min have passed Pin
Luc Pattyn15-Mar-10 14:01
sitebuilderLuc Pattyn15-Mar-10 14:01 
GeneralRe: check if 5 min have passed Pin
Yustme15-Mar-10 14:08
Yustme15-Mar-10 14:08 
GeneralRe: check if 5 min have passed Pin
Luc Pattyn15-Mar-10 14:12
sitebuilderLuc Pattyn15-Mar-10 14:12 
GeneralRe: check if 5 min have passed Pin
Yustme16-Mar-10 3:17
Yustme16-Mar-10 3:17 
GeneralRe: check if 5 min have passed Pin
Luc Pattyn16-Mar-10 3:56
sitebuilderLuc Pattyn16-Mar-10 3:56 
GeneralRe: check if 5 min have passed Pin
llandyw16-Mar-10 15:26
llandyw16-Mar-10 15:26 
GeneralRe: check if 5 min have passed Pin
Som Shekhar16-Mar-10 20:30
Som Shekhar16-Mar-10 20:30 
QuestionMicrosoft SAPI, Parsing grammar xml with c# Pin
b0bz15-Mar-10 9:40
b0bz15-Mar-10 9:40 
Questionhand gesture recognition Pin
Innayat Ullah15-Mar-10 7:39
Innayat Ullah15-Mar-10 7:39 
Questionupdate tables Pin
netJP12L15-Mar-10 6:16
netJP12L15-Mar-10 6:16 
AnswerMy up and coming vote of 1. PinPopular
Keith Barrow15-Mar-10 6:26
professionalKeith Barrow15-Mar-10 6:26 
GeneralRe: My up and coming vote of 1. Pin
netJP12L15-Mar-10 6:42
netJP12L15-Mar-10 6:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.