bool IsValid() { bool isValid = true; if (string.IsNullOrEmpty(TextBoxSignalReference.Text.CleanText())) { isValid = false; SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Invalid Signal Reference", SystemMessage = "Please provide valid Signal Reference.", UserMessageType = MessageType.Error }, ButtonType.OkOnly); sm.Closed += new EventHandler(delegate(object sender, EventArgs e) { TextBoxSignalReference.Focus(); }); #if !SILVERLIGHT sm.Owner = Window.GetWindow(this); sm.WindowStartupLocation = WindowStartupLocation.CenterOwner; #endif sm.ShowPopup(); return(isValid); } return(isValid); }
bool IsValid() { bool isValid = true; if (string.IsNullOrEmpty(TextBoxPointTag.Text.CleanText())) { isValid = false; SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Invalid Point Tag", SystemMessage = "Please provide valid Point Tag value.", UserMessageType = MessageType.Error }, ButtonType.OkOnly); sm.Closed += new EventHandler(delegate(object sender, EventArgs e) { TextBoxPointTag.Focus(); }); sm.Owner = Window.GetWindow(this); sm.WindowStartupLocation = WindowStartupLocation.CenterOwner; sm.ShowPopup(); return(isValid); } if (string.IsNullOrEmpty(TextBoxSignalReference.Text.CleanText())) { isValid = false; SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Invalid Signal Reference", SystemMessage = "Please provide valid Signal Reference value.", UserMessageType = MessageType.Error }, ButtonType.OkOnly); sm.Closed += new EventHandler(delegate(object sender, EventArgs e) { TextBoxSignalReference.Focus(); }); sm.Owner = Window.GetWindow(this); sm.WindowStartupLocation = WindowStartupLocation.CenterOwner; sm.ShowPopup(); return(isValid); } if (!TextBoxAdder.Text.IsDouble()) { isValid = false; SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Invalid Adder", SystemMessage = "Please provide valid numeric value for Adder.", UserMessageType = MessageType.Error }, ButtonType.OkOnly); sm.Closed += new EventHandler(delegate(object sender, EventArgs e) { TextBoxAdder.Focus(); }); sm.Owner = Window.GetWindow(this); sm.WindowStartupLocation = WindowStartupLocation.CenterOwner; sm.ShowPopup(); return(isValid); } if (!TextBoxMultiplier.Text.IsDouble()) { isValid = false; SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Invalid Multiplier", SystemMessage = "Please provide valid numeric value for Multiplier.", UserMessageType = MessageType.Error }, ButtonType.OkOnly); sm.Closed += new EventHandler(delegate(object sender, EventArgs e) { TextBoxMultiplier.Focus(); }); sm.Owner = Window.GetWindow(this); sm.WindowStartupLocation = WindowStartupLocation.CenterOwner; sm.ShowPopup(); return(isValid); } return(isValid); }