コード例 #1
0
        public static ICoreObject GetLocalInterfaceCardByBoardConfiguration(this ILifelistService lifelist,
                                                                            IOamConfiguration physicalConfiguration)
        {
            ICoreObjectCollection localInterfaceCards = lifelist.GetLocalInterfaceCards(true);
            ICoreObject           coreBoard           = LifelistNavigator.FindCoreBoard(localInterfaceCards, physicalConfiguration.Board);

            return(coreBoard);
        }
コード例 #2
0
        public static ICoreObject GetInterfaceCardByName(this ILifelistService lifelist,
                                                         string InterfaceCardName,
                                                         bool forceScan = true)
        {
            ICoreObjectCollection interfaces = lifelist.GetLocalInterfaceCards(forceScan);

            foreach (ICoreObject card in interfaces)
            {
                string name = card.GetObjectName();
                if (name == InterfaceCardName)
                {
                    return(card);
                }
            }
            return(null);
        }
コード例 #3
0
        public static ICoreObject GetBoardConfigurationByName(this ILifelistService lifelist,
                                                              string ConfigurationName,
                                                              bool forceScan = true)
        {
            ICoreObjectCollection boards = lifelist.GetLocalInterfaceCards(forceScan);

            foreach (ICoreObject localBoard in boards)
            {
                ICoreObjectCollection configurations = lifelist.GetAllBoardConfigurations(localBoard);
                foreach (ICoreObject config in configurations)
                {
                    IOamIdentification attributes = CoreObjectExtension.GetAttributes <IOamIdentification>(config);
                    if (attributes != null && attributes.OamName == ConfigurationName)
                    {
                        return(config);
                    }
                }
            }
            return(null);
        }