//**************************************** private string GetValue(int column) { //**************************************** ColumnBinding MyBinding = _Parent._Columns[column]; object PropertyValue; //**************************************** if (_ItemValue == null) { return(string.Empty); } PropertyValue = WinBindingSource.GetFromPath(_ItemValue, MyBinding.SourceSegments); if (PropertyValue != null && MyBinding.Converter != null) { PropertyValue = MyBinding.Converter.ConvertTo(PropertyValue, typeof(string), null); } if (PropertyValue is string) { return((string)PropertyValue); } else if (PropertyValue != null) { return(PropertyValue.ToString()); } else { return(string.Empty); } }
//**************************************** internal WinListControl(WinBindingSource source, Control control) : base(source, control) { _ListControl = (ListControl)control; _ListControl.SelectedValueChanged += OnSelectedValueChanged; _ListControl.DoubleClick += OnDoubleClick; }
//**************************************** internal WinListView(WinBindingSource source, Control control) : base(source, control) { _Columns = new List <ColumnBinding>(); _ListView = (ListView)control; _ListView.SelectedIndexChanged += OnSelectedIndexChanged; _ListView.ColumnReordered += OnColumnReordered; _ListView.DoubleClick += OnDoubleClick; }
private void OnLoad(object sender, EventArgs e) { //**************************************** WinBindingSource MyBindingSource = _Form.Tag as WinBindingSource; //**************************************** _ViewDef.ApplyTo(Presenter, _Form); if (MyBindingSource != null) { MyBindingSource.Connect(Presenter); } }
private void OnLoad(object sender, EventArgs e) { //**************************************** WinBindingSource MyBindingSource; //**************************************** if (_UserControl.Tag is WinBindingSource) { MyBindingSource = (WinBindingSource)_UserControl.Tag; } else { _UserControl.Tag = MyBindingSource = new WinBindingSource(_UserControl); } _ViewDef.ApplyTo(Presenter, _UserControl); MyBindingSource.Connect(Presenter); }
//**************************************** public override string ToString() { //**************************************** object PropertyValue = WinBindingSource.GetFromPath(_Value, _Parent._DisplayPath); //**************************************** if (_Parent._Converter != null) { return((string)_Parent._Converter.ConvertTo(PropertyValue, typeof(string), null)); } else if (PropertyValue is string) { return((string)PropertyValue); } else if (PropertyValue != null) { return(PropertyValue.ToString()); } else { return(""); } }
//**************************************** private string GetTitle(GuiChildPresenter presenter) { //**************************************** object PropertyValue = WinBindingSource.GetFromPath(presenter, _DisplayPath); //**************************************** if (_Converter != null) { return((string)_Converter.ConvertTo(PropertyValue, typeof(string), null)); } else if (PropertyValue is string) { return((string)PropertyValue); } else if (PropertyValue != null) { return(PropertyValue.ToString()); } else { return(""); } }
//**************************************** internal WinLinkLabel(WinBindingSource source, Control control) : base(source, control) { _LinkLabel = (LinkLabel)control; _LinkLabel.Click += OnClick; }
//**************************************** internal WinGroupBox(WinBindingSource source, Control control) : base(source, control) { _GroupBox = (GroupBox)control; }
//**************************************** internal WinUpDownBase(WinBindingSource source, Control control) : base(source, control) { _UpDownBase = (UpDownBase)control; _UpDownBase.Validated += OnValidated; }
//**************************************** internal WinButtonBase(WinBindingSource source, Control control) : base(source, control) { _ButtonBase = (ButtonBase)control; _ButtonBase.Click += OnClick; }
//**************************************** internal WinPanelControl(WinBindingSource source, Control control) : base(source, control) { _Panel = (Panel)control; }
//**************************************** internal WinTextBoxBase(WinBindingSource source, Control control) : base(source, control) { _TextBoxBase = (TextBoxBase)control; _TextBoxBase.KeyPress += OnKeyPress; _TextBoxBase.Validated += OnValidated; }
//**************************************** internal WinDateTimePicker(WinBindingSource source, Control control) : base(source, control) { _DateTimePicker = (DateTimePicker)control; }
//**************************************** internal WinTabControl(WinBindingSource source, Control control) : base(source, control) { _TabControl = (TabControl)control; }
//**************************************** internal WinRichTextBox(WinBindingSource source, Control control) : base(source, control) { _RichTextBox = (RichTextBox)control; _RichTextBox.Validated += OnValidated; }