Click here to Skip to main content
15,885,365 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.8K   1.2K   19  
A WPF application base solution using Castle Windsor and commonly used utilities.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Interfaces
{
    public interface IConfig
    {
        /// <summary>
        /// Gets or sets the installation path.
        /// </summary>
        /// <value>
        /// The installation path.
        /// </value>
        string InstallationPath { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether [use local configuration].
        /// </summary>
        /// <value>
        /// <c>true</c> if [use local configuration]; otherwise, <c>false</c>.
        /// </value>
        bool UseLocalConfig { get; set; }

        /// <summary>
        /// Gets the global configuration file.
        /// </summary>
        /// <value>
        /// The global configuration file.
        /// </value>
        string GlobalConfigFile { get; }

        /// <summary>
        /// Creates the or update setting.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        /// <param name="key">The key.</param>
        /// <param name="value">The value.</param>
        void CreateOrUpdateSetting(string fileName, string key, string value);

        /// <summary>
        /// Gets the setting.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <returns></returns>
        string GetSetting(string key);

        /// <summary>
        /// Gets the setting.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        /// <param name="key">The key.</param>
        /// <returns></returns>
        string GetSetting(string fileName, string key);

        /// <summary>
        /// Updates the configuration parameter.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        /// <param name="parameter">The parameter.</param>
        /// <param name="value">The value.</param>
        void UpdateConfigParameter(string fileName, string parameter, string value);

        /// <summary>
        /// Loads the file.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        void LoadFile(string fileName);

        /// <summary>
        /// Reads the global configuration file.
        /// </summary>
        void ReadGlobalConfigFile();

        /// <summary>
        /// Reads the specified file name.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        void Read(string fileName);
    }
}

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