Click here to Skip to main content
15,896,606 members
Articles / Web Development / HTML

A WPF Template solution using MVVM and Castle Windsor

Rate me:
Please Sign up or sign in to vote.
4.78/5 (11 votes)
18 Nov 2013CPOL5 min read 34.9K   1.2K   19  
A WPF application base solution using Castle Windsor and commonly used utilities.

using System.Diagnostics;
using System;
using System.Reflection;
namespace CommonData
{
    public class AppConstants
    {
        /// <summary>
        /// Initializes the <see cref="AppConstants"/> class.
        /// </summary>
        static AppConstants()
        {

        }

        #region Threads

        public const string MapUpdateThread = "MapUpdateThread";

        #endregion Threads

        #region Config File

        public const string GlobalConfigFileName = "ST.config";

        #endregion Config File

        #region Help File

        /// <summary>
        /// Help File Data Structure.
        /// </summary>
        public struct HelpFileData
        {
            public string Path;
            public string Application;

            public HelpFileData(string app, string path)
            {
                Path = path;
                Application = app;
            }
        }

        /// <summary>
        /// Helps the file from assembly.
        /// </summary>
        /// <param name="appName">Name of the application.</param>
        /// <returns></returns>
        public static string HelpFileFromAssembly(string appName)
        {
            foreach (HelpFileData fileData in HelpFiles)
            { 
                if(appName.Equals(fileData.Application))
                {
                    return fileData.Path;
                }
            }

            return string.Empty;
        }

        /// <summary>
        /// The help files array
        /// </summary>
        public static HelpFileData[] HelpFiles = new HelpFileData[] 
        { 
            new HelpFileData(AppDomain.CurrentDomain.FriendlyName, "\\Help\\STHelp.chm") 
        };


        #endregion
    }
}

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 (Senior) Scodix
Israel Israel
Project Manager and Application Developer, in a wide variety of business applications. Particularly interested in client/server and Graphical User Interface design using Visual C#.

Specialties: 13 Y'rs in C#, 10 Y'rs experience in C++ Highly experienced in wide technologies, IT projects, military projects etc'.

Comments and Discussions