PDictionary MergeEntitlementDictionary(PDictionary dict, MobileProvision profile) { var result = new PDictionary(); foreach (var item in dict) { PObject value = item.Value; if (value is PDictionary) { value = MergeEntitlementDictionary((PDictionary)value, profile); } else if (value is PString) { value = MergeEntitlementString((PString)value, profile, false); } else if (value is PArray) { value = MergeEntitlementArray((PArray)value, profile); } else { value = value.Clone(); } if (value != null) { result.Add(item.Key, value); } } return(result); }