public EditQuestionDialog(List <Answer> answers, List <CorrectAnswer> correctAnswers, string answerTxt) { InitializeComponent(); this.answers = answers; this.correctAnswers = correctAnswers; QuestionText.Text = answerTxt; foreach (var answer in this.answers) { if (answer.AnswerId == correctAnswers.Select(p => p.AnswerId).FirstOrDefault()) { GetAnswer.Add(new AddQuestionDialog.AnswerListClass { AnswerText = answer.AnswerText, AnswerId = answerListId++, AnswerCorrect = true }); } else { GetAnswer.Add(new AddQuestionDialog.AnswerListClass { AnswerText = answer.AnswerText, AnswerId = answerListId++ }); } } AnswerList.ItemsSource = GetAnswer; }
private void button1_Click(object sender, EventArgs e) { delegatedAdd = new GetAnswer(Class1.getAdd); num1 = Int32.Parse(textBox1.Text); num2 = Int32.Parse(textBox2.Text); MessageBox.Show(delegatedAdd(num1, num2).ToString(), "Answer"); }
protected virtual void CallMeEvent(string name) { GetAnswer delegado = CallMeBaby; GetAnswerEvent += delegado; GetAnswerEvent?.Invoke(this, name); }
private void button4_Click(object sender, EventArgs e) { GetAnswer mdQuotient = new GetAnswer(Formula.getQuotient); int num1 = Int32.Parse(textBox1.Text); int num2 = Int32.Parse(textBox2.Text); MessageBox.Show(mdQuotient(num1, num2).ToString()); }
private void button2_Click(object sender, EventArgs e) { GetAnswer mdDifference = new GetAnswer(Formula.getDifference); int num1 = Int32.Parse(textBox1.Text); int num2 = Int32.Parse(textBox2.Text); MessageBox.Show(mdDifference(num1, num2).ToString()); }
private async Task DerviePermissionsForInstance(GetAnswer query, Answer answer) { if (answer == null) { return; } answer.CanEdit = await _internalUserPermissionService.HasWriteAccessFor(answer, query.UserContext); }
private void button4_Click(object sender, EventArgs e) { GetAnswer delegateAnswer = new GetAnswer(Formula1.getDiv); int num1 = Int32.Parse(textBox1.Text); int num2 = Int32.Parse(textBox2.Text); MessageBox.Show(delegateAnswer(num1, num2).ToString()); }
private void btnMultiply_Click(object sender, EventArgs e) { delegatedProduct = new GetAnswer(Formula.getProduct); int num1 = Int32.Parse(textBox1.Text); int num2 = Int32.Parse(textBox2.Text); MessageBox.Show(delegatedProduct(num1, num2).ToString(), "Answer"); }
private void btnDivide_Click(object sender, EventArgs e) { delegatedQuotient = new GetAnswer(Formula.getQuotient); int num1 = Int32.Parse(textBox1.Text); int num2 = Int32.Parse(textBox2.Text); MessageBox.Show(delegatedQuotient(num1, num2).ToString(), "Answer"); }
private void button1_Click_1(object sender, EventArgs e) { GetAnswer delegateAnswer = new GetAnswer(Formula.getSum1); int num1 = Int32.Parse(txtnum1.Text); int num2 = Int32.Parse(txtnum2.Text); MessageBox.Show(delegateAnswer(num1, num2).ToString()); }
private void btn_div_Click(object sender, EventArgs e) { GetAnswer delegateAnswer = new GetAnswer(FormulaMDAS.getDiv); int num1 = Int32.Parse(txtbox_num1.Text); int num2 = Int32.Parse(txtbox_num2.Text); MessageBox.Show(txtbox_num1.Text + " รท " + txtbox_num2.Text + " is equals to " + delegateAnswer(num1, num2).ToString(), "Result"); }
public Form1() { InitializeComponent(); Addition = new GetAnswer(Calcu_Formula.GetSum); Subtraction = new GetAnswer(Calcu_Formula.GetDifference); Multiplication = new GetAnswer(Calcu_Formula.GetProduct); Division = new GetAnswer(Calcu_Formula.GetQuotient); }
private void btnAdd_Click(object sender, EventArgs e) { delegatedAddition = new GetAnswer(Formula.getSum); int num1 = Int32.Parse(textBox1.Text); int num2 = Int32.Parse(textBox2.Text); MessageBox.Show(delegatedAddition(num1, num2).ToString(), "Answer"); }
private void btnSubtract_Click(object sender, EventArgs e) { delegatedDifference = new GetAnswer(Formula.getDifference); int num1 = Int32.Parse(textBox1.Text); int num2 = Int32.Parse(textBox2.Text); MessageBox.Show(delegatedDifference(num1, num2).ToString(), "Answer"); }
protected void cmdWhereAreWe_Click(object sender, EventArgs e) { //since this is a different question we now wich to call a different method //so I point functionReference at the method I want to run functionReference = AreWeThereYet; input = txtAreWeTherYet.Text; result = functionReference(input); lblResult.Text = result; }
public Form1() { InitializeComponent(); delegateAddition = new GetAnswer(Formulas.getSum); delegateSubtraction = new GetAnswer(Formulas.getMinus); delegateMultiplication = new GetAnswer(Formulas.getProduct); delegateDivision = new GetAnswer(Formulas.getQuotient); }
private void button5_Click(object sender, EventArgs e) { GetAnswer delegateAnswer = new GetAnswer(Calcu.getQuotient); int num1 = Int32.Parse(textBox1.Text); int num2 = Int32.Parse(textBox2.Text); textBox3.Text = delegateAnswer(num1, num2).ToString(); }
private void button3_Click(object sender, EventArgs e) { GetAnswer mdMultiply = new GetAnswer(Formula.getProduct); int num1 = Int32.Parse(textBox1.Text); int num2 = Int32.Parse(textBox2.Text); MessageBox.Show(mdMultiply(num1, num2).ToString()); }
private void button3_Click(object sender, EventArgs e) { delegatedOperation = new GetAnswer(Formula.getProduct); int num1 = Int32.Parse(textBox1.Text); int num2 = Int32.Parse(textBox2.Text); MessageBox.Show(delegatedOperation(num1, num2).ToString()); }
private void button2_Click(object sender, EventArgs e) { GetAnswer delegateDifference = new GetAnswer(Formula.GetDifference); double num1 = Double.Parse(textBox1.Text); double num2 = Double.Parse(textBox2.Text); result.Text = String.Empty; label2.Text = "Difference"; result.Text = result.Text + (delegateDifference(num1, num2).ToString()); }
private void button4_Click(object sender, EventArgs e) { GetAnswer delegateQuotient = new GetAnswer(Formula.GetQuotient); double num1 = Double.Parse(textBox1.Text); double num2 = Double.Parse(textBox2.Text); result.Text = String.Empty; label2.Text = "Quotient"; result.Text = result.Text + (delegateQuotient(num1, num2).ToString()); }
private void button7_Click(object sender, EventArgs e) { GetAnswer delegateAnswer = new GetAnswer(Formula.getQuotient); int num1 = Int32.Parse(Number1.Text); int num2 = Int32.Parse(Number2.Text); string title = "Answer: "; MessageBox.Show(delegateAnswer(num1, num2).ToString(), title); }
public async Task <Answer> Execute(PangulDbContext db, GetAnswer query) { query.Validate(); var answerQuery = db.Answer.Where(i => i.AnswerId == query.Dervied.AnswerId); if (!query.IgnoreRowVersion) { answerQuery = answerQuery.Where(i => i.RowVersion == query.Dervied.RowVersion); } var answer = await answerQuery.FirstOrDefaultAsync(); await DerviePermissionsForInstance(query, answer); return(answer); }
private void Button_Click(object sender, RoutedEventArgs e) { Func <List <ThisModel> > action = new Func <List <ThisModel> >(() => { if (this.SearchTextBox.Text == null) { return(null); } BaseRequest baseRequest = new BaseRequest(); baseRequest.RequestUrl = "http://im.1353217661.xyz/index/index/get_result"; baseRequest.IsGetRequest = false; baseRequest.Content = $"title={this.SearchTextBox.Text}"; GetAnswer answer = new GetAnswer(baseRequest); return(answer.Mydatas); }); MainViewModel.CallFunction(action); this.DataContext = new MainViewModel(); }
protected void Page_Load(object sender, EventArgs e) { //at Page_Load I point the functionReference delegate variable to a method with matching signature functionReference = My_DelegateMethod; }