public boolean get(URIish uri, CredentialItem... items)throws UnsupportedCredentialItem {for (CredentialItem i : items) {if (i instanceof CredentialItem.Username) {((CredentialItem.Username) i).setValue(username);continue;}if (i instanceof CredentialItem.Password) {((CredentialItem.Password) i).setValue(password);continue;}if (i instanceof CredentialItem.StringType) {if (i.getPromptText().equals("Password: ")) { ((CredentialItem.StringType) i).setValue(new String(password));continue;}}throw new UnsupportedCredentialItem(uri, i.getClass().getName()+ ":" + i.getPromptText()); }return true;}
public override bool Get(URIish uri, params CredentialItem[] items){foreach (CredentialItem i in items){if (i is CredentialItem.Username){((CredentialItem.Username)i).SetValue(username);continue;}if (i is CredentialItem.Password){((CredentialItem.Password)i).SetValue(password);continue;}if (i is CredentialItem.StringType){if (i.GetPromptText().Equals("Password: ")){((CredentialItem.StringType)i).SetValue(new string(password));continue;}}throw new UnsupportedCredentialItem(uri, i.GetType().FullName + ":" + i.GetPromptText());}return true;}