Permalink
Browse files

Minor refactoring of message names

  • Loading branch information...
1 parent 9d8af1c commit 39de566abb97fb89a9761db9d2bf890cccafc047 @avanderhoorn avanderhoorn committed Mar 25, 2013
@@ -133,7 +133,7 @@ public void BeginRequest()
var executionTimer = CreateAndStartGlobalExecutionTimer(requestStore);
- Configuration.MessageBroker.Publish(new RuntimeMessage().AsSourceMessage(typeof(GlimpseRuntime), MethodInfoBeginRequest).AsTimelineMessage("Start Request", TimelineMessage.Request).AsTimedMessage(executionTimer.Point()));
+ Configuration.MessageBroker.Publish(new RuntimeMessage().AsSourceMessage(typeof(GlimpseRuntime), MethodInfoBeginRequest).AsTimelineMessage("Start Request", TimelineCategory.Request).AsTimedMessage(executionTimer.Point()));
}
/// <summary>
@@ -154,7 +154,7 @@ public void BeginRequest()
var executionTimer = requestStore.Get<ExecutionTimer>(Constants.GlobalTimerKey);
if (executionTimer != null)
{
- Configuration.MessageBroker.Publish(new RuntimeMessage().AsSourceMessage(typeof(GlimpseRuntime), MethodInfoBeginRequest).AsTimelineMessage("End Request", TimelineMessage.Request).AsTimedMessage(executionTimer.Point()));
+ Configuration.MessageBroker.Publish(new RuntimeMessage().AsSourceMessage(typeof(GlimpseRuntime), MethodInfoBeginRequest).AsTimelineMessage("End Request", TimelineCategory.Request).AsTimedMessage(executionTimer.Point()));
}
ExecuteTabs(RuntimeEvent.EndRequest);
@@ -734,7 +734,7 @@ protected class RuntimeMessage : ITimelineMessage, ISourceMessage
/// <value>
/// The event category.
/// </value>
- public TimelineCategory EventCategory { get; set; }
+ public TimelineCategoryItem EventCategory { get; set; }
/// <summary>
/// Gets or sets the event sub text.
@@ -108,7 +108,7 @@
<Compile Include="System.cs" />
<Compile Include="Message\ISourceMessage.cs" />
<Compile Include="Message\ITraceMessage.cs" />
- <Compile Include="Message\TimelineCategory.cs" />
+ <Compile Include="Message\TimelineCategoryItem.cs" />
<Compile Include="Message\MessageBase.cs" />
<Compile Include="Extensibility\NuGetPackageAttribute.cs" />
<Compile Include="Extensibility\ResourceParameterMetadata.cs" />
@@ -192,7 +192,7 @@
<Compile Include="Message\IMessage.cs" />
<Compile Include="Message\ITimedMessage.cs" />
<Compile Include="Message\ITimelineMessage.cs" />
- <Compile Include="Message\TimelineMessage.cs" />
+ <Compile Include="Message\TimelineCategory.cs" />
<Compile Include="Message\TraceMessage.cs" />
<Compile Include="Model\TimelineCategoryModel.cs" />
<Compile Include="Model\TimelineEventModel.cs" />
@@ -6,14 +6,14 @@ public interface ITimelineMessage : ITimedMessage
{
string EventName { get; set; }
- TimelineCategory EventCategory { get; set; }
+ TimelineCategoryItem EventCategory { get; set; }
string EventSubText { get; set; }
}
public static class TimelineMessageExtension
{
- public static T AsTimelineMessage<T>(this T message, string eventName, TimelineCategory eventCategory, string eventSubText = null)
+ public static T AsTimelineMessage<T>(this T message, string eventName, TimelineCategoryItem eventCategory, string eventSubText = null)
where T : ITimelineMessage
{
message.EventName = eventName;
@@ -23,7 +23,7 @@ public static T AsTimelineMessage<T>(this T message, string eventName, TimelineC
return message;
}
- public static T AsTimelineMessage<T>(this T message, TimelineCategory eventCategory, string eventSubText = null)
+ public static T AsTimelineMessage<T>(this T message, TimelineCategoryItem eventCategory, string eventSubText = null)
where T : ITimelineMessage
{
message.AsTimelineMessage(string.Empty, eventCategory, eventSubText);
@@ -1,33 +1,27 @@
namespace Glimpse.Core.Message
{
/// <summary>
- /// Definition for a timeline category.
+ /// Options that can used for timeline events.
/// </summary>
public class TimelineCategory
{
- public TimelineCategory(string name, string color, string colorHighlight)
- {
- Name = name;
- Color = color;
- ColorHighlight = colorHighlight;
- }
-
- /// <summary>
- /// Gets or sets the name that will be displayed in the UI.
- /// </summary>
- /// <value>The name.</value>
- public string Name { get; set; }
+ private static TimelineCategoryItem request = new TimelineCategoryItem("Common", "#AF78DD", "#823BBE");
+ private static TimelineCategoryItem other = new TimelineCategoryItem("Other", "#EEEEEE", "#CCCCCC");
/// <summary>
- /// Gets or sets the main bar color.
+ /// Gets the timeline category for a request.
/// </summary>
- /// <value>The color.</value>
- public string Color { get; set; }
+ public static TimelineCategoryItem Request
+ {
+ get { return request; }
+ }
/// <summary>
- /// Gets or sets the main bar border color.
+ /// Gets the timeline category for a other events.
/// </summary>
- /// <value>The color highlight.</value>
- public string ColorHighlight { get; set; }
+ public static TimelineCategoryItem Other
+ {
+ get { return other; }
+ }
}
}
@@ -0,0 +1,33 @@
+namespace Glimpse.Core.Message
+{
+ /// <summary>
+ /// Definition for a timeline category.
+ /// </summary>
+ public class TimelineCategoryItem
+ {
+ public TimelineCategoryItem(string name, string color, string colorHighlight)
+ {
+ Name = name;
+ Color = color;
+ ColorHighlight = colorHighlight;
+ }
+
+ /// <summary>
+ /// Gets or sets the name that will be displayed in the UI.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the main bar color.
+ /// </summary>
+ /// <value>The color.</value>
+ public string Color { get; set; }
+
+ /// <summary>
+ /// Gets or sets the main bar border color.
+ /// </summary>
+ /// <value>The color highlight.</value>
+ public string ColorHighlight { get; set; }
+ }
+}
@@ -1,27 +0,0 @@
-namespace Glimpse.Core.Message
-{
- /// <summary>
- /// Options that can used for timeline events.
- /// </summary>
- public class TimelineMessage
- {
- private static TimelineCategory request = new TimelineCategory("Common", "#AF78DD", "#823BBE");
- private static TimelineCategory other = new TimelineCategory("Other", "#EEEEEE", "#CCCCCC");
-
- /// <summary>
- /// Gets the timeline category for a request.
- /// </summary>
- public static TimelineCategory Request
- {
- get { return request; }
- }
-
- /// <summary>
- /// Gets the timeline category for a other events.
- /// </summary>
- public static TimelineCategory Other
- {
- get { return other; }
- }
- }
-}
@@ -45,7 +45,7 @@ public override void PostImplementation(IAlternateMethodContext context, TimerRe
.AsChildActionMessage(actionContext.Controller)
.AsFilterMessage(FilterCategory.Action, actionContext.GetTypeOrNull())
.AsBoundedFilterMessage(FilterBounds.Executing)
- .AsMvcTimelineMessage(Glimpse.Mvc.Message.Timeline.Filter);
+ .AsMvcTimelineMessage(MvcTimelineCategory.Filter);
context.MessageBroker.Publish(message);
}
@@ -76,7 +76,7 @@ public class Message : MessageBase, IBoundedFilterMessage, IExecutionMessage
public string EventName { get; set; }
- public TimelineCategory EventCategory { get; set; }
+ public TimelineCategoryItem EventCategory { get; set; }
public string EventSubText { get; set; }
}
@@ -100,7 +100,7 @@ public override void PostImplementation(IAlternateMethodContext context, TimerRe
.AsBoundedFilterMessage(FilterBounds.Executed)
.AsCanceledFilterMessage(resultContext.Canceled)
.AsExceptionFilterMessage(resultContext.Exception.GetTypeOrNull(), resultContext.ExceptionHandled)
- .AsMvcTimelineMessage(Glimpse.Mvc.Message.Timeline.Filter);
+ .AsMvcTimelineMessage(MvcTimelineCategory.Filter);
context.MessageBroker.Publish(message);
}
@@ -137,7 +137,7 @@ public class Message : MessageBase, IExceptionFilterMessage, IBoundedFilterMessa
public string EventName { get; set; }
- public TimelineCategory EventCategory { get; set; }
+ public TimelineCategoryItem EventCategory { get; set; }
public string EventSubText { get; set; }
}
@@ -126,7 +126,7 @@ public override void PostImplementation(IAlternateMethodContext context, TimerRe
.AsSourceMessage(args.ActionResult.GetType(), executedMethod)
.AsChildActionMessage(args.ControllerContext)
.AsActionMessage(args.ControllerContext)
- .AsMvcTimelineMessage(Glimpse.Mvc.Message.Timeline.Controller);
+ .AsMvcTimelineMessage(MvcTimelineCategory.Controller);
context.MessageBroker.Publish(message);
}
@@ -162,7 +162,7 @@ public class Message : MessageBase, IExecutionMessage, IInvokeActionResultMessag
public string EventName { get; set; }
- public TimelineCategory EventCategory { get; set; }
+ public TimelineCategoryItem EventCategory { get; set; }
public string EventSubText { get; set; }
@@ -189,7 +189,7 @@ public override void PostImplementation(IAlternateMethodContext context, TimerRe
.AsSourceMessage(controllerDescriptor.ControllerType, controllerDescriptor.ControllerType.GetMethod(actionName, actionParams))
.AsChildActionMessage(args.ControllerContext)
.AsActionMessage(args.ControllerContext)
- .AsMvcTimelineMessage(Glimpse.Mvc.Message.Timeline.Controller);
+ .AsMvcTimelineMessage(MvcTimelineCategory.Controller);
context.MessageBroker.Publish(message);
}
@@ -246,7 +246,7 @@ public Message(Type resultType)
public string EventName { get; set; }
- public TimelineCategory EventCategory { get; set; }
+ public TimelineCategoryItem EventCategory { get; set; }
public string EventSubText { get; set; }
@@ -125,7 +125,7 @@ public void NewImplementation(IAlternateMethodContext context)
.AsSourceMessage(controllerDescriptor.ControllerType, controllerDescriptor.ControllerType.GetMethod(actionName, actionParams) ?? controllerDescriptor.ControllerType.GetMethod(actionName + "Async", actionParams))
.AsChildActionMessage(state.Arguments.ControllerContext)
.AsActionMessage(state.Arguments.ControllerContext)
- .AsMvcTimelineMessage(Glimpse.Mvc.Message.Timeline.Filter);
+ .AsMvcTimelineMessage(MvcTimelineCategory.Filter);
context.MessageBroker.Publish(message);
}
@@ -43,7 +43,7 @@ public override void PostImplementation(IAlternateMethodContext context, TimerRe
.AsActionMessage(authorizationContext.ActionDescriptor)
.AsChildActionMessage(authorizationContext.Controller)
.AsFilterMessage(FilterCategory.Authorization, authorizationContext.GetTypeOrNull())
- .AsMvcTimelineMessage(Glimpse.Mvc.Message.Timeline.Filter);
+ .AsMvcTimelineMessage(MvcTimelineCategory.Filter);
context.MessageBroker.Publish(message);
}
@@ -72,7 +72,7 @@ public class Message : MessageBase, IFilterMessage, IExecutionMessage
public string EventName { get; set; }
- public TimelineCategory EventCategory { get; set; }
+ public TimelineCategoryItem EventCategory { get; set; }
public string EventSubText { get; set; }
}
@@ -44,7 +44,7 @@ public override void PostImplementation(IAlternateMethodContext context, TimerRe
.AsChildActionMessage(exceptionContext.Controller)
.AsFilterMessage(FilterCategory.Exception, exceptionContext.GetTypeOrNull())
.AsExceptionFilterMessage(exceptionContext.Exception.GetTypeOrNull(), exceptionContext.ExceptionHandled)
- .AsMvcTimelineMessage(Glimpse.Mvc.Message.Timeline.Filter);
+ .AsMvcTimelineMessage(MvcTimelineCategory.Filter);
context.MessageBroker.Publish(message);
}
@@ -77,7 +77,7 @@ public class Message : MessageBase, IExceptionFilterMessage, IExecutionMessage
public string EventName { get; set; }
- public TimelineCategory EventCategory { get; set; }
+ public TimelineCategoryItem EventCategory { get; set; }
public string EventSubText { get; set; }
}
@@ -46,7 +46,7 @@ public override void PostImplementation(IAlternateMethodContext context, TimerRe
.AsFilterMessage(FilterCategory.Result, resultContext.GetTypeOrNull())
.AsBoundedFilterMessage(FilterBounds.Executing)
.AsCanceledFilterMessage(resultContext.Cancel)
- .AsMvcTimelineMessage(Glimpse.Mvc.Message.Timeline.Filter);
+ .AsMvcTimelineMessage(MvcTimelineCategory.Filter);
context.MessageBroker.Publish(message);
}
@@ -79,7 +79,7 @@ public class Message : MessageBase, IBoundedFilterMessage, ICanceledBasedFilterM
public string EventName { get; set; }
- public TimelineCategory EventCategory { get; set; }
+ public TimelineCategoryItem EventCategory { get; set; }
public string EventSubText { get; set; }
}
@@ -103,7 +103,7 @@ public override void PostImplementation(IAlternateMethodContext context, TimerRe
.AsBoundedFilterMessage(FilterBounds.Executed)
.AsCanceledFilterMessage(resultContext.Canceled)
.AsExceptionFilterMessage(resultContext.Exception.GetTypeOrNull(), resultContext.ExceptionHandled)
- .AsMvcTimelineMessage(Glimpse.Mvc.Message.Timeline.Filter);
+ .AsMvcTimelineMessage(MvcTimelineCategory.Filter);
context.MessageBroker.Publish(message);
}
@@ -140,7 +140,7 @@ public class Message : MessageBase, IExceptionFilterMessage, IBoundedFilterMessa
public string EventName { get; set; }
- public TimelineCategory EventCategory { get; set; }
+ public TimelineCategoryItem EventCategory { get; set; }
public string EventSubText { get; set; }
}
@@ -42,7 +42,7 @@ public override void PostImplementation(IAlternateMethodContext context, TimerRe
var message = new Message(args.ViewContext.ViewData.Model.GetTypeOrNull(), args.ViewContext.ViewData.ModelState.IsValid, args.ViewContext.TempData, args.ViewContext.ViewData, args.ViewContext.ViewData.ModelMetadata, context.TargetType, mixin)
.AsActionMessage(args.ViewContext.Controller)
.AsTimedMessage(timing)
- .AsMvcTimelineMessage(Glimpse.Mvc.Message.Timeline.View);
+ .AsMvcTimelineMessage(MvcTimelineCategory.View);
context.MessageBroker.Publish(message);
}
@@ -85,7 +85,7 @@ public Message(Type viewDataModelType, bool modelStateIsValid, IDictionary<strin
public string EventName { get; set; }
- public TimelineCategory EventCategory { get; set; }
+ public TimelineCategoryItem EventCategory { get; set; }
public string EventSubText { get; set; }
@@ -151,7 +151,7 @@ public Message(Guid id, string viewName, string masterName, bool useCache, IEnum
public Type DisplayModeType { get; set; }
- public TimelineCategory EventCategory { get; set; }
+ public TimelineCategoryItem EventCategory { get; set; }
public string EventSubText { get; set; }
@@ -97,7 +97,7 @@
<Compile Include="Message\IFilterMessage.cs" />
<Compile Include="Message\IInvokeActionResultMessage.cs" />
<Compile Include="Message\MvcTimelineExtension.cs" />
- <Compile Include="Message\Timeline.cs" />
+ <Compile Include="Message\MvcTimelineCategory.cs" />
<Compile Include="Model\DefaultValueModel.cs" />
<Compile Include="Model\ExecutionModel.cs" />
<Compile Include="Model\MetadataContentModel.cs" />
Oops, something went wrong.

0 comments on commit 39de566

Please sign in to comment.