예제 #1
0
        public bool ToBool(bool aDefault)
        {
            bool defaultApplied = false;
            bool ret            = XmlSettingsValueConverter <bool> .Convert(this, aDefault, out defaultApplied);

            //
            if (defaultApplied)
            {
                string valueAsString = ToString().ToLower().Trim();
                //
                switch (valueAsString)
                {
                case "true":
                case "yes":
                case "1":
                    ret = true;
                    break;

                case "false":
                case "no":
                case "0":
                    ret = false;
                    break;

                default:
                    ret = aDefault;
                    break;
                }
            }
            //
            return(ret);
        }
예제 #2
0
        public Size ToSize(Size aDefault)
        {
            Size ret = XmlSettingsValueConverter <Size> .Convert(this, aDefault);

            return(ret);
        }
예제 #3
0
        public Point ToPoint(Point aDefault)
        {
            Point ret = XmlSettingsValueConverter <Point> .Convert(this, aDefault);

            return(ret);
        }
예제 #4
0
        public string ToString(string aDefault)
        {
            string ret = XmlSettingsValueConverter <string> .Convert(this, aDefault);

            return(ret);
        }
예제 #5
0
        public long ToLong(long aDefault)
        {
            long ret = XmlSettingsValueConverter <long> .Convert(this, aDefault);

            return(ret);
        }
예제 #6
0
        public uint ToUint(uint aDefault)
        {
            uint ret = XmlSettingsValueConverter <uint> .Convert(this, aDefault);

            return(ret);
        }
예제 #7
0
        public int ToInt(int aDefault)
        {
            int ret = XmlSettingsValueConverter <int> .Convert(this, aDefault);

            return(ret);
        }