private BasicCommunicator CheckCommunicator(string unit, string communicator) { if (communicator == null) { throw new BasicWarehouseException(String.Format("{0} has CommunicatorName null.", unit)); } if (!Communicator.ContainsKey(communicator)) { throw new BasicWarehouseException(String.Format("{0} has unknown communicator {1}", unit, communicator)); } return(Communicator[communicator]); }