using System; using System.ComponentModel; using System.Reflection; namespace WWPipeLine.Commons { /// /// 基础枚举类 /// public class EnumHelper { public static string GetEnumDescription(Enum enumValue) { string value = enumValue.ToString(); FieldInfo field = enumValue.GetType().GetField(value); object[] objs = field.GetCustomAttributes(typeof(DescriptionAttribute), false); //获取描述属性 if (objs == null || objs.Length == 0) //当描述属性没有时,直接返回名称 return value; DescriptionAttribute descriptionAttribute = (DescriptionAttribute)objs[0]; return descriptionAttribute.Description; } /// /// Py执行结果 /// public enum EPyStatus { /// /// 参数对象为空 /// [Description("强制终止")] ForceQuit = -1, /// /// 正常结束 /// [Description("正常结束")] Normal = 0, /// /// Python执行异常 /// [Description("Python执行异常")] RunError = 1, /// /// 文件路径不存在 /// [Description("文件路径不存在")] PathError = 2, /// /// 获取栅格相交区域异常 /// [Description("获取栅格相交区域异常")] AreaJoinErro = 3, /// /// 读取json异常 /// [Description("读取json异常")] JsonError = 5, /// /// 参数个数异常 /// [Description("参数值异常")] ArgsCountError = 6, /// /// 传入文件类型异常 /// [Description("传入文件类型异常")] FileTypeError = 7, /// /// 创建shp异常 /// [Description("创建shp异常")] CreateShpFileError = 8, /// /// 空间插值异常 /// [Description("空间插值异常")] SpatialInterpolationError = 9, /// /// 栅格运算异常 /// [Description("栅格运算异常")] GridMeasureError = 10, /// /// 裁剪栅格异常 /// [Description("裁剪栅格异常或行政区异常")] GridCatError = 11, /// /// 重投影异常 /// [Description("重投影异常")] ShadowError = 12, /// /// 删除文件异常 /// [Description("删除文件异常")] DeleteFileError = 13, /// /// 环境异常 /// [Description("环境异常")] EnvError = 14, /// /// 参数对象为空 /// [Description("参数对象为空")] ArgsError = 15, /// /// 参数对象为空 /// [Description("行政区空间参考获取异常")] RegionCKError = 66, /// /// 参数对象为空 /// [Description("行政区、评价文件空间参考不一致")] SpatialReferenceInconsistent = 67, } /// /// 控件类型 /// public enum ECtrlType { /// /// 下拉控件 /// ExComboBox = 0, /// /// 文本框控件 /// ExTextBox = 1, /// /// 数值控件 /// NumericEdit = 2, /// /// 打开文件控件 /// OpenDialog = 3, /// /// 保存文件控件 /// SaveDialog = 4, /// /// 选择文件控件 /// ExCheckBox = 5, /// ///评价流程描述控件 /// ExDescriptionContent = 6, /// /// 选择文件和下拉控件并行使用 /// OpenDialogWithComboBox = 7, /// ///自定义流程控件 /// ExCommonCustomer = 8, } /// /// 结果展示类型 /// public enum EShowType { /// /// 仅展示地图 /// Map = 0, /// /// 仅展示统计 /// Summary = 1, /// /// 展示所有信息 /// All = 2, } public enum EoptionButton { /// /// 退出 /// Eoptbut_Exit = 0, /// /// 重载配置 /// Eoptbut_Reload = 1, /// /// 重新配置 /// Eoptbut_Config = 2, /// /// 帮助 /// Eoptbut_Help = 3, /// /// 设置 /// Eoptbut_Setting = 4, /// /// 关于 /// Eoptbut_About } public enum EChart { /// /// 饼图 /// Pie = 0, /// /// 柱状图 /// Column = 1, } public enum EBusinessType { /// /// 路网信息 /// Reptile_RoadMap = -2, /// /// POI /// Reptile_POI = -1, /// /// 农业土地资源评价 /// AgriculturalLandResource = 0, /// /// 农业水资源评价 /// AgriculturalWaterResource = 1, /// /// 农业气候评价 /// AgriculturalClimateResource = 2, /// /// 农业环境评价 /// AgriculturalEnvironmentalResource = 3, /// /// 农业生态评价 /// AgriculturalEcology = 4, /// /// 农业灾害评价 /// AgriculturalHazard = 5, /// /// 农业集成评价 /// AgriculturalIntegration = 6, /// /// 城镇土地资源评价 /// TownLandResource = 7, /// /// 城镇建设水资源评价 /// TownWaterResource = 8, /// /// 城镇气候评价 /// TownClimateResource = 9, /// /// 城镇大气环境容量 /// TownAtmosphericEnvironmentalResource = 10, /// /// 城镇建设水环境容量评价 /// TownWaterEnvironmentResource = 11, /// /// 城镇建设市县层面区位优势度评价 /// TownCountyLocationAdvantageResource = 12, /// /// 城镇地质灾害评价 /// TownGeologicalHazard = 13, /// /// 城镇风暴潮灾害评价 /// TownStormTide = 14, /// /// 城镇集成评价 /// TownIntegration = 15, /// /// 物种层面生物多样性维护功能开发 /// EcologySpeciesLevelBiodiversity = 16, /// /// 生态系统层面生物多样性维护功能评价 /// EcologyEcosystemLevelBiodiversity = 17, /// /// 生态水土保持功能评价 /// EcologyWaterLandConservation = 18, /// /// 水源涵养 /// EcologyWaterConservation = 19, /// /// 防风固沙 /// EcologyWindAndSandFixation = 20, /// /// 海岸防护 /// EcologyCoastalProtection = 21, /// /// 生态系统服务功能重要性集成评价 /// EcologyEcosystemServiceIntegrated = 22, /// /// 水土流失敏感性 /// EcologySoilErosionSensitivity = 23, /// /// 沙化敏感性 /// EcologySandificationSensitivity = 24, /// /// 石漠化敏感性 /// EcologyDesertification = 25, /// /// 海岸侵蚀敏感性 /// EcologyCoastErosion = 26, /// /// 生态敏感性集成评价 /// EcologyEcologicalSensitivityIntegrated = 27, /// /// 初判生态保护重要性评价 /// EcologyIntegrated = 28, /// /// 修正生态保护重要性评价 /// EcologyIntegratedCorrect = 29, /// /// 农业土地资源承载力评价 /// AgriculturalLandCapacity = 30, /// /// 水资源约束下农业生产承载规模评价 /// AgriculturalWaterCapacity = 31, /// /// 城镇土地资源承载力评价 /// TownLandCapacity = 32, /// /// 水资源约束下城镇建设承载规模评价 /// TownWaterCapacity = 33, /// /// 黄土漏斗区评价 /// LoessAreaAnalyze = 34, /// /// 文化遗址区评价 /// CulturalHeritageAreaAnalyze = 35, /// /// 农业采空区评价 /// AgriculturalMinedOutAreaAnalyze = 36, /// /// 自定义模型评价 /// CommonCustomer = 37, /// /// 农业种植业生产适宜性评价 /// CultivationProduction = 38, /// /// 牧区畜牧业生产适宜性评价 /// PastureHusbandry = 39, /// /// 农区畜牧业生产适宜性评价 /// AgriHusbandry = 40, /// /// 渔业捕捞生产适宜性评价 /// Fishing = 41, /// /// 渔业养殖生产适宜性评价 /// FisheryCulture = 42, /// /// 农业种植业生产不适宜性评价 /// CropProductionUnfavorable = 43, /// /// 农业生产适宜性集成评价 /// AgriculturalSuitability = 44, /// /// 集成评价结果修正 /// IntegrationResultCorrection = 45, } } }