Example #1
0
        /// <summary>
        /// 对绑定值进行转换
        /// </summary>
        /// <param name="strColumnValue"></param>
        /// <returns></returns>
        private static Binding GetColumnBinding(string strColumnValue)
        {
            Binding binding = new Binding();

            if (string.IsNullOrWhiteSpace(strColumnValue))
            {
                binding = new Binding(strColumnValue);
                return(binding);
            }

            string[] strlist = strColumnValue.Split(',');
            if (strlist.Length != 3)
            {
                binding = new Binding(strColumnValue);
                return(binding);
            }

            switch (strlist[2].ToString().ToUpper())
            {
            case "CustomDictionaryConverter":
                //CustomDictionaryConverter dic = new CustomDictionaryConverter();
                //binding = new Binding(strlist[0].ToString()) { Converter = dic, ConverterParameter = strlist[1].ToString() };
                break;

            case "CUSTOMDATECONVERTER":
                SMT.FBAnalysis.UI.CustomDateConverter dat = new SMT.FBAnalysis.UI.CustomDateConverter();
                binding = new Binding(strlist[0].ToString())
                {
                    Converter = dat, ConverterParameter = strlist[1].ToString()
                };
                break;
            }

            return(binding);
        }
Example #2
0
        /// <summary>
        /// 对绑定值进行转换
        /// </summary>
        /// <param name="strColumnValue"></param>
        /// <returns></returns>
        private static Binding GetColumnBinding(string strColumnValue)
        {
            Binding binding = new Binding();
            if (string.IsNullOrWhiteSpace(strColumnValue))
            {
                binding = new Binding(strColumnValue);
                return binding;
            }

            string[] strlist = strColumnValue.Split(',');
            if (strlist.Length != 3)
            {
                binding = new Binding(strColumnValue);
                return binding;
            }

            switch (strlist[2].ToString().ToUpper())
            {
                case "CustomDictionaryConverter":
                    //CustomDictionaryConverter dic = new CustomDictionaryConverter();
                    //binding = new Binding(strlist[0].ToString()) { Converter = dic, ConverterParameter = strlist[1].ToString() };
                    break;
                case "CUSTOMDATECONVERTER":
                    SMT.FBAnalysis.UI.CustomDateConverter dat = new SMT.FBAnalysis.UI.CustomDateConverter();
                    binding = new Binding(strlist[0].ToString()) { Converter = dat, ConverterParameter = strlist[1].ToString() };
                    break;
            }

            return binding;
        }