void m_initialize(String findType, String findValue) { String cn; switch (findType.ToLower()) { case "name": cn = DsUtils.Find(_baseDsPath, DsUtils.PropCN, escapeChars(findValue)); break; case "displayname": cn = DsUtils.Find(_baseDsPath, DsUtils.PropDisplayName, findValue); break; case "oid": cn = DsUtils.Find(_baseDsPath, DsUtils.PropCertTemplateOid, findValue); break; default: throw new Exception("The value for 'findType' must be either 'Name', 'DisplayName' or 'OID'."); } if (String.IsNullOrWhiteSpace(cn)) { throw new ArgumentException("No certificate templates match search criteria."); } m_fillproperties(cn); }
void m_initialize(String findType, String findValue) { String cn = String.Empty; switch (findType.ToLower()) { case "name": cn = $"CN={escapeChars(findValue)},{_baseDsPath}"; break; case "displayname": cn = DsUtils.Find(_baseDsPath, DsUtils.PropDisplayName, findValue); break; case "oid": cn = DsUtils.Find(_baseDsPath, DsUtils.PropCertTemplateOid, findValue); break; default: throw new Exception("The value for 'findType' must be either 'Name', 'DisplayName' or 'OID'."); } m_fillproperties(cn); }