Example #1
0
        internal void GetCimInstance(CimInstance cimInstance, XOperationContextBase context)
        {
            string @namespace;

            DebugHelper.WriteLogEx();
            CimNewCimInstanceContext cimNewCimInstanceContext = context as CimNewCimInstanceContext;

            if (cimNewCimInstanceContext != null)
            {
                CimSessionProxy cimSessionProxy = base.CreateCimSessionProxy(cimNewCimInstanceContext.Proxy);
                if (cimInstance.CimSystemProperties.Namespace == null)
                {
                    @namespace = cimNewCimInstanceContext.Namespace;
                }
                else
                {
                    @namespace = cimInstance.CimSystemProperties.Namespace;
                }
                string str = @namespace;
                cimSessionProxy.GetInstanceAsync(str, cimInstance);
                return;
            }
            else
            {
                DebugHelper.WriteLog("Invalid (null) CimNewCimInstanceContext", 1);
                return;
            }
        }
        /// <summary>
        /// <para>
        /// Get full <see cref="CimInstance"/> from server based on the key
        /// </para>
        /// </summary>
        /// <param name="cimInstance"></param>
        internal void GetCimInstance(CimInstance cimInstance, XOperationContextBase context)
        {
            DebugHelper.WriteLogEx();

            CimNewCimInstanceContext newCimInstanceContext = context as CimNewCimInstanceContext;

            if (newCimInstanceContext == null)
            {
                DebugHelper.WriteLog("Invalid (null) CimNewCimInstanceContext", 1);
                return;
            }

            CimSessionProxy proxy     = CreateCimSessionProxy(newCimInstanceContext.Proxy);
            string          nameSpace = (cimInstance.CimSystemProperties.Namespace == null) ? newCimInstanceContext.Namespace : cimInstance.CimSystemProperties.Namespace;

            proxy.GetInstanceAsync(nameSpace, cimInstance);
        }