Exemplo n.º 1
0
            internal void FetchAllModuleFiles(CimSession cimSession, string cimNamespace, CimOperationOptions operationOptions)
            {
                IEnumerable <CimInstance> associatedInstances = cimSession.EnumerateAssociatedInstances(
                    cimNamespace,
                    _baseObject,
                    DiscoveryProviderAssociationClass,
                    DiscoveryProviderFileClass,
                    "Antecedent",
                    "Dependent",
                    operationOptions);

                IEnumerable <CimModuleFile> associatedFiles = associatedInstances.Select(i => new CimModuleImplementationFile(i));

                _moduleFiles = associatedFiles.ToList();
            }
        public static void EnumerateAssociatedInstanceSync(CimSession cimSession, string cimNamespace, string cimClassName)
        {
            try
            {
                string      associationClassName;
                string      resultClassName;
                CimInstance associatedInputInstance = EnumerateAssociatedInstanceCore(
                    cimSession,
                    cimNamespace,
                    cimClassName,
                    out associationClassName,
                    out resultClassName);
                if (associatedInputInstance == null)
                {
                    Console.WriteLine("EnumerateAssociatedInstanceSync operation not performed");
                    return;
                }

                IEnumerable <CimInstance> enumeratedInstances = cimSession.EnumerateAssociatedInstances(
                    cimNamespace,
                    associatedInputInstance,
                    associationClassName,
                    resultClassName,
                    null,
                    null);
                foreach (CimInstance cimInstance in enumeratedInstances)
                {
                    // Use the instance
                    PrintCimInstance(cimInstance);
                }
            }
            catch (CimException ex)
            {
                PrintCimException(ex);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Exemplo n.º 3
0
            internal void FetchAllModuleFiles(CimSession cimSession, string cimNamespace, CimOperationOptions operationOptions)
            {
                IEnumerable <RemoteDiscoveryHelper.CimModuleFile> source = from i in cimSession.EnumerateAssociatedInstances(cimNamespace, this._baseObject, "PS_ModuleToModuleFile", "PS_ModuleFile", "Antecedent", "Dependent", operationOptions) select new CimModuleImplementationFile(i);

                this._moduleFiles = source.ToList <RemoteDiscoveryHelper.CimModuleFile>();
            }