///
 public SiteMapPermission(MemberShipContext memberShipContext, ResourceManager manager)
 {
     if (memberShipContext == null)
         throw new ArgumentNullException("memberShipContext");
     if (manager == null) throw new ArgumentNullException("manager");
     _memberShipContext = memberShipContext;
 }
Пример #2
0
        public MenuPermission(string express, MemberShipContext context)
        {
            _express = express;
            _context = context;

            string[] ary = _express.Split(':');
            if (ary.Length < 0)
                throw new FormatException("expression is not a right format, it should be [resource]:[operator]");
            Resource = ary[0];
            try
            {
                Type enmType = OrnamentContext.ResourceManager.GetOperator(ary[0]);
                OperatorValue = (Enum) Enum.Parse(enmType, ary[1], true);
            }
            catch (ArgumentException)
            {
                throw new FormatException(String.Format("{0} is not recognized in the {1}", ary[1],
                    OrnamentContext.ResourceManager.GetOperator(ary[0]).Name));
            }
        }
 private UserContextInner()
 {
     _memberShip = new MemberShipContext(DaoFactory.MemberShipFactory);
 }