当前位置: 首页>>代码示例>>C#>>正文


C# PersistentEvent.GetUserIdentity方法代码示例

本文整理汇总了C#中Exceptionless.Core.Models.PersistentEvent.GetUserIdentity方法的典型用法代码示例。如果您正苦于以下问题:C# PersistentEvent.GetUserIdentity方法的具体用法?C# PersistentEvent.GetUserIdentity怎么用?C# PersistentEvent.GetUserIdentity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Exceptionless.Core.Models.PersistentEvent的用法示例。


在下文中一共展示了PersistentEvent.GetUserIdentity方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetEventSummaryData

        public override SummaryData GetEventSummaryData(PersistentEvent ev)
        {
            if (!ShouldHandle(ev))
                return null;

            var stackingTarget = ev.GetStackingTarget();
            if (stackingTarget?.Error == null)
                return null;

            var data = new Dictionary<string, object> { { "Id", ev.Id }, { "Message", ev.Message } };
            AddUserIdentitySummaryData(data, ev.GetUserIdentity());

            if (!String.IsNullOrEmpty(stackingTarget.Error.Type)) {
                data.Add("Type", stackingTarget.Error.Type.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Last());
                data.Add("TypeFullName", stackingTarget.Error.Type);
            }

            if (stackingTarget.Method != null) {
                data.Add("Method", stackingTarget.Method.Name);
                data.Add("MethodFullName", stackingTarget.Method.GetFullName());
            }

            var requestInfo = ev.GetRequestInfo();
            if (!String.IsNullOrEmpty(requestInfo?.Path))
                data.Add("Path", requestInfo.Path);

            return new SummaryData { TemplateKey = "event-error-summary", Data = data };
        }
开发者ID:yonglehou,项目名称:Exceptionless,代码行数:28,代码来源:20_ErrorFormattingPlugin.cs

示例2: GetEventSummaryData

        public override SummaryData GetEventSummaryData(PersistentEvent ev) {
            if (!ShouldHandle(ev))
                return null;
            
            dynamic data = new ExpandoObject();
            data.SessionId = ev.SessionId;

            if (ev.IsSessionStart()) {
                data.Value = ev.Value.GetValueOrDefault();

                DateTime? endTime = ev.GetSessionEndTime();
                if (endTime.HasValue)
                    data.SessionEnd = endTime;
            }

            var identity = ev.GetUserIdentity();
            if (identity != null) {
                if (!String.IsNullOrEmpty(identity.Identity))
                    data.Identity = identity.Identity;
                
                if (!String.IsNullOrEmpty(identity.Name))
                    data.Name = identity.Name;
            }

            return new SummaryData { TemplateKey = "event-session-summary", Data = data };
        }
开发者ID:jackswei,项目名称:Exceptionless,代码行数:26,代码来源:50_SessionFormattingPlugin.cs

示例3: GetEventSummaryData

        public override SummaryData GetEventSummaryData(PersistentEvent ev)
        {
            if (!ShouldHandle(ev))
                return null;

            var data = new Dictionary<string, object> { { "Source", ev.Source } };
            AddUserIdentitySummaryData(data, ev.GetUserIdentity());

            return new SummaryData { TemplateKey = "event-feature-summary", Data = data };
        }
开发者ID:yonglehou,项目名称:Exceptionless,代码行数:10,代码来源:40_UsageFormattingPlugin.cs

示例4: GetEventSummaryData

        public override SummaryData GetEventSummaryData(PersistentEvent ev)
        {
            var data = new Dictionary<string, object> {
                { "Message", GetStackTitle(ev) },
                { "Source", ev.Source },
                { "Type", ev.Type }
            };

            AddUserIdentitySummaryData(data, ev.GetUserIdentity());

            return new SummaryData { TemplateKey = "event-summary", Data = data };
        }
开发者ID:yonglehou,项目名称:Exceptionless,代码行数:12,代码来源:99_DefaultFormattingPlugin.cs

