EnumHelper.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. using System;
  2. using System.ComponentModel;
  3. using System.Reflection;
  4. namespace WWPipeLine.Commons
  5. {
  6. /// <summary>
  7. /// 基础枚举类
  8. /// </summary>
  9. public class EnumHelper
  10. {
  11. public static string GetEnumDescription(Enum enumValue)
  12. {
  13. string value = enumValue.ToString();
  14. FieldInfo field = enumValue.GetType().GetField(value);
  15. object[] objs = field.GetCustomAttributes(typeof(DescriptionAttribute), false); //获取描述属性
  16. if (objs == null || objs.Length == 0) //当描述属性没有时,直接返回名称
  17. return value;
  18. DescriptionAttribute descriptionAttribute = (DescriptionAttribute)objs[0];
  19. return descriptionAttribute.Description;
  20. }
  21. /// <summary>
  22. /// Py执行结果
  23. /// </summary>
  24. public enum EPyStatus
  25. {
  26. /// <summary>
  27. /// 参数对象为空
  28. /// </summary>
  29. [Description("强制终止")]
  30. ForceQuit = -1,
  31. /// <summary>
  32. /// 正常结束
  33. /// </summary>
  34. [Description("正常结束")]
  35. Normal = 0,
  36. /// <summary>
  37. /// Python执行异常
  38. /// </summary>
  39. [Description("Python执行异常")]
  40. RunError = 1,
  41. /// <summary>
  42. /// 文件路径不存在
  43. /// </summary>
  44. [Description("文件路径不存在")]
  45. PathError = 2,
  46. /// <summary>
  47. /// 获取栅格相交区域异常
  48. /// </summary>
  49. [Description("获取栅格相交区域异常")]
  50. AreaJoinErro = 3,
  51. /// <summary>
  52. /// 读取json异常
  53. /// </summary>
  54. [Description("读取json异常")]
  55. JsonError = 5,
  56. /// <summary>
  57. /// 参数个数异常
  58. /// </summary>
  59. [Description("参数值异常")]
  60. ArgsCountError = 6,
  61. /// <summary>
  62. /// 传入文件类型异常
  63. /// </summary>
  64. [Description("传入文件类型异常")]
  65. FileTypeError = 7,
  66. /// <summary>
  67. /// 创建shp异常
  68. /// </summary>
  69. [Description("创建shp异常")]
  70. CreateShpFileError = 8,
  71. /// <summary>
  72. /// 空间插值异常
  73. /// </summary>
  74. [Description("空间插值异常")]
  75. SpatialInterpolationError = 9,
  76. /// <summary>
  77. /// 栅格运算异常
  78. /// </summary>
  79. [Description("栅格运算异常")]
  80. GridMeasureError = 10,
  81. /// <summary>
  82. /// 裁剪栅格异常
  83. /// </summary>
  84. [Description("裁剪栅格异常或行政区异常")]
  85. GridCatError = 11,
  86. /// <summary>
  87. /// 重投影异常
  88. /// </summary>
  89. [Description("重投影异常")]
  90. ShadowError = 12,
  91. /// <summary>
  92. /// 删除文件异常
  93. /// </summary>
  94. [Description("删除文件异常")]
  95. DeleteFileError = 13,
  96. /// <summary>
  97. /// 环境异常
  98. /// </summary>
  99. [Description("环境异常")]
  100. EnvError = 14,
  101. /// <summary>
  102. /// 参数对象为空
  103. /// </summary>
  104. [Description("参数对象为空")]
  105. ArgsError = 15,
  106. /// <summary>
  107. /// 参数对象为空
  108. /// </summary>
  109. [Description("行政区空间参考获取异常")]
  110. RegionCKError = 66,
  111. /// <summary>
  112. /// 参数对象为空
  113. /// </summary>
  114. [Description("行政区、评价文件空间参考不一致")]
  115. SpatialReferenceInconsistent = 67,
  116. }
  117. /// <summary>
  118. /// 控件类型
  119. /// </summary>
  120. public enum ECtrlType
  121. {
  122. /// <summary>
  123. /// 下拉控件
  124. /// </summary>
  125. ExComboBox = 0,
  126. /// <summary>
  127. /// 文本框控件
  128. /// </summary>
  129. ExTextBox = 1,
  130. /// <summary>
  131. /// 数值控件
  132. /// </summary>
  133. NumericEdit = 2,
  134. /// <summary>
  135. /// 打开文件控件
  136. /// </summary>
  137. OpenDialog = 3,
  138. /// <summary>
  139. /// 保存文件控件
  140. /// </summary>
  141. SaveDialog = 4,
  142. /// <summary>
  143. /// 选择文件控件
  144. /// </summary>
  145. ExCheckBox = 5,
  146. /// <summary>
  147. ///评价流程描述控件
  148. /// </summary>
  149. ExDescriptionContent = 6,
  150. /// <summary>
  151. /// 选择文件和下拉控件并行使用
  152. /// </summary>
  153. OpenDialogWithComboBox = 7,
  154. /// <summary>
  155. ///自定义流程控件
  156. /// </summary>
  157. ExCommonCustomer = 8,
  158. }
  159. /// <summary>
  160. /// 结果展示类型
  161. /// </summary>
  162. public enum EShowType
  163. {
  164. /// <summary>
  165. /// 仅展示地图
  166. /// </summary>
  167. Map = 0,
  168. /// <summary>
  169. /// 仅展示统计
  170. /// </summary>
  171. Summary = 1,
  172. /// <summary>
  173. /// 展示所有信息
  174. /// </summary>
  175. All = 2,
  176. }
  177. public enum EoptionButton
  178. {
  179. /// <summary>
  180. /// 退出
  181. /// </summary>
  182. Eoptbut_Exit = 0,
  183. /// <summary>
  184. /// 重载配置
  185. /// </summary>
  186. Eoptbut_Reload = 1,
  187. /// <summary>
  188. /// 重新配置
  189. /// </summary>
  190. Eoptbut_Config = 2,
  191. /// <summary>
  192. /// 帮助
  193. /// </summary>
  194. Eoptbut_Help = 3,
  195. /// <summary>
  196. /// 设置
  197. /// </summary>
  198. Eoptbut_Setting = 4,
  199. /// <summary>
  200. /// 关于
  201. /// </summary>
  202. Eoptbut_About
  203. }
  204. public enum EChart
  205. {
  206. /// <summary>
  207. /// 饼图
  208. /// </summary>
  209. Pie = 0,
  210. /// <summary>
  211. /// 柱状图
  212. /// </summary>
  213. Column = 1,
  214. }
  215. public enum EBusinessType
  216. {
  217. /// <summary>
  218. /// 路网信息
  219. /// </summary>
  220. Reptile_RoadMap = -2,
  221. /// <summary>
  222. /// POI
  223. /// </summary>
  224. Reptile_POI = -1,
  225. /// <summary>
  226. /// 农业土地资源评价
  227. /// </summary>
  228. AgriculturalLandResource = 0,
  229. /// <summary>
  230. /// 农业水资源评价
  231. /// </summary>
  232. AgriculturalWaterResource = 1,
  233. /// <summary>
  234. /// 农业气候评价
  235. /// </summary>
  236. AgriculturalClimateResource = 2,
  237. /// <summary>
  238. /// 农业环境评价
  239. /// </summary>
  240. AgriculturalEnvironmentalResource = 3,
  241. /// <summary>
  242. /// 农业生态评价
  243. /// </summary>
  244. AgriculturalEcology = 4,
  245. /// <summary>
  246. /// 农业灾害评价
  247. /// </summary>
  248. AgriculturalHazard = 5,
  249. /// <summary>
  250. /// 农业集成评价
  251. /// </summary>
  252. AgriculturalIntegration = 6,
  253. /// <summary>
  254. /// 城镇土地资源评价
  255. /// </summary>
  256. TownLandResource = 7,
  257. /// <summary>
  258. /// 城镇建设水资源评价
  259. /// </summary>
  260. TownWaterResource = 8,
  261. /// <summary>
  262. /// 城镇气候评价
  263. /// </summary>
  264. TownClimateResource = 9,
  265. /// <summary>
  266. /// 城镇大气环境容量
  267. /// </summary>
  268. TownAtmosphericEnvironmentalResource = 10,
  269. /// <summary>
  270. /// 城镇建设水环境容量评价
  271. /// </summary>
  272. TownWaterEnvironmentResource = 11,
  273. /// <summary>
  274. /// 城镇建设市县层面区位优势度评价
  275. /// </summary>
  276. TownCountyLocationAdvantageResource = 12,
  277. /// <summary>
  278. /// 城镇地质灾害评价
  279. /// </summary>
  280. TownGeologicalHazard = 13,
  281. /// <summary>
  282. /// 城镇风暴潮灾害评价
  283. /// </summary>
  284. TownStormTide = 14,
  285. /// <summary>
  286. /// 城镇集成评价
  287. /// </summary>
  288. TownIntegration = 15,
  289. /// <summary>
  290. /// 物种层面生物多样性维护功能开发
  291. /// </summary>
  292. EcologySpeciesLevelBiodiversity = 16,
  293. /// <summary>
  294. /// 生态系统层面生物多样性维护功能评价
  295. /// </summary>
  296. EcologyEcosystemLevelBiodiversity = 17,
  297. /// <summary>
  298. /// 生态水土保持功能评价
  299. /// </summary>
  300. EcologyWaterLandConservation = 18,
  301. /// <summary>
  302. /// 水源涵养
  303. /// </summary>
  304. EcologyWaterConservation = 19,
  305. /// <summary>
  306. /// 防风固沙
  307. /// </summary>
  308. EcologyWindAndSandFixation = 20,
  309. /// <summary>
  310. /// 海岸防护
  311. /// </summary>
  312. EcologyCoastalProtection = 21,
  313. /// <summary>
  314. /// 生态系统服务功能重要性集成评价
  315. /// </summary>
  316. EcologyEcosystemServiceIntegrated = 22,
  317. /// <summary>
  318. /// 水土流失敏感性
  319. /// </summary>
  320. EcologySoilErosionSensitivity = 23,
  321. /// <summary>
  322. /// 沙化敏感性
  323. /// </summary>
  324. EcologySandificationSensitivity = 24,
  325. /// <summary>
  326. /// 石漠化敏感性
  327. /// </summary>
  328. EcologyDesertification = 25,
  329. /// <summary>
  330. /// 海岸侵蚀敏感性
  331. /// </summary>
  332. EcologyCoastErosion = 26,
  333. /// <summary>
  334. /// 生态敏感性集成评价
  335. /// </summary>
  336. EcologyEcologicalSensitivityIntegrated = 27,
  337. /// <summary>
  338. /// 初判生态保护重要性评价
  339. /// </summary>
  340. EcologyIntegrated = 28,
  341. /// <summary>
  342. /// 修正生态保护重要性评价
  343. /// </summary>
  344. EcologyIntegratedCorrect = 29,
  345. /// <summary>
  346. /// 农业土地资源承载力评价
  347. /// </summary>
  348. AgriculturalLandCapacity = 30,
  349. /// <summary>
  350. /// 水资源约束下农业生产承载规模评价
  351. /// </summary>
  352. AgriculturalWaterCapacity = 31,
  353. /// <summary>
  354. /// 城镇土地资源承载力评价
  355. /// </summary>
  356. TownLandCapacity = 32,
  357. /// <summary>
  358. /// 水资源约束下城镇建设承载规模评价
  359. /// </summary>
  360. TownWaterCapacity = 33,
  361. /// <summary>
  362. /// 黄土漏斗区评价
  363. /// </summary>
  364. LoessAreaAnalyze = 34,
  365. /// <summary>
  366. /// 文化遗址区评价
  367. /// </summary>
  368. CulturalHeritageAreaAnalyze = 35,
  369. /// <summary>
  370. /// 农业采空区评价
  371. /// </summary>
  372. AgriculturalMinedOutAreaAnalyze = 36,
  373. /// <summary>
  374. /// 自定义模型评价
  375. /// </summary>
  376. CommonCustomer = 37,
  377. /// <summary>
  378. /// 农业种植业生产适宜性评价
  379. /// </summary>
  380. CultivationProduction = 38,
  381. /// <summary>
  382. /// 牧区畜牧业生产适宜性评价
  383. /// </summary>
  384. PastureHusbandry = 39,
  385. /// <summary>
  386. /// 农区畜牧业生产适宜性评价
  387. /// </summary>
  388. AgriHusbandry = 40,
  389. /// <summary>
  390. /// 渔业捕捞生产适宜性评价
  391. /// </summary>
  392. Fishing = 41,
  393. /// <summary>
  394. /// 渔业养殖生产适宜性评价
  395. /// </summary>
  396. FisheryCulture = 42,
  397. /// <summary>
  398. /// 农业种植业生产不适宜性评价
  399. /// </summary>
  400. CropProductionUnfavorable = 43,
  401. /// <summary>
  402. /// 农业生产适宜性集成评价
  403. /// </summary>
  404. AgriculturalSuitability = 44,
  405. /// <summary>
  406. /// 集成评价结果修正
  407. /// </summary>
  408. IntegrationResultCorrection = 45,
  409. }
  410. }
  411. }