Exemplo n.º 1
0
 /// <summary>
 /// Create an instance of Summary Card
 /// </summary>
 /// <param name="status">Status(Critical,Warning,Info,Success,None) shown as icon in middle left card</param>
 /// <param name="title">Title for card,shown in top of card</param>
 /// <param name="message">Message of Summary card,shown in middle of card</param>
 /// <param name="description">Description of Summary card,shown in bottom of card</param>
 /// <param name="onClickActionLink">Link to detector(detectorId) or tool</param>
 /// <param name="onClickActionType">onClick Action Type for card</param>
 public SummaryCard(SummaryCardStatus status, string title, string message, string description, SummaryCardActionType onClickActionType = SummaryCardActionType.None, string onClickActionLink = null)
 {
     this.Status            = status;
     this.Message           = message;
     this.Description       = description;
     this.Title             = title;
     this.OnClickActionLink = onClickActionLink;
     this.OnClickActionType = onClickActionType;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Add a single summary card
        /// </summary>
        /// <param name="response">Response</param>
        /// <param name="status">SummaryCardStatus</param>
        /// <param name="title">Title</param>
        /// <param name="message">Message</param>
        /// <param name="description">Description</param>
        /// <param name="onClickActionLink">Link</param>
        /// <param name="onClickActionType">Action Type</param>
        /// <returns></returns>
        /// <example>
        /// This sample code shows how to use <see cref="AddSummaryCard"> method.
        /// <code>
        /// /// public async static Task<![CDATA[<Response>]]> Run(DataProviders dp, OperationContext cxt, Response res)
        ///{
        ///     res.AddSummaryCard(
        ///         SummaryCardStatus.Info
        ///         "Request and Errors",
        ///         "25",
        ///         "HTTP errors",
        ///         SummaryCardActionType.Detector,
        ///         "http4xx");
        ///}
        /// </code>
        /// </example>
        public static DiagnosticData AddSummaryCard(this Response response, SummaryCardStatus status, string title, string message, string description, SummaryCardActionType onClickActionType = SummaryCardActionType.None, string onClickActionLink = null)
        {
            var summaryCard = new SummaryCard(status, title, message, description, onClickActionType, onClickActionLink);

            return(AddSummaryCards(response, new List <SummaryCard> {
                summaryCard
            }));
        }