помогите
This commit is contained in:
parent
c4bb4272c6
commit
229d6fa965
@ -21,16 +21,9 @@ namespace Components
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (ComboBox.Items.Count == 0)
|
return ComboBox.SelectedItem?.ToString() ?? string.Empty;
|
||||||
{
|
|
||||||
return " ";
|
|
||||||
}
|
|
||||||
if (ComboBox.SelectedItem == null)
|
|
||||||
{
|
|
||||||
return " ";
|
|
||||||
}
|
|
||||||
return ComboBox.SelectedItem.ToString()!;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (ComboBox.Items.Contains(value))
|
if (ComboBox.Items.Contains(value))
|
||||||
@ -41,7 +34,6 @@ namespace Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ComboBox.ObjectCollection ComboBoxItems
|
public ComboBox.ObjectCollection ComboBoxItems
|
||||||
{
|
{
|
||||||
get { return ComboBox.Items; }
|
get { return ComboBox.Items; }
|
||||||
@ -63,7 +55,7 @@ namespace Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CustomComboBox_SelectedValueChanged(object sender, EventArgs e)
|
private void ComboBox_SelectedValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_onValueChangedEvent?.Invoke(sender, e);
|
_onValueChangedEvent?.Invoke(sender, e);
|
||||||
}
|
}
|
||||||
|
@ -13,32 +13,14 @@ namespace Components
|
|||||||
{
|
{
|
||||||
public partial class ListBoxMany : UserControl
|
public partial class ListBoxMany : UserControl
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Конструктор по умолчанию
|
|
||||||
/// </summary>
|
|
||||||
public ListBoxMany()
|
public ListBoxMany()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Макет
|
|
||||||
/// </summary>
|
|
||||||
private string _templateString;
|
private string _templateString;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Символ начала
|
|
||||||
/// </summary>
|
|
||||||
private string _startSymbol;
|
private string _startSymbol;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Символ конца
|
|
||||||
/// </summary>
|
|
||||||
private string _endSymbol;
|
private string _endSymbol;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Шаблон строки
|
|
||||||
/// </summary>
|
|
||||||
public void SetTemplateString(string templateString, string startSymbol, string endSymbol)
|
public void SetTemplateString(string templateString, string startSymbol, string endSymbol)
|
||||||
{
|
{
|
||||||
if (templateString != "" && startSymbol != "" && endSymbol != "")
|
if (templateString != "" && startSymbol != "" && endSymbol != "")
|
||||||
@ -53,9 +35,6 @@ namespace Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Выбранная строка
|
|
||||||
/// </summary>
|
|
||||||
public int SelectedIndex
|
public int SelectedIndex
|
||||||
{
|
{
|
||||||
get { return listBox.SelectedIndex; }
|
get { return listBox.SelectedIndex; }
|
||||||
@ -67,10 +46,6 @@ namespace Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Получение обхекта
|
|
||||||
/// </summary>
|
|
||||||
public T GetObjectFromStr<T>() where T : class, new()
|
public T GetObjectFromStr<T>() where T : class, new()
|
||||||
{
|
{
|
||||||
if (listBox.SelectedIndex == -1)
|
if (listBox.SelectedIndex == -1)
|
||||||
@ -105,10 +80,6 @@ namespace Components
|
|||||||
}
|
}
|
||||||
return curObject;
|
return curObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Заполнение
|
|
||||||
/// </summary>
|
|
||||||
public void FillProperty<T>(T dataObject, int rowIndex, string propertyName)
|
public void FillProperty<T>(T dataObject, int rowIndex, string propertyName)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -14,31 +14,19 @@ namespace Components
|
|||||||
{
|
{
|
||||||
public partial class TextBoxPhone : UserControl
|
public partial class TextBoxPhone : UserControl
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Конструктор
|
|
||||||
/// </summary>
|
|
||||||
public TextBoxPhone()
|
public TextBoxPhone()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Шаблон вводимого значения
|
|
||||||
/// </summary>
|
|
||||||
private string? _phonePattern;
|
private string? _phonePattern;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Шаблон вводимого значения
|
|
||||||
/// </summary>
|
|
||||||
public string? PhonePattern
|
public string? PhonePattern
|
||||||
{
|
{
|
||||||
get { return _phonePattern; }
|
get { return _phonePattern; }
|
||||||
set { _phonePattern = value; }
|
set { _phonePattern = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Введенное значение
|
|
||||||
/// </summary>
|
|
||||||
public string? PhoneTextBox
|
public string? PhoneTextBox
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -70,14 +58,8 @@ namespace Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Событие, вызываемое при смене значения
|
|
||||||
/// </summary>
|
|
||||||
private EventHandler _onValueChangedEvent;
|
private EventHandler _onValueChangedEvent;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Событие, вызываемое при смене значения
|
|
||||||
/// </summary>
|
|
||||||
public event EventHandler ValueChanged
|
public event EventHandler ValueChanged
|
||||||
{
|
{
|
||||||
add
|
add
|
||||||
@ -90,17 +72,12 @@ namespace Components
|
|||||||
_onValueChangedEvent -= value;
|
_onValueChangedEvent -= value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
|
||||||
/// Смена значения
|
private void PhoneBox_PhoneChanged(object sender, EventArgs e)
|
||||||
/// </summary>
|
|
||||||
private void CustomPhoneBox_PhoneChanged(object sender, EventArgs e)
|
|
||||||
{
|
{
|
||||||
_onValueChangedEvent?.Invoke(sender, e);
|
_onValueChangedEvent?.Invoke(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Выведение подсказки на экран
|
|
||||||
/// </summary>
|
|
||||||
private void textBox_Enter(object sender, EventArgs e)
|
private void textBox_Enter(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
int visibleTime = 2000;
|
int visibleTime = 2000;
|
||||||
|
Loading…
Reference in New Issue
Block a user