internal static void DisconnectPortFromStation(IPort port, IBaseStation baseStation) { port.NotifyStationOfOutgoingCall -= baseStation.NotifyIncomingCallPort; baseStation.NotifyPortOfFailure -= port.ReportError; baseStation.NotifyPortOfIncomingCall -= port.IncomingCall; port.NotifyStationOfRejectionOfCall -= baseStation.RejectCall; baseStation.NotifyPortOfRejectionOfCall -= port.InformTelephoneAboutRejectionOfCall; port.NotifyStationOfAnsweredCall -= baseStation.AnswerCall; }
public Company(string name, IBilling billing, IBaseStation baseStation) { Name = name; Clients = new List <IClient>(); Contracts = new List <IContract>(); Billing = billing; BaseStation = baseStation; SubscribeToEvents(); // company automaticaly subscribes for notifications }