123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Runtime.InteropServices;
- namespace Bowin.Web.Controls.Mvc
- {
- public abstract class BaseControl
- {
- public BaseControl()
- {
- Attributes = new Dictionary<string, string>();
- CurrentHttpContext = HttpContext.Current;
- //if (!Check())
- //{
- // throw new Exception("软件需要注册,您并未完成注册,请联系厂商完成注册程序。");
- //}
- }
- //[DllImport("RegisterMFC.dll")]
- //public static extern bool Check();
- public HttpContext CurrentHttpContext { get; set; }
- protected IDictionary<string, string> Attributes { get; set; }
- public string ID { get; set; }
- public string Name { get; set; }
- public string Title { get; set; }
- public string CssClass { get; set; }
- /// <summary>
- /// 是否显示
- /// </summary>
- public bool? IsShow { get; set; }
- /// <summary>
- /// 是否启用
- /// </summary>
- public bool? IsEnabled { get; set; }
- public abstract string Render();
-
- private static readonly object lock_NewIDIndex = new object();
- private static int currIDIndex = 0;
- public static int NewIDIndex()
- {
- lock (lock_NewIDIndex)
- {
- return currIDIndex++;
- }
- }
-
- }
- }
|