Amazon.Auth.AccessControlPolicy.Internal.JsonPolicyReader.convertConditionRecord C# (CSharp) Метод

convertConditionRecord() приватный статический Метод

private static convertConditionRecord ( Statement statement, JsonData jCondition ) : void
statement Statement
jCondition JsonData
Результат void
        private static void convertConditionRecord(Statement statement, JsonData jCondition)
        {
            foreach (KeyValuePair<string, JsonData> kvp1 in jCondition)
            {
                string type = kvp1.Key;
                JsonData comparisons = kvp1.Value;
                foreach (KeyValuePair<string, JsonData> kvp2 in comparisons)
                {
                    string key = kvp2.Key;
                    List<string> values = new List<string>();
                    if (kvp2.Value != null)
                    {
                        if (kvp2.Value.IsString)
                        {
                            values.Add((string)kvp2.Value);
                        }
                        else if (kvp2.Value.IsArray)
                        {
                            foreach (JsonData jValue in kvp2.Value)
                            {
                                if (jValue.IsString)
                                {
                                    values.Add((string)jValue);
                                }
                            }
                        }
                    }

                    Condition condition = new Condition(type, key, values.ToArray());
                    statement.Conditions.Add(condition);
                }
            }
        }
    }