Beispiel #1
0
        static  PolicySetEvent[] GetPolicySetEvents(Response response)
        {
            var policySets = new List<PolicySetEvent>();

			try
			{
                foreach (var contentItem in response.Contents)
                {   
                    foreach (var policySet in contentItem.PolicySets)
                    {
                        var policySetEvent = new PolicySetEvent() 
                            {
                                PolicySetName = policySet.Name 
                            };

                        foreach (var policy in policySet.Policies)
                        {   
                            foreach (var expression in policy.Expressions)
                            {
                                if (!String.IsNullOrEmpty(expression.Rating))
                                {
                                    policySetEvent.Risk = expression.Rating;
                                }
                            }
                        }

                        policySets.Add(policySetEvent);
                    }                
                }
            }
            catch(Exception ex)
            {
                Logger.LogError(ex);
            }

            return policySets.ToArray();
        }
Beispiel #2
0
 static void RaisePolicySetEvents(PolicySetEvent[] policySetEvents)
 {
     foreach (var policySetEvent in policySetEvents)
     {
         policySetEvent.RaiseEvent();
     }
 }