示例5: GetEventSummaryData

        public override SummaryData GetEventSummaryData(PersistentEvent ev)
        {
            if (!ShouldHandle(ev))
                return null;

            var data = new Dictionary<string, object> { { "SessionId", ev.GetSessionId() }, { "Type", ev.Type } };
            AddUserIdentitySummaryData(data, ev.GetUserIdentity());

            if (ev.IsSessionStart()) {
                data.Add("Value", ev.Value.GetValueOrDefault());

                DateTime? endTime = ev.GetSessionEndTime();
                if (endTime.HasValue)
                    data.Add("SessionEnd", endTime);
            }

            return new SummaryData { TemplateKey = "event-session-summary", Data = data };
        }
开发者ID:yonglehou,项目名称:Exceptionless,代码行数:18,代码来源:50_SessionFormattingPlugin.cs

示例6: GetEventSummaryData

        public override SummaryData GetEventSummaryData(PersistentEvent ev)
        {
            if (!ShouldHandle(ev))
                return null;

            var error = ev.GetSimpleError();
            if (error == null)
                return null;

            var data = new Dictionary<string, object> { { "Message", ev.Message } };
            AddUserIdentitySummaryData(data, ev.GetUserIdentity());

            if (!String.IsNullOrEmpty(error.Type)) {
                data.Add("Type", error.Type.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).Last());
                data.Add("TypeFullName", error.Type);
            }

            var requestInfo = ev.GetRequestInfo();
            if (!String.IsNullOrEmpty(requestInfo?.Path))
                data.Add("Path", requestInfo.Path);

            return new SummaryData { TemplateKey = "event-simple-summary", Data = data };
        }
开发者ID:yonglehou,项目名称:Exceptionless,代码行数:23,代码来源:10_SimpleErrorFormattingPlugin.cs

示例7: GetEventSummaryData

        public override SummaryData GetEventSummaryData(PersistentEvent ev)
        {
            if (!ShouldHandle(ev))
                return null;

            var data = new Dictionary<string, object> { { "Message", ev.Message } };
            AddUserIdentitySummaryData(data, ev.GetUserIdentity());

            if (!String.IsNullOrWhiteSpace(ev.Source)) {
                data.Add("Source", ev.Source);

                var parts = ev.Source.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
                if (parts.Length > 1 && !String.Equals(ev.Source, parts.Last()) && parts.All(p => p.IsValidIdentifier()))
                    data.Add("SourceShortName", parts.Last());
            }

            object temp;
            string level = ev.Data.TryGetValue(Event.KnownDataKeys.Level, out temp) ? temp as string : null;
            if (!String.IsNullOrWhiteSpace(level))
                data.Add("Level", level.Trim());

            return new SummaryData { TemplateKey = "event-log-summary", Data = data };
        }
开发者ID:yonglehou,项目名称:Exceptionless,代码行数:23,代码来源:60_LogFormattingPlugin.cs

示例8: GetHeartbeatAsync

        private async Task<HeartbeatResult> GetHeartbeatAsync(PersistentEvent sessionStart) {
            string sessionId = sessionStart.GetSessionId();
            if (!String.IsNullOrWhiteSpace(sessionId)) {
                var result = await GetLastHeartbeatActivityUtcAsync($"project:{sessionStart.ProjectId}:heartbeat:{sessionId.ToSHA1()}");
                if (result != null)
                    return result;
            }

            var user = sessionStart.GetUserIdentity();
            if (String.IsNullOrWhiteSpace(user?.Identity))
                return null;

            return await GetLastHeartbeatActivityUtcAsync($"project:{sessionStart.ProjectId}:heartbeat:{user.Identity.ToSHA1()}");
        }
开发者ID:yonglehou,项目名称:Exceptionless,代码行数:14,代码来源:CloseInactiveSessionsJob.cs


注:本文中的Exceptionless.Core.Models.PersistentEvent.GetUserIdentity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。