/// <summary> /// Constructs the object path from the CimInstance. /// </summary> internal static string GetCimSystemPath(CimSystemProperties sysProperties, IEnumerator cimPropertiesEnumerator) { //Path should be supported by MI APIs, it is not currently supported by APIs // until that decision is taken we are reporting null for path. return(null); /* * string objectNamespace = sysProperties.Namespace; * string objectComputerName = sysProperties.ServerName; * string objectClassName = sysProperties.ClassName; * StringBuilder strPath = new StringBuilder(); * if( objectComputerName != null ) * { * strPath.Append("//"); * strPath.Append(objectComputerName); * strPath.Append("/"); * } * if( objectNamespace != null) * { * strPath.Append(objectNamespace); * strPath.Append(":"); * } * strPath.Append(objectClassName); * //Now find the key properties * IEnumerator cimProperties = cimPropertiesEnumerator; * bool bFirst = true; * while(cimProperties.MoveNext()) * { * //Handle for both instance and class * CimProperty instProp = cimProperties.Current as CimProperty; * if( instProp != null) * { * if(instProp.Value != null) * { * GetPathForProperty((long)instProp.Flags, instProp.Name, instProp.Value, ref bFirst, ref strPath); * } * } * else * { * CimPropertyDeclaration classProp = cimProperties.Current as CimPropertyDeclaration; * if( classProp == null) * { * // this is not expected, should we throw from here? * return null; * } * if( classProp.Value != null ) * { * GetPathForProperty((long)classProp.Flags, classProp.Name, classProp.Value, ref bFirst, ref strPath); * } * } * } * return strPath.ToString(); */ }
internal static string GetCimSystemPath(CimSystemProperties sysProperties, IEnumerator cimPropertiesEnumerator) { return string.Format (@"//{0}/{1}/{2}", sysProperties.ServerName, sysProperties.Namespace, sysProperties.ClassName); }
internal static string GetCimSystemPath(CimSystemProperties sysProperties, IEnumerator cimPropertiesEnumerator) { return(string.Format(@"//{0}/{1}/{2}", sysProperties.ServerName, sysProperties.Namespace, sysProperties.ClassName)); }