not all code paths return a value

المشرف العام

Administrator
طاقم الإدارة
While writing the following code i am getting "not all code paths return a value" error for GetLayerByName() function. Please send solution for this problem.

private ILayer GetLayerByName(string slayerName) {

IMxDocument doc = m_application.Document as IMxDocument; IMap pMap = doc.FocusMap; for (int i = 0; i < pMap.LayerCount; i++) { ILayer player = pMap.get_Layer(i); if (player.Name == slayerName) { return player; } } }

أكثر...
 
أعلى