Пример #1
0
        private static ADObject GetCachedObject(string DN, string[] directoryAttributes, CmdletSessionInfo cmdletSessionInfo)
        {
            IDictionary <string, ADObject> protectedFromDeletionCache = ProtectedFromDeletionUtil.GetProtectedFromDeletionCache(cmdletSessionInfo);

            if (!protectedFromDeletionCache.ContainsKey(DN))
            {
                protectedFromDeletionCache.Add(DN, Utils.GetDirectoryObject(DN, directoryAttributes, cmdletSessionInfo));
            }
            return(protectedFromDeletionCache[DN]);
        }
Пример #2
0
        private static void AddObjectToCache(ADObject directoryObj, CmdletSessionInfo cmdletSessionInfo)
        {
            IDictionary <string, ADObject> protectedFromDeletionCache = ProtectedFromDeletionUtil.GetProtectedFromDeletionCache(cmdletSessionInfo);

            protectedFromDeletionCache[directoryObj.DistinguishedName] = directoryObj;
        }