/// <summary>
 /// Initializes a new instance of the <see cref="KaishinConfiguration"/> class.
 /// </summary>
 /// <param name="appName">Name of the application.</param>
 /// <param name="logIsEnabled">if set to <c>true</c> [log is enabled].</param>
 /// <exception cref="GodModeException"></exception>
 public KaishinConfiguration(String appName, Boolean logIsEnabled = false)
 {
     try
     {
         this.Configuration = new ConfigurationMedaka(this.ConfigurationFile, appName);
         FileInfo logFile = new FileInfo(Path.Combine(this.AppDirectory.FullName, this.AppLogName));
         this.Log           = new WiredGhost(logFile, logIsEnabled);
         this.Log.GhostMode = logIsEnabled;
         this.InitConfiguration(this.Configuration);
         this.Configuration.MedakaApp.Xml.Save();
     }
     catch (Exception exc)
     {
         exc.CreateNamelessException <GodModeException>(exc.Message);
     }
 }
        /// <summary>
        /// Initializes the configuration.
        /// </summary>
        /// <param name="conf">The configuration file.</param>
        protected void InitConfiguration(ConfigurationMedaka medaka)
        {
            var appNode = medaka.MedakaApp;
            ConfigurationCategory catNode;

            foreach (var cat in this.Categories)
            {
                if (!appNode.Contains(cat.CategoryName))
                {
                    medaka.Add(cat.CategoryName);
                }
                catNode = medaka[cat.CategoryName];
                foreach (var prop in cat.Properties)
                {
                    if (!catNode.Contains(prop.Key))
                    {
                        catNode.Add(prop.Key, prop.Value);
                    }
                }
            }
            this.SetApplicationInformation();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ConfigurationCategory"/> class.
 /// </summary>
 /// <param name="categoryName">Name of the category.</param>
 /// <param name="config">The medaka configuration file.</param>
 public ConfigurationCategory(ConfigurationMedaka config, String categoryName) :
     base(OpenCategory(config.MedakaApp, categoryName))
 {
     this.Parent = config;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ConfigurationCategory"/> class.
 /// </summary>
 /// <param name="category">The category XElement.</param>
 /// <param name="config">The medaka configuration file.</param>
 public ConfigurationCategory(ConfigurationMedaka config, XData category) :
     base(category.Data)
 {
     this.Parent = config;
 }
 /// <summary>
 /// Creates a category XElement node.
 /// </summary>
 /// <param name="category">The category XData.</param>
 /// <param name="config">The configuration category node.</param>
 /// <returns>The property XElement node.</returns>
 public static ConfigurationCategory CreateCategory(this XData category, ConfigurationMedaka config)
 {
     return(new ConfigurationCategory(config, category));
 }