Exemplo n.º 1
0
        /// <summary>
        /// This method parses the configuration file and returns an object that represents
        /// the configuration structure
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="configContext"></param>
        /// <param name="section"></param>
        /// <returns>KrutaConfig</returns>
        public object Create(object parent, object configContext, XmlNode section)
        {
            // Exit if there are no configuration settings.
            var eConfiguration = new KrutaConfig();

            if (section != null && section.ChildNodes.Count > 0) //ChildNodes is never null
            {
                var parser = new KrutaConfigParser();
                foreach (XmlNode configNode in section.ChildNodes)
                {
                    switch (configNode.Name)
                    {
                    case WorkspaceXml.Node:
                        eConfiguration.WorkspaceConfig = parser.WorkspaceFactory(configNode);
                        break;

                    //if more nodes are added to config root, add case(es) here
                    default:
                        //do nothing;
                        break;
                    }
                }
            }
            return(eConfiguration);
        }
Exemplo n.º 2
0
 public KrutaConfigSectionHandler(KrutaConfig configInstance)
 {
     Instance = configInstance;
 }