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(); CurrentHttpContext = HttpContext.Current; //if (!Check()) //{ // throw new Exception("软件需要注册,您并未完成注册,请联系厂商完成注册程序。"); //} } //[DllImport("RegisterMFC.dll")] //public static extern bool Check(); public HttpContext CurrentHttpContext { get; set; } protected IDictionary Attributes { get; set; } public string ID { get; set; } public string Name { get; set; } public string Title { get; set; } public string CssClass { get; set; } /// /// 是否显示 /// public bool? IsShow { get; set; } /// /// 是否启用 /// 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++; } } } }