예제 #1
0
        private Report(string name, string description, ReportCategory category, string httpReference, ReportStateCheck stateCheck, params ReportAction[] actions)
        {
            this.Name          = name;
            this.Description   = description;
            this.Category      = category;
            this.HttpReference = httpReference;
            this.stateCheck    = stateCheck;
            this.Actions       = actions;

            // Handle a no description case. Should most of time not happen.
            if (string.IsNullOrEmpty(description))
            {
                if (string.IsNullOrEmpty(httpReference))
                {
                    this.Description = "No current information regarding this report is provided.\nIf you need support or help regarding this issue, talk to us on Discord: https://discord.gg/trail";
                }
                else
                {
                    this.Description = string.Format("More information about '{0}' exists at '{1}'\nUse the question mark '?' to enter the web page.", name, httpReference);
                }
            }
        }
예제 #2
0
        /// <summary>
        /// This will create and add a new report to the report system and be visible in the Report Window. Supports multiple actions and no action.
        /// </summary>
        /// <param name="name">Name of the report</param>
        /// <param name="description">Description to why this report exists and/or what Trail is doing behind the scenes.</param>
        /// <param name="category">Category the report should show up in. Category is a mask and can show up in multiple categories.</param>
        /// <param name="httpReference">A reference link to open a web page for the users to read more about the report.</param>
        /// <param name="stateCheck">A function to check whether to show or hide the report from the window.</param>
        /// <param name="actions">An array of potential actions to be made to hide the report.</param>
        public static Report Create(string name, string description, ReportCategory category, string httpReference, ReportStateCheck stateCheck, bool threaded, params ReportAction[] actions)
        {
            var report = new Report(name, description, category, httpReference, stateCheck, actions);

            report.Threaded = threaded;
            reports.Add(report);
            return(report);
        }
예제 #3
0
 /// <summary>
 /// This will create and add a new report to the report system and be visible in the Report Window. This will only have one action to fix the report.
 /// </summary>
 /// <param name="name">Name of the report</param>
 /// <param name="description">Description to why this report exists and/or what Trail is doing behind the scenes.</param>
 /// <param name="category">Category the report should show up in. Category is a mask and can show up in multiple categories.</param>
 /// <param name="httpReference">A reference link to open a web page for the users to read more about the report.</param>
 /// <param name="stateCheck">A function to check whether to show or hide the report from the window.</param>
 /// <param name="actionName">Action name, what the button should say in the report window.</param>
 /// <param name="callback">The callback of the action to fix the report.</param>
 public static Report Create(string name, string description, ReportCategory category, string httpReference, ReportStateCheck stateCheck, string actionName, ReportCallback callback, bool threaded)
 {
     return(Create(name, description, category, httpReference, stateCheck, threaded, new ReportAction(actionName, callback)));
 }
예제 #4
0
 /// <summary>
 /// This will create and add a new report to the report system and be visible in the Report Window.
 /// Without description and http reference, basically giving no information to the users.
 /// </summary>
 /// <param name="name">Name of the report</param>
 /// <param name="category">Category the report should show up in. Category is a mask and can show up in multiple categories.</param>
 /// <param name="stateCheck">A function to check whether to show or hide the report from the window.</param>
 /// <param name="actionName">Action name, what the button should say in the report window.</param>
 /// <param name="callback">The callback of the action to fix the report.</param>
 public static Report Create(string name, ReportCategory category, ReportStateCheck stateCheck, string actionName, ReportCallback callback, bool threaded)
 {
     return(Create(name, "", category, "", stateCheck, threaded, new ReportAction(actionName, callback)));
 }
예제 #5
0
 /// <summary>
 /// This will create and add a new report to the report system and be visible in the Report Window. This will only have one action to fix the report.
 /// </summary>
 /// <param name="name">Name of the report</param>
 /// <param name="category">Category the report should show up in. Category is a mask and can show up in multiple categories.</param>
 /// <param name="httpReference">A reference link to open a web page for the users to read more about the report.</param>
 /// <param name="stateCheck">A function to check whether to show or hide the report from the window.</param>
 /// <param name="actionName">Action name, what the button should say in the report window.</param>
 /// <param name="callback">The callback of the action to fix the report.</param>
 public static Report Create(string name, ReportCategory category, string httpReference, ReportStateCheck stateCheck, string actionName, ReportCallback callback)
 {
     return(Create(name, "", category, httpReference, stateCheck, new ReportAction(actionName, callback)));
 }
예제 #6
0
 /// <summary>
 /// This will create and add a new report to the report system and be visible in the Report Window.
 /// Without a http reference. The user won't be able to read more about this issue.
 /// </summary>
 /// <param name="name">Name of the report</param>
 /// <param name="description">Description to why this report exists and/or what Trail is doing behind the scenes.</param>
 /// <param name="category">Category the report should show up in. Category is a mask and can show up in multiple categories.</param>
 /// <param name="stateCheck">A function to check whether to show or hide the report from the window.</param>
 /// <param name="actionName">Action name, what the button should say in the report window.</param>
 /// <param name="callback">The callback of the action to fix the report.</param>
 public static Report Create(string name, string description, ReportCategory category, ReportStateCheck stateCheck, string actionName, ReportCallback callback)
 {
     return(Create(name, description, category, "", stateCheck, new ReportAction(actionName, callback)));
 }