public static void ShowMessage(string message, params object[] values) { if (_frm != null) { if (_frm.IsDisposed) { _frm = null; } } if (_frm == null) { _frm = new FormWarning(); _frm.Show(); } if (values == null || values.Length == 0) { } else { message = string.Format(CultureInfo.InvariantCulture, message, values); } PassString ps = new PassString(_frm.SetMessage); _frm.Invoke(ps, message); }
private static void createMessageForm() { _frm = new FormWarning(); _frm.Invoke((MethodInvoker)(delegate() { _frm.ShowDialog(); } )); }
public static void CloseMessageForm() { if (_frm != null) { if (!_frm.IsDisposed) { MethodInvoker mi = new MethodInvoker(_frm.Close); _frm.Invoke(mi); _frm = null; } } }
public static void ShowMessageDialog(Form owner, string message, params object[] values) { if (values == null || values.Length == 0) { } else { message = string.Format(CultureInfo.InvariantCulture, message, values); } FormWarning f = new FormWarning(); f.StartPosition = FormStartPosition.CenterScreen; f.SetMessage(message); f.ShowDialog(owner); }
public void ValidateParameterValues(ParameterValueCollection parameters) { if (_prop == null) { FormWarning.ShowMessage("Error calling {0}.ValidateParameterValues. Property not set. Action:{1}", this.GetType().FullName, this.Action); } else { ParameterValue p = null; foreach (ParameterValue pv in parameters) { if (string.Compare(pv.Name, PropertyValueName, StringComparison.Ordinal) == 0) { p = pv; break; } } if (p == null) { p = createValue(); } if (_prop.PropertyType != null) { p.SetDataType(_prop.PropertyType); } IList <Attribute> ed = _prop.GetUITypeEditor(); if (ed != null && ed.Count > 0) { Attribute[] atts = new Attribute[ed.Count]; ed.CopyTo(atts, 0); p.MergeValueAttributes(atts); } parameters.Clear(); parameters.Add(p); } }
public static void NotifyClosing() { _frm = null; }
protected override void OnClosing(CancelEventArgs e) { FormWarning.NotifyClosing(); base.OnClosing(e); }