示例#1
0
 /// <summary>
 /// Gets a service by its numeric id.
 /// </summary>
 /// <returns>The service.</returns>
 /// <param name="serviceID">Service ID</param>
 protected Service GetServiceById(int serviceID)
 {
     if (ModelLookup.ContainsKey(serviceID))
     {
         if (ModelLookup [serviceID].GetSettings() == null)
         {
             throw new ControlException(ControlException.Cause.Uninitialized, serviceID.ToString());
         }
         else
         {
             return(ModelLookup [serviceID]);
         }
     }
     else
     {
         throw new ControlException(ControlException.Cause.NoService, serviceID.ToString());
     }
 }