/// <summary> /// An attribute should be added to the analyzed element. /// </summary> /// <param name="errorType">How the response should be indicated.</param> /// <param name="code">A reference code for the issue being highlighted. Can be left blank.</param> /// <param name="description">A description of the issue. This will be displayed in the Error List.</param> /// <param name="actionText">The text displayed in the quick action.</param> /// <param name="addAttributeName">The name for the attribute to be added by the quick action.</param> /// <param name="addAttributeValue">The value for the attribute to be added by the quick action.</param> /// <param name="moreInfoUrl">(Optional) The URL linked from the error code.</param> /// <param name="extendedMessage">(Optional) Additional explanatory information about why the error is displayed.</param> /// <returns>An AnalysisActions result.</returns> public static AnalysisActions AddAttribute(RapidXamlErrorType errorType, string code, string description, string actionText, string addAttributeName, string addAttributeValue, string moreInfoUrl, string extendedMessage = null) { var result = new AnalysisActions(); result.AddAttribute(errorType, code, description, actionText, addAttributeName, addAttributeValue, extendedMessage, moreInfoUrl); return(result); }
/// <summary> /// Include the addition of an attribute as part of another quick action. /// </summary> /// <param name="analysisActions">The object to add this action to.</param> /// <param name="addAttributeName">The name for the attribute to be added by the quick action.</param> /// <param name="addAttributeValue">The value for the attribute to be added by the quick action.</param> /// <returns>An AnalysisActions result.</returns> public static AnalysisActions AndAddAttribute(this AnalysisActions analysisActions, string addAttributeName, string addAttributeValue) { return(analysisActions.AddSupplementaryAction( new AnalysisAction { Action = ActionType.AddAttribute, Name = addAttributeName, Value = addAttributeValue, })); }
public static AnalysisActions OrAddAttribute(this AnalysisActions analysisActions, string actionText, string addAttributeName, string addAttributeValue) { return(analysisActions.AddAlternativeSuggestion( new AnalysisAction { Action = ActionType.AddAttribute, ActionText = actionText, Name = addAttributeName, Value = addAttributeValue, })); }
/// <summary> /// An attribute should be added to the analyzed element. /// </summary> /// <param name="analysisActions">The object to add this action to.</param> /// <param name="errorType">How the response should be indicated.</param> /// <param name="code">A reference code for the issue being highlighted. Can be left blank.</param> /// <param name="description">A description of the issue. This will be displayed in the Error List.</param> /// <param name="actionText">The text displayed in the quick action.</param> /// <param name="addAttributeName">The name for the attribute to be added by the quick action.</param> /// <param name="addAttributeValue">The value for the attribute to be added by the quick action.</param> /// <param name="extendedMessage">(Optional) Additional explanatory information about why the error is displayed.</param> /// <param name="moreInfoUrl">(Optional) The URL linked from the error code.</param> /// <returns>An AnalysisActions result.</returns> public static AnalysisActions AddAttribute(this AnalysisActions analysisActions, RapidXamlErrorType errorType, string code, string description, string actionText, string addAttributeName, string addAttributeValue, string extendedMessage = null, string moreInfoUrl = null) { var result = analysisActions; result.Actions.Add(new AnalysisAction { Action = ActionType.AddAttribute, Code = code, Description = description, ErrorType = errorType, ActionText = actionText, Name = addAttributeName, Value = addAttributeValue, ExtendedMessage = extendedMessage, MoreInfoUrl = moreInfoUrl, }); return(result); }
/// <summary> /// A required child element is missing from the analyzed element. /// </summary> /// <param name="analysisActions">The object to add this action to.</param> /// <param name="errorType">How the response should be indicated.</param> /// <param name="code">A reference code for the issue being highlighted. Can be left blank.</param> /// <param name="description">A description of the issue. This will be displayed in the Error List.</param> /// <param name="actionText">The text displayed in the quick action.</param> /// <param name="elementName">The name of the child element to add.</param> /// <param name="attributes">(Optional) a collection of names and values specifying attributes for the added element.</param> /// <param name="extendedMessage">(Optional) Additional explanatory information about why the error is displayed.</param> /// <param name="moreInfoUrl">(Optional) The URL linked from the error code.</param> /// <returns>An AnalysisActions result.</returns> public static AnalysisActions AddChild(this AnalysisActions analysisActions, RapidXamlErrorType errorType, string code, string description, string actionText, string elementName, List <(string name, string value)> attributes = null, string extendedMessage = null, string moreInfoUrl = null)