Esempio n. 1
0
        internal static bool TryGetFromCache(string cmdletNoun, out ReferencePathGenerator referencePathGenerator)
        {
            if (string.IsNullOrEmpty(cmdletNoun))
            {
                throw new ArgumentException("Cmdlet noun cannot be null or empty", nameof(cmdletNoun));
            }

            return(Cache.TryGetValue(cmdletNoun, out referencePathGenerator));
        }
Esempio n. 2
0
        internal static void AddToCache(string cmdletNoun, ReferencePathGenerator referencePathGenerator)
        {
            if (string.IsNullOrEmpty(cmdletNoun))
            {
                throw new ArgumentException("Cmdlet noun cannot be null or empty", nameof(cmdletNoun));
            }
            if (referencePathGenerator == null)
            {
                throw new ArgumentNullException(nameof(referencePathGenerator));
            }

            Cache[cmdletNoun] = referencePathGenerator;
        }