public AssocGroupComponent(ManagementObject assocInstance, ManagementObject sourceObj) { sourceInst = sourceObj; associationPath = assocInstance.Path.Path; associationClass = assocInstance.Path.ClassName; //now, inspect assocInstance object to find target role and path string targetNamespacePath = WmiHelper.GetAssocTargetNamespacePath(assocInstance, sourceObj.Path); int colon = targetNamespacePath.IndexOf(":"); if (colon >= 0) { targetClass = targetNamespacePath.Substring(colon + 1); targetNS = targetNamespacePath.Substring(0, colon + 1); } else { targetClass = targetNamespacePath; targetNS = sourceObj.Path.NamespacePath; } targetRole = WmiHelper.GetAssocTargetRole(assocInstance, sourceObj.Path); }