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

            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);
                }
            }
コード例 #2
0
        //****************************************

        internal WinListControl(WinBindingSource source, Control control) : base(source, control)
        {
            _ListControl = (ListControl)control;

            _ListControl.SelectedValueChanged += OnSelectedValueChanged;
            _ListControl.DoubleClick          += OnDoubleClick;
        }
コード例 #3
0
        //****************************************

        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;
        }
コード例 #4
0
        private void OnLoad(object sender, EventArgs e)
        {               //****************************************
            WinBindingSource MyBindingSource = _Form.Tag as WinBindingSource;

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

            _ViewDef.ApplyTo(Presenter, _Form);

            if (MyBindingSource != null)
            {
                MyBindingSource.Connect(Presenter);
            }
        }
コード例 #5
0
        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);
        }
コード例 #6
0
            //****************************************

            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("");
                }
            }
コード例 #7
0
        //****************************************

        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("");
            }
        }
コード例 #8
0
        //****************************************

        internal WinLinkLabel(WinBindingSource source, Control control) : base(source, control)
        {
            _LinkLabel        = (LinkLabel)control;
            _LinkLabel.Click += OnClick;
        }
コード例 #9
0
        //****************************************

        internal WinGroupBox(WinBindingSource source, Control control) : base(source, control)
        {
            _GroupBox = (GroupBox)control;
        }
コード例 #10
0
        //****************************************

        internal WinUpDownBase(WinBindingSource source, Control control) : base(source, control)
        {
            _UpDownBase            = (UpDownBase)control;
            _UpDownBase.Validated += OnValidated;
        }
コード例 #11
0
        //****************************************

        internal WinButtonBase(WinBindingSource source, Control control) : base(source, control)
        {
            _ButtonBase        = (ButtonBase)control;
            _ButtonBase.Click += OnClick;
        }
コード例 #12
0
        //****************************************

        internal WinPanelControl(WinBindingSource source, Control control) : base(source, control)
        {
            _Panel = (Panel)control;
        }
コード例 #13
0
        //****************************************

        internal WinTextBoxBase(WinBindingSource source, Control control) : base(source, control)
        {
            _TextBoxBase            = (TextBoxBase)control;
            _TextBoxBase.KeyPress  += OnKeyPress;
            _TextBoxBase.Validated += OnValidated;
        }
コード例 #14
0
        //****************************************

        internal WinDateTimePicker(WinBindingSource source, Control control) : base(source, control)
        {
            _DateTimePicker = (DateTimePicker)control;
        }
コード例 #15
0
        //****************************************

        internal WinTabControl(WinBindingSource source, Control control) : base(source, control)
        {
            _TabControl = (TabControl)control;
        }
コード例 #16
0
        //****************************************

        internal WinRichTextBox(WinBindingSource source, Control control) : base(source, control)
        {
            _RichTextBox            = (RichTextBox)control;
            _RichTextBox.Validated += OnValidated;
        }