public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
        {
            base.Initialize(name, config);

            string fileName;

            if(HttpContext.Current != null)
            {
                string serverDataPath = HttpContext.Current.Server.MapPath("~/App_Data/");
                fileName = serverDataPath + config["fileName"];
            }
            else
            {
                //test is being performed
                fileName = config["fileName"];
            }

            this.xmlHelper = new SecurityXmlHelper(fileName);
        }
        private string[] GetUsersInRole(string roleName, SecurityXmlHelper.ElementFilterPredicate userFilter)
        {
            var role = xmlHelper.GetRoleElements(roleName).SingleOrDefault();

            return SecurityXmlHelper.GetUsersInRole(role).
                Where(userName => userFilter(userName)).
                Select(userElement => userElement.Value).
                ToArray();
        }
        private MembershipUserCollection GetUsers(SecurityXmlHelper.ElementFilterPredicate evalDelegate,
            int pageIndex, int pageSize, out int totalRecords)
        {
            XElement[] userElements = xmlHelper.GetUserElements(evalDelegate);

            totalRecords = userElements.Length;
            MembershipUserCollection users = new MembershipUserCollection();

            int start = pageIndex * pageSize;
            int end = start + pageSize;

            if (start >= userElements.Length)
                return users;

            for (int i = 0; i < userElements.Length; i++)
            {
                users.Add(GetUserFromElement(userElements[i]));
            }

            return users;
        }