예제 #1
0
        /// <summary>
        /// Returns conf node for the network or throws if network with requested name was not found
        /// </summary>
        public IConfigSectionNode GetNetworkConfNode(string netName)
        {
            var net = NetworkConfNodes.FirstOrDefault(n => n.IsSameNameAttr(netName));

            if (net == null)
            {
                throw new MetabaseException(StringConsts.METABASE_NAMED_NETWORK_NOT_FOUND_ERROR.Args(netName ?? SysConsts.NULL));
            }
            return(net);
        }
예제 #2
0
 /// <summary>
 /// Returns a list of config nodes for groups for the named network
 /// </summary>
 public IEnumerable <IConfigSectionNode> GetNetworkGroupNodes(string netName)
 {
     try
     {
         var netNode = NetworkConfNodes.Single(n => n.IsSameNameAttr(netName));
         return(netNode.Children.Where(cn => cn.IsSameName(CONFIG_GROUP_SECTION)));
     }
     catch (Exception error)
     {
         throw new MetabaseException(StringConsts.METABASE_NETWORK_CONFIG_ERROR + "GetNetworkGroupNodes({0}): {1}".Args(netName, error.ToMessageWithType(), error));
     }
 }
예제 #3
0
        /// <summary>
        /// Returns true when the network with the specified name exists in metabase netoworks definition
        /// </summary>
        public bool NetworkExists(string netName)
        {
            var net = NetworkConfNodes.FirstOrDefault(n => n.IsSameNameAttr(netName));

            return(net != null);
        }