This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class PaymentRequestPageViewModel extends ViewModelBase { | |
| repository = repositoryFactory.get(); | |
| paymentRequest: PaymentRequest; | |
| shippingOptions: PaymentShippingOption[]; | |
| totalPrice: number; | |
| constructor() { | |
| super(); | |
| this.initPayment(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class DataService | |
| { | |
| private readonly TelemetryClient _telemetryClient; | |
| private readonly IDictionary<string, int> _dic; | |
| public DataService() | |
| { | |
| _telemetryClient = new TelemetryClient(); | |
| _dic = new Dictionary<string, int>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [System.Web.Mvc.HttpPost] | |
| public ActionResult Register([FromBody]RegisterModel model) | |
| { | |
| var dic = new Dictionary<string, string>(); | |
| dic.Add("email", model.Email); | |
| dic.Add("name", model.Name); | |
| dic.Add("category", Session["selectedCategory"]?.ToString()); | |
| _telemetryClient.TrackEvent("Registration form entered event", dic); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public ActionResult Index() | |
| { | |
| var arr = new string[2]; | |
| try | |
| { | |
| arr[0] = "value 1"; | |
| arr[1] = "value 2"; | |
| arr[2] = "value 3"; | |
| var result = arr[3]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <TelemetryModules> | |
| <Add Type="Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule, Microsoft.AI.DependencyCollector" /> | |
| <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector"></Add> | |
| <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryModule, Microsoft.AI.PerfCounterCollector" /> | |
| <Add Type="Microsoft.ApplicationInsights.WindowsServer.DeveloperModeWithDebuggerAttachedTelemetryModule, Microsoft.AI.WindowsServer" /> | |
| <Add Type="Microsoft.ApplicationInsights.WindowsServer.UnhandledExceptionTelemetryModule, Microsoft.AI.WindowsServer" /> | |
| <Add Type="Microsoft.ApplicationInsights.WindowsServer.UnobservedExceptionTelemetryModule, Microsoft.AI.WindowsServer" /> | |
| <Add Type="Microsoft.ApplicationInsights.Web.RequestTrackingTelemetryModule, Microsoft.AI.Web"> | |
| <Handlers> | |
| <Add>System.Web.Handlers.TransferRequestHandler</Add> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class FilterConfig | |
| { | |
| public static void RegisterGlobalFilters(GlobalFilterCollection filters) | |
| { | |
| filters.Add(new ErrorHandler.AiHandleErrorAttribute()); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] | |
| public class AiHandleErrorAttribute : HandleErrorAttribute | |
| { | |
| public override void OnException(ExceptionContext filterContext) | |
| { | |
| if (filterContext != null && filterContext.HttpContext != null && filterContext.Exception != null) | |
| { | |
| if (filterContext.HttpContext.IsCustomErrorEnabled) | |
| { | |
| var ai = new TelemetryClient(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class NotFoundFilter : ITelemetryProcessor | |
| { | |
| private ITelemetryProcessor Next { get; set; } | |
| public NotFoundFilter(ITelemetryProcessor next) | |
| { | |
| this.Next = next; | |
| } | |
| public void Process(ITelemetry item) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Implements initialization logic. | |
| /// </summary> | |
| /// <param name="platformContext">Http context.</param> | |
| /// <param name="requestTelemetry">Request telemetry object associated with the current request.</param> | |
| /// <param name="telemetry">Telemetry item to initialize.</param> | |
| protected override void OnInitializeTelemetry(HttpContext platformContext, RequestTelemetry requestTelemetry, ITelemetry telemetry) | |
| { | |
| if (string.IsNullOrEmpty(telemetry.Context.Location.Ip)) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected void Application_Start() | |
| { | |
| AreaRegistration.RegisterAllAreas(); | |
| FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); | |
| RouteConfig.RegisterRoutes(RouteTable.Routes); | |
| BundleConfig.RegisterBundles(BundleTable.Bundles); | |
| TelemetryConfiguration.Active.TelemetryInitializers.Add(new ClientIpHeaderTelemetryInitializer()); | |
| var builder = TelemetryConfiguration.Active.TelemetryProcessorChainBuilder; |
NewerOlder