|
@@ -1,6 +1,7 @@
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.ComponentModel;
|
|
|
+using System.Reflection;
|
|
|
using System.Text;
|
|
|
|
|
|
namespace YiSha.Enum.ZX
|
|
@@ -55,4 +56,227 @@ namespace YiSha.Enum.ZX
|
|
|
[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
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 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 },
|
|
|
+ };
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
}
|