示例#1
0
        private static OguAndADObjectComparerBase GetComparer(IOguObject oguObject)
        {
            string schemaTypeName = oguObject.ObjectType.ToString();

            string cacheKey = "OguAndADObjectComparerBase" + "-" + schemaTypeName;

            return((OguAndADObjectComparerBase)ObjectContextCache.Instance.GetOrAddNewValue(cacheKey, (cache, key) =>
            {
                SchemaMappingInfo mappingInfo = PermissionCenterToADSynchronizeSettings.GetConfig().SchemaMappings.GetSchemaMappingInfo(schemaTypeName);

                OguAndADObjectComparerBase comparer = (OguAndADObjectComparerBase)PropertyComparersSettings.GetConfig().ObjectComparers[mappingInfo.ComparerName].CreateInstance();

                cache.Add(cacheKey, comparer);

                return comparer;
            }));
        }
示例#2
0
        public static ObjectModifyType Compare(IOguObject oguObject, ADObjectWrapper adObject)
        {
            OguAndADObjectComparerBase comparer = GetComparer(oguObject);

            return(comparer.Compare(oguObject, adObject));
        }