private void ResponsesReceived(ReceivedResponses receivedResponses)
        {
            if (receivedResponses.HasResponse <GetAllUserGroupsResponse>())
            {
                BindingModel.PopulateFrom(receivedResponses.Get <GetAllUserGroupsResponse>().UserGroups);
                View.ExpandTreeView();
            }

            if (receivedResponses.HasResponse <CheckPermissionsResponse>() &&
                !receivedResponses.Get <CheckPermissionsResponse>().AuthorizationResults[Permissions.CreateUserGroup])
            {
                View.HideAddNewButton();
            }
        }
Beispiel #2
0
		protected override void AfterSetUp()
		{
			topLevel1 = new UserGroupDto { Id = Guid.NewGuid(), Name = "topLevel1" };
			secondLevel1 = new UserGroupDto { Id = Guid.NewGuid(), Name = "secondLevel1", ParentId = topLevel1.Id };
			secondLevel2 = new UserGroupDto { Id = Guid.NewGuid(), Name = "secondLevel2", ParentId = topLevel1.Id };
			thirdLevel1 = new UserGroupDto { Id = Guid.NewGuid(), Name = "thirdLevel1", ParentId = secondLevel2.Id };
			topLevel2 = new UserGroupDto { Id = Guid.NewGuid(), Name = "topLevel2" };

			// the order is sorta randomized to make sure the Populate method correctly deals with it
			// (as in: when a child is located in the result before its parent)
			var dtos = new[] { thirdLevel1, secondLevel1, topLevel2, secondLevel2, topLevel1 };

			BindingModel.PopulateFrom(dtos);
		}