private void UpdateSpecialGroupProperties(ProjectFieldDropdownValue fieldValue) { var field = fieldValue.ProjectField; var characterGroup = fieldValue.CharacterGroup; var specialGroupName = fieldValue.GetSpecialGroupName(); Debug.Assert(characterGroup != null, "characterGroup != null"); if (characterGroup.IsPublic != field.IsPublic || characterGroup.IsActive != fieldValue.IsActive || characterGroup.Description != fieldValue.Description || characterGroup.CharacterGroupName != specialGroupName) { characterGroup.IsPublic = field.IsPublic; characterGroup.IsActive = fieldValue.IsActive; characterGroup.Description = fieldValue.Description; characterGroup.CharacterGroupName = specialGroupName; MarkChanged(characterGroup); } }
private static void CreateOrUpdateSpecialGroup(ProjectFieldDropdownValue fieldValue) { if (!fieldValue.ProjectField.HasSpecialGroup()) { return; } CreateOrUpdateSpecialGroup(fieldValue.ProjectField); fieldValue.CharacterGroup = fieldValue.CharacterGroup ?? new CharacterGroup() { AvaiableDirectSlots = 0, HaveDirectSlots = false, ParentCharacterGroupIds = new [] { fieldValue.ProjectField.CharacterGroup.CharacterGroupId }, ProjectId = fieldValue.ProjectId, IsRoot = false, IsSpecial = true, ResponsibleMasterUserId = null, }; fieldValue.CharacterGroup.IsPublic = fieldValue.ProjectField.IsPublic; fieldValue.CharacterGroup.IsActive = fieldValue.IsActive; fieldValue.CharacterGroup.Description = fieldValue.Description; fieldValue.CharacterGroup.CharacterGroupName = fieldValue.GetSpecialGroupName(); }