Esempio n. 1
0
        /// <summary>
        /// Gets the configuration section using the specified element name.
        /// </summary>
        /// <param name="definedName">Name of the section to load.</param>
        /// <returns>the configuration section requested</returns>
        public static UhuruSection GetSection(string definedName)
        {
            if (section == null)
            {
                section = ConfigurationManager.GetSection(definedName) as UhuruSection;
                if (section == null)
                {
                    throw new ConfigurationErrorsException("The <" + definedName + "> section is not defined in your .config file!");
                }
            }

            return(section);
        }
Esempio n. 2
0
        /// <summary>
        /// Set the Ms SQL database storage options
        /// </summary>
        /// <param name="section"> The Uhuru configuration section</param>
        private void SetMsSqlStorageOptions(UhuruSection section)
        {
            if (!string.IsNullOrEmpty(Context.Parameters[Argument.LogicalStorageUnits]))
            {
                section.Service.MSSql.LogicalStorageUnits = Context.Parameters[Argument.LogicalStorageUnits];
            }

            if (!string.IsNullOrEmpty(Context.Parameters[Argument.InitialDataSize]))
            {
                section.Service.MSSql.InitialDataSize = Context.Parameters[Argument.InitialDataSize];
            }

            if (!string.IsNullOrEmpty(Context.Parameters[Argument.InitialLogSize]))
            {
                section.Service.MSSql.InitialLogSize = Context.Parameters[Argument.InitialLogSize];
            }

            if (!string.IsNullOrEmpty(Context.Parameters[Argument.MaxDataSize]))
            {
                section.Service.MSSql.MaxDataSize = Context.Parameters[Argument.MaxDataSize];
            }

            if (!string.IsNullOrEmpty(Context.Parameters[Argument.MaxLogSize]))
            {
                section.Service.MSSql.MaxLogSize = Context.Parameters[Argument.MaxLogSize];
            }

            if (!string.IsNullOrEmpty(Context.Parameters[Argument.DataFileGrowth]))
            {
                section.Service.MSSql.DataFileGrowth = Context.Parameters[Argument.DataFileGrowth];
            }

            if (!string.IsNullOrEmpty(Context.Parameters[Argument.LogFileGrowth]))
            {
                section.Service.MSSql.LogFileGrowth = Context.Parameters[Argument.LogFileGrowth];
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the configuration section using the specified element name.
        /// </summary>
        /// <param name="definedName">Name of the section to load.</param>
        /// <returns>the configuration section requested</returns>    
        public static UhuruSection GetSection(string definedName)
        {
            if (section == null)
            {
                section = ConfigurationManager.GetSection(definedName) as UhuruSection;
                if (section == null)
                {
                    throw new ConfigurationErrorsException("The <" + definedName + "> section is not defined in your .config file!");
                }
            }

            return section;
        }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BackupBase"/> class.
 /// </summary>
 protected BackupBase()
 {
     this.uhuruSection = (UhuruSection)ConfigurationManager.GetSection("uhuru");
     this.shutdown = false;
 }