コード例 #1
0
        //****************************************

        internal static WinBoundControl GetControl(WinBindingSource source, Control targetControl)
        {
            if (targetControl is ListControl)
            {
                return(new WinListControl(source, targetControl));
            }
            else if (targetControl is RichTextBox)
            {
                return(new WinRichTextBox(source, targetControl));
            }
            else if (targetControl is TextBoxBase)
            {
                return(new WinTextBoxBase(source, targetControl));
            }
            else if (targetControl is ListView)
            {
                return(new WinListView(source, targetControl));
            }
            else if (targetControl is ButtonBase)
            {
                return(new WinButtonBase(source, targetControl));
            }
            else if (targetControl is UpDownBase)
            {
                return(new WinUpDownBase(source, targetControl));
            }
            else if (targetControl is DateTimePicker)
            {
                return(new WinDateTimePicker(source, targetControl));
            }
            else if (targetControl is TabControl)
            {
                return(new WinTabControl(source, targetControl));
            }
            else if (targetControl is GroupBox)
            {
                return(new WinGroupBox(source, targetControl));
            }
            else if (targetControl is Panel)
            {
                return(new WinPanelControl(source, targetControl));
            }
            else
            {
                Log.Warning("Unable to bind {0}, not supported", targetControl.GetType().FullName);

                return(null);
            }
        }
コード例 #2
0
        private void RefreshValue()
        {               //****************************************
            object NewValue = null;

            //****************************************

            if (_Target is WinBoundListControl)
            {
                NewValue = ((WinBoundListControl)_Target).SelectedItem;
            }
            else
            {
                NewValue = _Target;
            }

            //****************************************

            NewValue = WinBindingSource.GetFromPath(NewValue, _Segments);

            //****************************************

            ChangeValue(NewValue);
        }
コード例 #3
0
        //****************************************

        protected WinBoundListControl(WinBindingSource source, Control control) : base(source, control)
        {
        }
コード例 #4
0
        //****************************************

        protected WinBoundControl(WinBindingSource source, Control control)
        {
            _Source  = source;
            _Control = control;
        }