public ServerConnectionParamControl(ServiceBusMQ.Manager.ServerConnectionParameter p, object value = null) { InitializeComponent(); Param = p; Text.Content = p.DisplayName + ":"; if (p.Type == ServiceBusMQ.Manager.ParamType.String) { cbValue.Visibility = System.Windows.Visibility.Hidden; tbValue.Init(value ?? p.DefaultValue, typeof(string), p.Optional); tbValue.ValueChanged += tbValue_ValueChanged; tbValue.LostFocus += tbValue_LostFocus; } else if (p.Type == ServiceBusMQ.Manager.ParamType.Bool) { tbValue.Visibility = System.Windows.Visibility.Hidden; cbValue.IsChecked = ((bool)value); cbValue.Checked += cbValue_Checked; cbValue.Unchecked += cbValue_Unchecked; } Req.Visibility = p.Optional ? System.Windows.Visibility.Hidden : System.Windows.Visibility.Visible; }
public ServerConnectionParamControl(ServiceBusMQ.Manager.ServerConnectionParameter p, object value = null) { InitializeComponent(); Param = p; Text.Content = p.DisplayName + ":"; if( p.Type == ServiceBusMQ.Manager.ParamType.String ) { cbValue.Visibility = System.Windows.Visibility.Hidden; tbValue.Init(value ?? p.DefaultValue, typeof(string), p.Optional); tbValue.ValueChanged += tbValue_ValueChanged; tbValue.LostFocus += tbValue_LostFocus; } else if( p.Type == ServiceBusMQ.Manager.ParamType.Bool ) { tbValue.Visibility = System.Windows.Visibility.Hidden; cbValue.IsChecked = ((bool)value); cbValue.Checked += cbValue_Checked; cbValue.Unchecked += cbValue_Unchecked; } Req.Visibility = p.Optional ? System.Windows.Visibility.Hidden : System.Windows.Visibility.Visible; }