/// <summary> /// Gets a connector space object /// </summary> /// <param name="id">The ID of the connector space object</param> /// <returns>A connector space object</returns> internal static CSObject GetCSObject(Guid id) { XmlNode node = CSObject.GetCSObjectXml(id); if (node != null) { return(new CSObject(node)); } else { return(null); } }
/// <summary> /// Changes the password for a connector space object /// </summary> /// <param name="oldPassword">The user's old password</param> /// <param name="newPassword">The user's new password</param> public void ChangePassword(string oldPassword, string newPassword) { ManagementObject mo = CSObject.GetWmiObject(this.ID); string result = mo.InvokeMethod("ChangePassword", new object[] { oldPassword, newPassword }) as string; if (result == "access-denied") { throw new UnauthorizedAccessException(); } else if (result != "success") { throw new MiiserverException($"The operation returned {result}"); } }
/// <summary> /// Sets the password for the connector space object /// </summary> /// <param name="password">The password to set</param> /// <param name="forceChangeAtLogin">A value that indicates whether the password should be changed at the next login</param> /// <param name="unlockAccount">A value that indicates whether the account should be unlocked</param> /// <param name="enforcePasswordPolicy">A value that indicates whether the password policy should be enforced</param> public void SetPassword(string password, bool forceChangeAtLogin, bool unlockAccount, bool enforcePasswordPolicy) { ManagementObject mo = CSObject.GetWmiObject(this.ID); string result = mo.InvokeMethod("SetPassword", new object[] { password, forceChangeAtLogin, unlockAccount, enforcePasswordPolicy }) as string; if (result == "access-denied") { throw new UnauthorizedAccessException(); } else if (result != "success") { throw new MiiserverException($"The operation returned {result}"); } }
/// <summary> /// Reloads the connector space object from the metadirectory /// </summary> public void Refresh() { XmlNode node = CSObject.GetCSObjectXml(this.ID); this.Reload(node); }
/// <summary> /// Gets the connector space objects connected to the specified metaverse object /// </summary> /// <param name="mvObjectId">The ID of the metaverse object</param> /// <returns>An enumeration of connector space objects</returns> public static IEnumerable <CSObject> GetConnectedCSObjects(Guid mvObjectId) { return(CSObject.GetConnectedCSObjectLinks(mvObjectId).Select(link => link.GetCSObject())); }
public CSObject GetCSObject(Guid id) { return(CSObject.GetCSObject(id)); }
/// <summary> /// Gets the connector space object referenced by this link /// </summary> /// <returns></returns> public CSObject GetCSObject() { return(CSObject.GetCSObject(this.ConnectorSpaceID)); }
public CSObject GetCSObject() { return(CSObject.GetCSObject(this.ID)); }