Click here to Skip to main content
15,896,489 members
Articles / Programming Languages / C#

AppXmlViewer: Between Doxygen and raw XML

Rate me:
Please Sign up or sign in to vote.
3.46/5 (4 votes)
5 Apr 2007CPOL6 min read 34.8K   420   19  
Utility for viewing an application's document XML in a DataGridView.
using System;
using System.Diagnostics;
//using System.Text;

namespace VVX
{
    class DoCvt
    {
        public static float ToFloat(string sVal, float fDefault, float fMin, float fMax)
        {
            float fRet = ToFloat(sVal, fDefault);
            if (fRet < fMin)
                fRet = fMin;
            else
                if (fRet > fMax)
                    fRet = fMax;

            return fRet;
        }

        public static float ToFloat(string sVal, float fDefault)
        {
            float fRet = fDefault;

            try
            {
                if (sVal != null && sVal.Length > 0)
                    fRet = (float)Convert.ToDouble(sVal);
            }
            catch (Exception ex)
            {
                string sMsg = String.Format("'{0}' is not valid", sVal);
                Debug.WriteLine(sMsg + "\n" + ex.ToString());
            }
            return fRet;
        }


    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
An old dog trying to learn new tricks!

Comments and Discussions