コード例 #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
            //****************************************

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