本文整理汇总了C#中ITabContext.GetRequestContext方法的典型用法代码示例。如果您正苦于以下问题:C# ITabContext.GetRequestContext方法的具体用法?C# ITabContext.GetRequestContext怎么用?C# ITabContext.GetRequestContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITabContext
的用法示例。
在下文中一共展示了ITabContext.GetRequestContext方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetData
public override object GetData(ITabContext context)
{
TabSection plugin = Plugin.Create("No", "Started", "Duration", "Method", "Index", "Document", "Query");
var requestContext = context.GetRequestContext<HttpContextBase>();
List<RequestItem> items = RequestHandler.GetLogList(requestContext);
if (items ==null|| !items.Any())
return null;
int count = 0;
foreach (RequestItem item in items)
{
plugin.AddRow()
.Column(count++)
.Column(String.Format("{0:#,0}", item.Time.Subtract(requestContext.Timestamp).TotalMilliseconds))
.Column(item.Duration.HasValue
? String.Format("{0:#,0}", item.Duration.Value.TotalMilliseconds)
: null)
.Column(item.Method)
.Column(item.Index)
.Column(item.Document)
.Column(item.Query);
}
return plugin;
}
示例2: GetData
public override object GetData(ITabContext context)
{
var plugin = Plugin.Create("No", "Started", "Duration", "Command", "Parameters");
var requestContext = context.GetRequestContext<HttpContextBase>();
List<LogItem> items = LogItemHandler.GetLogList(requestContext);
if (items == null)
return plugin;
var count = 0;
foreach (var item in items)
{
plugin.AddRow()
.Column(count++)
.Column(String.Format("{0:#,0}", item.Time.Subtract(requestContext.Timestamp).TotalMilliseconds))
.Column(item.Duration.HasValue ? String.Format("{0:#,0}", item.Duration.Value.TotalMilliseconds) : null)
.Column(item.Command)
.Column(item.Params.Count > 0
? new[] { new object[] { "Name", "Type", "Value" } }.Concat(item.Params.Select(p => new object[]
{
p.Name,
p.Type,
p.Value,
}))
: null);
}
return plugin;
}
示例3: GetData
public override object GetData(ITabContext context)
{
var request = context.GetRequestContext<HttpContextBase>();
var mobile = request.Request["n0"] == null ? request.GetOverriddenBrowser().IsMobileDevice :
request.Request["n0"].StartsWith("Mobile", StringComparison.Ordinal);
var stateDisplayInfo = new StateDisplayInfo();
if (StateContext.State != null)
{
stateDisplayInfo.Page = GetCurrentPage(context, mobile);
stateDisplayInfo.Route = GetCurrentRoute(mobile);
stateDisplayInfo.Theme = GetCurrentTheme(context, mobile);
stateDisplayInfo.Masters = GetCurrentMasters(context, mobile);
}
return Canvas.Arrange(stateDisplayInfo);
}
示例4: GetData
public override object GetData(ITabContext context)
{
return context.GetRequestContext<HttpContextBase>().User;
}
示例5: GetData
public object GetData(ITabContext context) {
return GetData(context.GetRequestContext<HttpContextBase>());
}