Пример #1
0
        /// <summary>
        /// Override to perform custom population/registration of modules
        /// </summary>
        protected virtual void DoConfigureChildModules(IConfigSectionNode node)
        {
            cleanupChildren(false);
            if (node == null || !node.Exists)
            {
                return;
            }

            var allModules = DoGetAllChildModuleConfigNodes(node);

            foreach (var mnode in allModules)
            {
                var module = FactoryUtils.MakeAndConfigure <ModuleBase>(mnode, null, new [] { this });
                if (!m_Children.Register(module))
                {
                    throw new AzosException(StringConsts.APP_MODULE_DUPLICATE_CHILD_ERROR.Args(this, module));
                }
            }
        }
Пример #2
0
        public static HostNetInfo ForThisHost()
        {
            var computerProps = IPGlobalProperties.GetIPGlobalProperties();

            var result = new HostNetInfo
            {
                m_Name              = "{0}.{1}".Args(computerProps.HostName, computerProps.DomainName),
                m_HostNameSegment   = computerProps.HostName,
                m_DomainNameSegment = computerProps.DomainName
            };

            var adapters = new Collections.OrderedRegistry <NetAdapterInfo>();
            var nics     = NetworkInterface.GetAllNetworkInterfaces();
            var ord      = 0;

            foreach (var nic in nics)
            {
                adapters.Register(new NetAdapterInfo(nic, ord));
                ord++;
            }

            result.m_Adapters = adapters;
            return(result);
        }