/// <summary> /// Test for equality. /// </summary> public override bool Equals(object obj) { if ((obj == null) || (obj.GetType() != GetType())) { return(false); } LocalizedNameDescriptionPair localizedNameDescr = obj as LocalizedNameDescriptionPair; //PRESHARP:Parameter to this public method must be validated: A null-dereference can occur here. //This is a false positive as the checks above can gurantee no null dereference will occur #pragma warning disable 6506 return((String.CompareOrdinal(localizedNameDescr.Name, Name) == 0) && (String.CompareOrdinal(localizedNameDescr.Description, Description) == 0)); #pragma warning restore 6506 }
private void AddNameDescription(int localeId, LocalizedNameDescriptionPair nameDescription) { // the managed APIs treat Locale Id as int and the unmanaged ones as uint // we need to convert it back and force uint locId; checked { locId = (uint)localeId; } int hr = SafeNativeMethods.DRMSetNameAndDescription( _issuanceLicenseHandle, false, // true - means delete ; false - add locId, nameDescription.Name, nameDescription.Description); Errors.ThrowOnErrorCode(hr); }