public void Calculate(decimal firstNumber, decimal secondNumber, string selectedOperator) { FirstValue.SendKeys(firstNumber.ToString()); SecondValue.SendKeys(secondNumber.ToString()); Operator.SendKeys(selectedOperator.ToString()); GoButton.Click(); }
public void checkvalue() { if (FirstValue.Text == "") { MessageBox.Show("Please enter an number"); FirstValue.Focus(); } else if (SecondValue.Text == "") { MessageBox.Show("Please enter an number"); SecondValue.Focus(); } }
public override string HintText() { if (First?.Item == null && Second?.Item == null) { return(""); } if (First?.Item == null) { return($"{FirstFieldName} = {SecondValue?.Replace('\n', ',') ?? ""}"); } else { return($"{SecondFieldName} = {FirstValue?.Replace('\n', ',') ?? ""}"); } }
public override bool Compatible(BuildComponent a, BuildComponent b) { if (a == null || b == null) { return(false); } BuildComponent first, second; if (a.Type == FirstType && b.Type == SecondType) { first = a; second = b; } else if (a.Type == SecondType && b.Type == FirstType) { first = b; second = a; } else { return(true); } if (a.Item == null || b.Item == null) { return(true); } if ((!first.Item?.Specs.ContainsKey(FirstFieldName)) ?? true) { return(false); } if ((!second.Item?.Specs.ContainsKey(SecondFieldName)) ?? true) { return(true); } if (FirstValue == null || SecondValue == null) { return(true); } var secondSpecLines = SecondValue.Split('\n'); return(FirstValue.Split('\n').Any(s => secondSpecLines.Any(l => l.Contains(s)))); }
int IComparable <YahtzeeHandsDownCardInformation> .CompareTo(YahtzeeHandsDownCardInformation other) { if (Color != other.Color) { return(Color.CompareTo(other.Color)); } if (FirstValue != other.FirstValue) { return(FirstValue.CompareTo(other.FirstValue)); } if (SecondValue != other.SecondValue) { return(SecondValue.CompareTo(other.SecondValue)); } return(IsWild.CompareTo(other.IsWild)); }
public bool Evaluate(MessageDataItem dataItem) { Variant firstValue = FirstValue.GetValue(dataItem); Variant secondValue = SecondValue.GetValue(dataItem); switch (Operator) { case SimpleExpressionOperator.Equal: return(firstValue == secondValue); case SimpleExpressionOperator.NotEqual: return(firstValue != secondValue); case SimpleExpressionOperator.Greater: return(firstValue > secondValue); case SimpleExpressionOperator.GreaterEqual: return(firstValue >= secondValue); case SimpleExpressionOperator.Less: return(firstValue < secondValue); case SimpleExpressionOperator.LessEqual: return(firstValue <= secondValue); } return(false); }
public decimal GetResult() { var firstvalue = FirstValue.GetResult(); var secondValue = SecondValue.GetResult(); switch (Operation) { case Operation.Plus: return firstvalue + secondValue; case Operation.Minus: return firstvalue - secondValue; case Operation.Div: return firstvalue / secondValue; case Operation.Multiply: return firstvalue * secondValue; case Operation.DivRem: return firstvalue % secondValue; case Operation.Unknow: throw new Exception("unknown operation"); default: throw new ArgumentOutOfRangeException(); } }
// Module defining this command // Optional custom code for this activity /// <summary> /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run. /// </summary> /// <param name="context">The NativeActivityContext for the currently running activity.</param> /// <returns>A populated instance of System.Management.Automation.PowerShell</returns> /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks> protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context) { System.Management.Automation.PowerShell invoker = global::System.Management.Automation.PowerShell.Create(); System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName); // Initialize the arguments if (InputObject.Expression != null) { targetCommand.AddParameter("InputObject", InputObject.Get(context)); } if (MemberType.Expression != null) { targetCommand.AddParameter("MemberType", MemberType.Get(context)); } if (Name.Expression != null) { targetCommand.AddParameter("Name", Name.Get(context)); } if (Value.Expression != null) { targetCommand.AddParameter("Value", Value.Get(context)); } if (SecondValue.Expression != null) { targetCommand.AddParameter("SecondValue", SecondValue.Get(context)); } if (TypeName.Expression != null) { targetCommand.AddParameter("TypeName", TypeName.Get(context)); } if (Force.Expression != null) { targetCommand.AddParameter("Force", Force.Get(context)); } if (PassThru.Expression != null) { targetCommand.AddParameter("PassThru", PassThru.Get(context)); } if (NotePropertyName.Expression != null) { targetCommand.AddParameter("NotePropertyName", NotePropertyName.Get(context)); } if (NotePropertyValue.Expression != null) { targetCommand.AddParameter("NotePropertyValue", NotePropertyValue.Get(context)); } if (NotePropertyMembers.Expression != null) { targetCommand.AddParameter("NotePropertyMembers", NotePropertyMembers.Get(context)); } return(new ActivityImplementationContext() { PowerShellInstance = invoker }); }
private void ClearClick(object sender, EventArgs e) { FirstValue.Clear(); SecondValue.Clear(); Result.Clear(); }
public void SendSecondValue(string value2) { SecondValue.SendKeys(value2); verificationValue2 = Int32.Parse(value2); }