Example #1
0
        /// <summary>
        ///     Check if the wanted tag is supported.
        /// </summary>
        /// <param name="context">Error context providing information to search through</param>
        public void Identify(TagIdentifierContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }


            context.AddIfFound("System.Web", "http");

            var orderNumber = context.AddIfFound("System.Web.Mvc", "asp.net-mvc");

            if (orderNumber != -1)
            {
                var propertyValue = context.GetPropertyValue("Assemblies", "System.Web.Mvc");
                if (!string.IsNullOrEmpty(propertyValue))
                {
                    var version = propertyValue.Substring(0, 1);
                    if (version != "0" && version != "1")
                    {
                        context.AddTag("asp.net-mvc-" + version, orderNumber);
                    }
                }

                context.AddTag("asp.net", 99);
            }

            orderNumber = context.AddIfFound("System.Web.Http.WebHost", "asp.net-web-api");
            if (orderNumber != -1)
            {
                var propertyValue = context.GetPropertyValue("Assemblies", "System.Web.Http.WebHost");
                if (!string.IsNullOrEmpty(propertyValue))
                {
                    var version = propertyValue.Substring(0, 1);
                    context.AddTag("asp.net-web-api-" + version, orderNumber);
                }

                context.AddTag("asp.net", 99);
            }
        }
        /// <summary>
        ///     Check if the wanted tag is supported.
        /// </summary>
        /// <param name="context">Error context providing information to search through</param>
        public void Identify(TagIdentifierContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            var propertyValue = context.GetPropertyValue("ExceptionProperties", "Message");

            if (propertyValue != null && propertyValue.Contains(".cshtml"))
            {
                context.AddTag("razor", 0);
            }
        }
        /// <summary>
        ///     Check if the wanted tag is supported.
        /// </summary>
        /// <param name="context">Error context providing information to search through</param>
        public void Identify(TagIdentifierContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            var orderNumber = context.AddIfFound("EntityFramework", "entity-framework");

            if (orderNumber != -1)
            {
                var propertyValue = context.GetPropertyValue("Assemblies", "entity-framework");
                if (!string.IsNullOrEmpty(propertyValue))
                {
                    context.AddTag("entity-framework-" + propertyValue.Substring(0, 1), orderNumber);
                }
            }
            var property2 = context.GetPropertyValue("Assemblies", "EntityFramework.SqlServer");

            if (property2 != null)
            {
                context.AddTag("sqlserver", 99);
            }
        }
        /// <inheritdoc />
        public void Identify(TagIdentifierContext context)
        {
            var name = GetVersionAssemblyName(context.ApplicationId);

            if (name == null)
            {
                return;
            }

            var version = context.GetPropertyValue("Assemblies", name);

            if (version != null)
            {
                context.AddTag("v" + version, 1);
            }
        }
        public void Identify(TagIdentifierContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            var property = context.GetPropertyValue("Assembly", "Microsoft.CSharp");

            if (property == null)
            {
                return;
            }

            context.AddTag("c#", 99);
            var pos = property.IndexOf(".");

            if (pos != -1)
            {
                context.AddTag("c#-" + property.Substring(pos + 1, 3), 99);
            }
        }