123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Reflection;
- using System.Text;
- namespace YiSha.Enum.ZX
- {
-
-
-
- public enum NewManagerModelsIsHotEnum
- {
-
-
-
- [Description("不推荐")]
- 不推荐 = 0,
-
-
-
- [Description("推荐")]
- 推荐 = 1
- }
-
-
-
- public enum NewManagerModelsIsGeneratedEnum
- {
-
-
-
- [Description("不生成")]
- 不生成 = 0,
-
-
-
- [Description("生成")]
- 生成 = 1
- }
-
-
-
- public enum PublishStatisticsType
- {
-
-
-
- [Description("内容发布量")]
- 内容发布量 = 0,
-
-
-
- [Description("栏目发布统计")]
- 栏目发布统计 = 1
- }
- #region 老系统数据
-
-
-
- public enum TemplateType : int
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
- [Description("福彩3D")]
- [Text("../../Template/InformationDetails_Template.html", "3d")]
- Fucai3D_1 = 14,
-
-
-
- [Description("福彩3D")]
- [Text("../../Template/InformationDetails_Template.html", "3d")]
- Fucai3D_2 = 55,
-
-
-
- [Description("排列三")]
- [Text("../../Template/InformationDetails_Template.html", "p3")]
- ArrangementThree_1 = 22,
-
-
-
- [Description("排列三")]
- [Text("../../Template/InformationDetails_Template.html", "p3")]
- ArrangementThree_2 = 57,
-
-
-
- [Description("太湖字谜")]
- [Text("../../Template/Puzzles_Template.html", "3d/thzm")]
- TaihuPuzzles = 18,
-
-
-
- [Description("彩神通字谜")]
- [Text("../../Template/Puzzles_Template.html", "3d/cstzm")]
- CrosswordPuzzle = 25,
-
-
-
- [Description("双色球")]
- [Text("../../Template/InformationDetails_Template.html", "ssq")]
- Chromosphere_1 = 41,
-
-
-
- [Description("双色球")]
- [Text("../../Template/InformationDetails_Template.html", "ssq")]
- Chromosphere_2 = 56,
-
-
-
- [Description("其他彩种")]
- [Text("../../Template/InformationDetails_Template.html", "qita")]
- OtherColoredSpecies = 44,
-
-
-
- [Description("大乐透")]
- [Text("../../Template/InformationDetails_Template.html", "qita")]
- Lotto = 58,
-
-
-
- Special55128 = 54,
-
-
-
- [Description("友情链接")]
- [Text("../../../Template/FriendlyLink_Template.html", "")]
- FriendshipLink = 99,
-
-
-
- [Description("推广广告")]
- [Text("../../../Template/Advertisement_Template.html", "../../../Template/json.txt")]
- Advertisement = 98,
-
-
-
- [Description("福彩快乐8")]
- [Text("../../Template/InformationDetails_Template.html", "kl8")]
- Fucaikl8 =114
- }
-
-
-
- public static class EnumAttribute
- {
- private static Dictionary<string, Dictionary<string, string[]>> _enumCache;
-
-
-
- private static Dictionary<string, Dictionary<string, string[]>> EnumCache
- {
- get { return _enumCache ?? (_enumCache = new Dictionary<string, Dictionary<string, string[]>>()); }
- set { _enumCache = value; }
- }
-
-
-
-
-
- public static string GetEnumDescription(this System.Enum value)
- {
- Type enumType = value.GetType();
-
- string name = System.Enum.GetName(enumType, value);
- if (name != null)
- {
-
- FieldInfo fieldInfo = enumType.GetField(name);
- if (fieldInfo != null)
- {
-
- DescriptionAttribute attr = Attribute.GetCustomAttribute(fieldInfo,
- typeof(DescriptionAttribute), false) as DescriptionAttribute;
- if (attr != null)
- {
- return attr.Description;
- }
- }
- }
- return null;
- }
-
-
-
-
-
- public static string[] GetEnumText(this System.Enum en)
- {
- string enString = string.Empty;
- if (null == en) return new[] { "", "" };
- Type type = en.GetType();
- enString = en.ToString();
- if (type.FullName != null && !EnumCache.ContainsKey(type.FullName))
- {
- System.Reflection.FieldInfo[] fields = type.GetFields();
- Dictionary<string, string[]> temp = new Dictionary<string, string[]>();
- foreach (FieldInfo item in fields)
- {
- object[] attrs = item.GetCustomAttributes(typeof(TextAttribute), false);
- if (attrs.Length == 1)
- {
- string v = ((TextAttribute)attrs[0]).Value;
- string e = ((TextAttribute)attrs[0]).Ex;
- temp.Add(item.Name, new[] { v, e });
- }
- }
- EnumCache.Add(type.FullName, temp);
- }
- if (type.FullName != null && EnumCache[type.FullName].ContainsKey(enString))
- {
- return EnumCache[type.FullName][enString];
- }
- return new[] { "", "" };
- }
- }
-
-
-
- public class TextAttribute : Attribute
- {
- public TextAttribute(string value, string ex = "")
- {
- Value = value;
- Ex = ex;
- }
-
-
-
- public string Value { get; private set; }
- public string Ex { get; private set; }
- }
- public static class ZxCzTemplateTypeHelper
- {
- public static readonly Dictionary<int, TemplateType> dict = new Dictionary<int, TemplateType> {
- { 14,TemplateType.Fucai3D_1 },
- { 55,TemplateType.Fucai3D_2 },
- { 22,TemplateType.ArrangementThree_1 },
- { 57,TemplateType.ArrangementThree_2 },
- { 18,TemplateType.TaihuPuzzles },
- { 25,TemplateType.CrosswordPuzzle },
- { 41,TemplateType.Chromosphere_1 },
- { 56,TemplateType.Chromosphere_2 },
- { 44,TemplateType.OtherColoredSpecies },
- { 58,TemplateType.Lotto },
- { 54,TemplateType.Special55128 },
- { 99,TemplateType.FriendshipLink },
- { 98,TemplateType.Advertisement },
- { 114,TemplateType.Fucaikl8 },
- };
- }
- #endregion
- }
|