示例#1
0
 /// <summary>
 /// Validate this configuration instance.
 /// </summary>
 public void Validate()
 {
     if (Header == null)
     {
         throw ConfigurationException.PropertyMissingException(nameof(Header));
     }
     if (String.IsNullOrWhiteSpace(Header.Id))
     {
         throw ConfigurationException.PropertyMissingException(nameof(Header.Id));
     }
     if (String.IsNullOrWhiteSpace(Header.ApplicationGroup))
     {
         throw ConfigurationException.PropertyMissingException(nameof(Header.ApplicationGroup));
     }
     if (String.IsNullOrWhiteSpace(Header.Application))
     {
         throw ConfigurationException.PropertyMissingException(nameof(Header.Application));
     }
     if (Header.Version == null)
     {
         throw ConfigurationException.PropertyMissingException(nameof(Header.Version));
     }
     if (RootConfigNode == null)
     {
         throw ConfigurationException.PropertyMissingException(nameof(RootConfigNode));
     }
     RootConfigNode.Validate();
 }
示例#2
0
        /// <summary>
        /// Find a specified node in this configuration based on the search Path.
        /// </summary>
        /// <param name="path">Search Path</param>
        /// <returns>Configuration Node</returns>
        public AbstractConfigNode Find(string path)
        {
            Preconditions.CheckArgument(path);

            if (path.StartsWith(ConfigurationSettings.NODE_SEARCH_SEPERATOR))
            {
                path = path.Substring(1);
            }
            return(RootConfigNode.Find(path));
        }
示例#3
0
 /// <summary>
 /// Perform Post-Load operations.
 /// </summary>
 public void PostLoad()
 {
     if (configState.HasError())
     {
         throw new ConfigurationException("Configuration in error state.",
                                          configState.GetError());
     }
     if (RootConfigNode != null)
     {
         RootConfigNode.PostLoad();
     }
 }