Пример #1
0
        public ActionInterface GetInterfaceByMtuIdAndAction(int mtuid, string action)
        {
            MtuInterface mtu = MtuInterfaces.Find(x => x.Id == mtuid);

            if (mtu == null)
            {
                throw new MtuNotFoundException("Mtu not found");
            }

            Interface mtu_interface = Interfaces.Find(x => x.Id == mtu.Interface);

            if (mtu_interface == null)
            {
                throw new InterfaceNotFoundException("Meter not found");
            }

            ActionInterface action_interface = mtu_interface.GetInterfaceActionType(action);

            if (action_interface == null)
            {
                throw new ActionInterfaceNotFoundException("Meter not found");
            }

            return(action_interface);
        }
Пример #2
0
        public ActionInterface GetInterfaceActionType(string action)
        {
            ActionInterface action_interface = Actions.Find(x => x.Type.Equals(action));

            if (action_interface == null)
            {
                throw new ActionInterfaceNotFoundException("Meter not found");
            }

            return(action_interface);
        }
Пример #3
0
        public ActionInterface GetInterfaceByMtuIdAndAction(Mtu mtu, string actionType)
        {
            Interface mtu_interface = Interfaces.Find(x => x.Id == currentIndexType);

            if (mtu_interface == null)
            {
                throw new ActionInterfaceNotFoundException_Internal();
            }

            ActionInterface action_interface = mtu_interface.GetInterfaceActionType(actionType);

            if (action_interface == null)
            {
                throw new ActionInterfaceNotFoundException_Internal();
            }

            return(action_interface);
        }