Example #1
0
        private static void NormalizeEvent(IeEvent wEvent)
        {
            if (wEvent == null)
            {
                return;
            }

            wEvent.Triggers = NormalizeList(wEvent.Triggers);
            wEvent.Triggers?.ForEach(t => NormalizeAction(t.Action));
        }
 private static void CollectGroupsWithUnassignedProjectId(IeEvent wEvent, ICollection <IeUserGroup> collection)
 {
     wEvent?.Triggers?.ForEach(t =>
     {
         if (t?.Action.ActionType == ActionTypes.PropertyChange)
         {
             var pca = (IePropertyChangeAction)t.Action;
             pca?.UsersGroups?.UsersGroups?.Where(IsGroupProjectIdUnassigned).ForEach(collection.Add);
         }
     });
 }
 private static void CollectUsersAndGroupsToLookup(IeEvent wEvent, ISet <string> userNames, ISet <string> groupNames,
                                                   ISet <int> userIds, ISet <int> groupIds, bool ignoreIds)
 {
     wEvent?.Triggers?.ForEach(t =>
     {
         if (t?.Action?.ActionType == ActionTypes.PropertyChange)
         {
             var action = (IePropertyChangeAction)t.Action;
             action.UsersGroups?.UsersGroups?.ForEach(ug =>
             {
                 if (ug.IsGroup.GetValueOrDefault())
                 {
                     if (!ignoreIds && ug.Id.HasValue)
                     {
                         groupIds.Add(ug.Id.Value);
                     }
                     else
                     {
                         groupNames.Add(ug.Name);
                     }
                 }
                 else
                 {
                     if (!ignoreIds && ug.Id.HasValue)
                     {
                         userIds.Add(ug.Id.Value);
                     }
                     else
                     {
                         userNames.Add(ug.Name);
                     }
                 }
             });
         }
     });
 }