本文整理汇总了C#中WorkContext类的典型用法代码示例。如果您正苦于以下问题:C# WorkContext类的具体用法?C# WorkContext怎么用?C# WorkContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorkContext类属于命名空间,在下文中一共展示了WorkContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetLogOnUrl
public string GetLogOnUrl(WorkContext context)
{
var urlHelper = new UrlHelper(context.HttpContext.Request.RequestContext);
var returnUrl = context.HttpContext.Request.Url;
var redirectUrl = urlHelper.Action("RequestToken", "TwitterOAuth", new { Area = "RM.QuickLogOn.OAuth", ReturnUrl = returnUrl });
return redirectUrl;
}
开发者ID:omidam81,项目名称:Ver1.0,代码行数:7,代码来源:TwitterOAuthProvider.cs
示例2: DoFilterWork
protected sealed override void DoFilterWork(WorkContext work, IList<WorkFilter> filters, int thisFilterIndex)
{
if (m_BeforeMatches.Count>0)
foreach(var match in m_BeforeMatches.OrderedValues)
{
var matched = match.Make(work);
if (matched!=null)
{
DoBeforeWork(work, matched);
break;
}
}
this.InvokeNextWorker(work, filters, thisFilterIndex);
if (m_AfterMatches.Count>0)
foreach(var match in m_AfterMatches.OrderedValues)
{
var matched = match.Make(work);
if (matched!=null)
{
DoAfterWork(work, matched);
break;
}
}
}
开发者ID:vlapchenko,项目名称:nfx,代码行数:26,代码来源:BeforeAfterFilterBase.cs
示例3: DataMigrationNotificationProvider
public DataMigrationNotificationProvider(IDataMigrationManager dataMigrationManager, WorkContext workContext)
{
_dataMigrationManager = dataMigrationManager;
_workContext = workContext;
T = NullLocalizer.Instance;
}
开发者ID:stack72,项目名称:GiveCamp-London,代码行数:7,代码来源:DataMigrationNotificationProvider.cs
示例4: MissingSettingsBanner
public MissingSettingsBanner(IOrchardServices orchardServices, IWorkContextAccessor workContextAccessor)
{
_orchardServices = orchardServices;
_workContext = workContextAccessor.GetContext();
T = NullLocalizer.Instance;
}
开发者ID:fengweijp,项目名称:Orchard.Disqus,代码行数:7,代码来源:MissingSettingsBanner.cs
示例5: ThemedViewResultFilter
public ThemedViewResultFilter(IThemeManager themeManager, WorkContext workContext, ILayoutAwareViewEngine layoutAwareViewEngine)
{
_themeManager = themeManager;
_workContext = workContext;
_layoutAwareViewEngine = layoutAwareViewEngine;
Logger = NullLogger.Instance;
}
开发者ID:gokhandisikara,项目名称:Coevery-Framework,代码行数:7,代码来源:ThemedViewResultFilter.cs
示例6: GetAccessToken
public string GetAccessToken(WorkContext wc, string code, string returnUrl)
{
try
{
var part = wc.CurrentSite.As<FacebookSettingsPart>();
var clientId = part.ClientId;
var clientSecret = _oauthHelper.Decrypt(part.Record.EncryptedClientSecret);
var urlHelper = new UrlHelper(wc.HttpContext.Request.RequestContext);
var redirectUrl =
new Uri(wc.HttpContext.Request.Url,
urlHelper.Action("Auth", "FacebookOAuth", new { Area = "RM.QuickLogOn.OAuth" })).ToString();//, returnUrl = returnUrl
var url = string.Format(TokenRequestUrl, urlHelper.Encode(clientId), urlHelper.Encode(redirectUrl), urlHelper.Encode(clientSecret), urlHelper.Encode(code));
var wr = WebRequest.Create(url);
wr.Proxy = OAuthHelper.GetProxy();
wr.Method = "GET";
var wres = wr.GetResponse();
using (var stream = wres.GetResponseStream())
using (var sr = new StreamReader(stream))
{
var result = HttpUtility.ParseQueryString(sr.ReadToEnd());
return result["access_token"];
}
}
catch (Exception ex)
{
string error = OAuthHelper.ReadWebExceptionMessage(ex);
Logger.Error(ex, string.IsNullOrEmpty(error) ? ex.Message : error);
}
return null;
}
开发者ID:omidam81,项目名称:Ver1.0,代码行数:32,代码来源:FacebookOAuthService.cs
示例7: ProfilerFilter
public ProfilerFilter(WorkContext workContext, IAuthorizer authorizer, IShapeFactory shapeFactory, IProfilerService profiler)
{
this.workContext = workContext;
this.shapeFactory = shapeFactory;
this.authorizer = authorizer;
this.profiler = profiler;
}
开发者ID:bigfont,项目名称:CertifiedOverheadCrane,代码行数:7,代码来源:ProfilerFilter.cs
示例8: LayoutAwareViewEngine
public LayoutAwareViewEngine(IThemeAwareViewEngine themeAwareViewEngine, WorkContext workContext, IDisplayHelperFactory displayHelperFactory)
{
_themeAwareViewEngine = themeAwareViewEngine;
_workContext = workContext.AsMvcWorkContext();
_displayHelperFactory = displayHelperFactory;
Logger = NullLogger.Instance;
}
开发者ID:l1183479157,项目名称:RabbitHub,代码行数:8,代码来源:LayoutAwareViewEngine.cs
示例9: TemplatesFilter
public TemplatesFilter(
WorkContext workContext,
IAuthorizer authorizer,
IShapeFactory shapeFactory) {
_workContext = workContext;
_authorizer = authorizer;
_shapeFactory = shapeFactory;
}
开发者ID:RasterImage,项目名称:Orchard,代码行数:8,代码来源:TemplatesFilter.cs
示例10: AdminCultureSelectorFactory
public AdminCultureSelectorFactory(
IWorkContextAccessor workContextAccessor,
IShapeFactory shapeFactory,
ICultureManager cultureManager) {
_cultureManager = cultureManager;
_workContext = workContextAccessor.GetContext();
Shape = shapeFactory;
}
开发者ID:SunRobin2015,项目名称:RobinWithOrchard,代码行数:8,代码来源:AdminCultureSelectorFactory.cs
示例11: DoAfterWork
protected override void DoAfterWork(WorkContext work, JSONDataMap matched)
{
var txt = matched[VAR_ERROR].AsString();
if (txt.IsNotNullOrWhiteSpace())
throw new WaveException(txt);
else
work.Aborted = true;
}
开发者ID:vlapchenko,项目名称:nfx,代码行数:8,代码来源:StopFilter.cs
示例12: SetAuthenticatedUserForRequest
public bool SetAuthenticatedUserForRequest(HttpRequestMessage request, WorkContext workContext)
{
var membershipService = workContext.Resolve<IMembershipService>();
var authenticationService = workContext.Resolve<IAuthenticationService>();
var credentials = this.GetCredentials(request.Headers.Authorization);
var user = this.GetUserForCredentials(credentials, membershipService);
return this.SetAuthenticatedUserForRequest(user, authenticationService);
}
开发者ID:Xceno,项目名称:Xceno.CustomUsers,代码行数:9,代码来源:BasicAuthenticationService.cs
示例13: GetLogOnUrl
public string GetLogOnUrl(WorkContext context)
{
var urlHelper = new UrlHelper(context.HttpContext.Request.RequestContext);
var part = context.CurrentSite.As<FacebookSettingsPart>();
var clientId = part.ClientId;
var returnUrl = context.HttpContext.Request.Url;
var redirectUrl = new Uri(returnUrl, urlHelper.Action("Auth", "FacebookOAuth", new { Area = "RM.QuickLogOn.OAuth" })).ToString();//, returnUrl = returnUrl
return string.Format(Url, clientId, urlHelper.Encode(redirectUrl), urlHelper.Encode(returnUrl.ToString()));
}
开发者ID:omidam81,项目名称:Ver1.0,代码行数:9,代码来源:FacebookOAuthProvider.cs
示例14: DoBeforeWork
protected override void DoBeforeWork(WorkContext work, JSONDataMap matched)
{
work.Log(
matched[VAR_TYPE].AsEnum<MessageType>(MessageType.Info),
matched[VAR_TEXT].AsString(work.About),
matched[VAR_FROM].AsString("{0}.Before".Args(GetType().FullName)),
pars: matched.ToJSON(JSONWritingOptions.CompactASCII)
);
}
开发者ID:itadapter,项目名称:nfx,代码行数:9,代码来源:LoggingFilter.cs
示例15: InlineShapeFactory
public InlineShapeFactory(IAuthorizer authorizer,
IWorkContextAccessor workContextAccessor,
IShapeTableManager shapeTableManager,
IThemeManager themeManager) {
_authorizer = authorizer;
_shapeTableManager = shapeTableManager;
_themeManager = themeManager;
_workContext = workContextAccessor.GetContext();
}
开发者ID:Jetski5822,项目名称:Orchard.InlineEditing,代码行数:9,代码来源:InlineShapeFactory.cs
示例16: DoFilterWork
protected sealed override void DoFilterWork(WorkContext work, IList<WorkFilter> filters, int thisFilterIndex)
{
if (work.m_PortalFilter==null)
{
try
{
work.m_PortalFilter = this;
foreach(var match in m_PortalMatches.OrderedValues)
{
var matched = match.Make(work);
if (matched!=null)
{
var portalName = matched[VAR_PORTAL_NAME].AsString();
if (portalName.IsNotNullOrWhiteSpace())
{
var portal = PortalHub.Instance.Portals[portalName];
if (portal!=null && !portal.Offline)
{
work.m_Portal = portal;
work.m_PortalMatch = match;
work.m_PortalMatchedVars = matched;
}
break;
}
}
}
if (work.m_Portal==null)
{
var defaultPortal = PortalHub.Instance.DefaultOnline;
if (defaultPortal!=null)
{
work.m_Portal = defaultPortal;
}
}
if (Server.m_InstrumentationEnabled &&
work.m_Portal!=null &&
work.m_Portal.InstrumentationEnabled)
{
Server.m_Stat_PortalRequest.IncrementLong(work.m_Portal.Name);
}
this.InvokeNextWorker(work, filters, thisFilterIndex);
}
finally
{
work.m_PortalFilter = null;
work.m_Portal = null;
work.m_PortalMatch = null;
work.m_PortalMatchedVars = null;
work.PortalTheme = null;
}
}
else this.InvokeNextWorker(work, filters, thisFilterIndex);
}
开发者ID:vlapchenko,项目名称:nfx,代码行数:57,代码来源:PortalFilter.cs
示例17: TinyMceShapeDisplayEvent
public TinyMceShapeDisplayEvent(
ICacheManager cacheManager,
IVirtualPathProvider virtualPathProvider,
IWorkContextAccessor workContextAccessor,
ISignals signals) {
_signals = signals;
_cacheManager = cacheManager;
_virtualPathProvider = virtualPathProvider;
_workContext = workContextAccessor.GetContext();
}
开发者ID:SunRobin2015,项目名称:RobinWithOrchard,代码行数:10,代码来源:TinyMceShapeDisplayEvent.cs
示例18: ThemeAwareViewEngine
public ThemeAwareViewEngine(
WorkContext workContext,
IEnumerable<IViewEngineProvider> viewEngineProviders,
IConfiguredEnginesCache configuredEnginesCache) {
_workContext = workContext;
_viewEngineProviders = viewEngineProviders;
_configuredEnginesCache = configuredEnginesCache;
Logger = NullLogger.Instance;
}
开发者ID:wolfweb,项目名称:Ww,代码行数:10,代码来源:IThemeAwareViewEngine.cs
示例19: GetLogOnUrl
public string GetLogOnUrl(WorkContext context)
{
var urlHelper = new UrlHelper(context.HttpContext.Request.RequestContext);
var part = context.CurrentSite.As<LinkedInSettingsPart>();
var clientId = part.ClientId;
var returnUrl = context.HttpContext.Request.Url;
var redirectUrl = new Uri(returnUrl, urlHelper.Action("Auth", "LinkedInOAuth", new { Area = "RM.QuickLogOn.OAuth", ReturnUrl = returnUrl })).ToString();//
var state = Guid.NewGuid().ToString().Trim('{', '}');
return string.Format(Url, clientId, urlHelper.Encode(redirectUrl), state);
}
开发者ID:omidam81,项目名称:Ver1.0,代码行数:10,代码来源:LinkedInOAuthProvider.cs
示例20: Init
public void Init() {
var builder = new ContainerBuilder();
_workContext = new StubWorkContext();
builder.RegisterInstance(new StubCultureSelector("fr-CA")).As<ICultureSelector>();
builder.RegisterInstance(new StubHttpContext("~/"));
builder.RegisterInstance(_workContext);
builder.RegisterType<StubHttpContextAccessor>().As<IHttpContextAccessor>();
builder.RegisterType<CurrentCultureWorkContext>().As<IWorkContextStateProvider>();
_container = builder.Build();
_currentCultureStateProvider = _container.Resolve<IWorkContextStateProvider>();
}
开发者ID:SunRobin2015,项目名称:RobinWithOrchard,代码行数:11,代码来源:CurrentCultureWorkContextTests.cs
注:本文中的WorkContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论