/// <summary> /// Sets a property on a concrete Aria event in combination with a PII (Personally Identifiable Information) type /// </summary> /// <param name="name">The name property</param> /// <param name="value">The value property</param> /// <param name="type">The PII type property</param> public void SetProperty(string name, string value, PiiType type) { m_eventProperties.Add(new AriaNative.EventProperty() { Name = name, Value = value ?? string.Empty, PiiOrValue = (long)type }); }
/// <summary> /// Sets a property on a concrete Aria event in combination with a PII (Personally Identifiable Information) type /// </summary> /// <param name="name">The name property</param> /// <param name="value">The value property</param> /// <param name="type">The PII type property</param> public void SetProperty(string name, string value, PiiType type) { #if !FEATURE_CORECLR m_eventProperties.SetProperty(name, value, ConvertPiiType(type)); #else #if PLATFORM_OSX AriaMacOS.SetStringPropertyWithPiiKind(m_eventProperties, name, value, (int)type); #endif #endif }
private Microsoft.Applications.Telemetry.PiiType ConvertPiiType(PiiType type) { switch (type) { case PiiType.Identity: return(Microsoft.Applications.Telemetry.PiiType.Identity); default: return(Microsoft.Applications.Telemetry.PiiType.None); } }
public static string GetPiiTypeDisplayName(PiiType piiType) { if (ms_PiiTypeDisplayNames != null) { return ms_PiiTypeDisplayNames[(int) piiType]; } string[] displayNames = new string[Enum.GetValues(typeof(PiiType)).Length]; displayNames[(int) PiiType.SocialSecurityNumber] = Resources.PIITYPE_SOCIALSECURITYNUMBER; displayNames[(int) PiiType.CreditCardNumber] = Resources.PIITYPE_CREDITCARDNUMBER; displayNames[(int) PiiType.NationalInsuranceNumber] = Resources.PIITYPE_NATIONALINSURANCENUMBER; // Make sure all the values are filled in for (int stringIndex = 0; stringIndex < displayNames.Length; ++stringIndex) { if (displayNames[stringIndex] == null) { string errorStr = string.Format(CultureInfo.CurrentCulture, "No display name exists for PII type \"{0}\"", ((PiiType) stringIndex)); Logger.LogError(errorStr); throw new InvalidOperationException(errorStr); } } ms_PiiTypeDisplayNames = new List<string>(displayNames); return displayNames[(int) piiType]; }