internal static bool Reset(IRoleProvider prov)
        {
            try
            {
                RoleMembershipMemorySet tmp = new RoleMembershipMemorySet();
                foreach (Role p in RoleMemorySet.Instance.GetRoles())
                {
                    IEnumerable <Role> kids = prov.GetChildRoles(p);
                    if (kids != null)
                    {
                        foreach (Role r in kids)
                        {
                            tmp.AddRoleToRole(p.Id, r.Id);
                        }
                    }

                    IEnumerable <Guid> users = prov.GetUsers(p);
                    if (users != null)
                    {
                        foreach (Guid us in users)
                        {
                            tmp.AddUserToRole(us, p.Id);
                        }
                    }

                    IEnumerable <PermissionAssignment> pas = prov.GetPermissionAssignments(p);
                    if (pas != null)
                    {
                        foreach (PermissionAssignment pa in pas)
                        {
                            tmp.AddPermissionToRole(p.Id, pa.Permission.Id, pa.GrantType == GrantType.Grant);
                        }
                    }
                }
                instance = tmp;
                return(true);
            }
            catch
            { }
            return(false);
        }