private static MasterCategoryList Resolve(MasterCategoryList client, MasterCategoryList server, MasterCategoryList original)
        {
            MasterCategoryList masterCategoryList = new MasterCategoryList();

            masterCategoryList.SetProperties(MasterCategoryList.ResolveProperties(client.propertyBag, server.propertyBag, original.propertyBag, AcrProfile.MasterCategoryListProfile));
            HashSet <Category> hashSet = new HashSet <Category>(server.Count);

            Util.AddRange <Category, Category>(hashSet, server);
            foreach (Category category in client)
            {
                Category category2 = server.FindMatch(category);
                Category original2 = original.FindMatch(category);
                Category category3 = Category.Resolve(category, category2, original2);
                if (category3 != null && masterCategoryList.FindMatch(category3) == null)
                {
                    masterCategoryList.Add(category3);
                }
                if (category2 != null)
                {
                    hashSet.Remove(category2);
                }
            }
            foreach (Category category4 in hashSet)
            {
                Category original3 = original.FindMatch(category4);
                Category category5 = Category.Resolve(null, category4, original3);
                if (category5 != null && masterCategoryList.FindMatch(category5) == null)
                {
                    masterCategoryList.Add(category5);
                }
            }
            return(masterCategoryList);
        }
Example #2
0
 private static Category Merge(Category client, Category server, Category original)
 {
     return(Category.Load(MasterCategoryList.ResolveProperties(client.propertyBag, server.propertyBag, (original != null) ? original.propertyBag : null, AcrProfile.CategoryProfile)));
 }