using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Controls; using Aitex.Core.Account; using Aitex.Core.Util; namespace Aitex.Triton160.UI.Views { public static class UserControlExtender { /// /// 对UserControl类进行扩展 /// /// /// public static ViewPermission GetPermission(this UserControl userControl) { var account = Globals.Session["CurrentUser"] as Account; if (account == null) return ViewPermission.Invisiable; var userControlName = userControl.Name; if (!account.Permission.ContainsKey(userControlName)) return ViewPermission.Invisiable; return account.Permission[userControlName]; } } }