本文整理汇总了C#中PipelineArgs类的典型用法代码示例。如果您正苦于以下问题:C# PipelineArgs类的具体用法?C# PipelineArgs怎么用?C# PipelineArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PipelineArgs类属于命名空间,在下文中一共展示了PipelineArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetControllerFactory
protected virtual void SetControllerFactory(PipelineArgs args)
{
var kernelFactory = new NinjectKernelFactory();
var ninjectControllerFactory = new NinjectControllerFactory(kernelFactory.Create());
var sitecoreControllerFactory = new SitecoreControllers.SitecoreControllerFactory(ninjectControllerFactory);
ControllerBuilder.Current.SetControllerFactory(sitecoreControllerFactory);
}
示例2: Process
/// <summary>
/// Processes the specified arguments.
/// </summary>
/// <param name="args">The arguments.</param>
public virtual void Process(PipelineArgs args)
{
Assert.ArgumentNotNull(args, "args");
Order order = args.CustomData["order"] as Order;
if (order == null)
{
return;
}
BusinessCatalogSettings businnesCatalogSettings = Context.Entity.GetConfiguration<BusinessCatalogSettings>();
Item companyMasterData = Sitecore.Context.Database.SelectSingleItem(businnesCatalogSettings.CompanyMasterDataLink);
if (companyMasterData == null)
{
return;
}
string queryString = string.Format("orderid={0}&mode=mail", order.OrderNumber);
Item saleDepartment = companyMasterData.Children["Sale"];
var saleParams = new { Recipient = saleDepartment["Email"] };
IMail mailProvider = Context.Entity.Resolve<IMail>();
mailProvider.SendMail("Order Mail To Admin", saleParams, queryString);
}
示例3: Process
public void Process(PipelineArgs args)
{
if (Context.ClientPage.IsEvent)
{
return;
}
var current = HttpContext.Current;
if (current == null)
{
return;
}
var page = current.Handler as Page;
if (page == null)
{
return;
}
Assert.IsNotNull(page.Header, "Content Editor <head> tag is missing runat='value'");
var array = new [] { "/sitecore modules/Shell/MarkdownField/js/showdown.js" };
foreach (var text in array)
{
page.Header.Controls.Add(new LiteralControl("<script type='text/javascript' language='javascript' src='{0}'></script>".FormatWith(new object[]{ text })));
}
}
示例4: Process
/// <summary>
/// Processes the specified arguments.
/// </summary>
/// <param name="args">The arguments.</param>
public virtual void Process(PipelineArgs args)
{
Assert.ArgumentNotNull(args, "args");
ShoppingCart shoppingCart = Context.Entity.GetInstance<ShoppingCart>();
PaymentProvider paymentProvider = Context.Entity.Resolve<PaymentProvider>(shoppingCart.PaymentSystem.Code);
PaymentUrlResolver paymentUrlResolver = new PaymentUrlResolver();
PaymentArgs paymentArgs = new PaymentArgs
{
ShoppingCart = shoppingCart,
PaymentUrls = paymentUrlResolver.Resolve(),
};
StringBuilder description = new StringBuilder();
foreach (ShoppingCartLine shoppingCartLine in shoppingCart.ShoppingCartLines)
{
description.Append(shoppingCartLine.Product.Title);
description.Append(", ");
}
paymentArgs.Description = description.ToString().Trim().TrimEnd(',');
paymentProvider.Invoke(shoppingCart.PaymentSystem, paymentArgs);
args.AbortPipeline();
}
示例5: Process
public void Process(PipelineArgs args)
{
RouteTable.Routes.MapRoute(
name: "Feature.Accounts.Api",
url: "api/accounts/{action}",
defaults:new {controller = "Accounts"});
}
示例6: MapRoutes
protected virtual void MapRoutes(PipelineArgs args, RouteCollection routes)
{
var routeBase = Settings.GetSetting("Sitecore8.WebAPI.RouteBase", "api/");
routes.MapHttpRoute(
"ProductService-Get",
routeBase + "products/{id}",
new { controller = "Product", action = "Get" },
new { id = @"^\d+$" }
);
routes.MapHttpRoute(
"ProductService-GetAll",
routeBase + "products",
new { controller = "Product", action = "GetAll" }
);
routes.MapHttpRoute(
"TaxonomyService-GetCategories",
routeBase + "taxonomy/categories",
new { controller = "Taxonomy", action = "GetCategories" }
);
routes.MapHttpRoute(
"TaxonomyService-GetOptions",
routeBase + "taxonomy/categories/{parentID}",
new { controller = "Taxonomy", action = "GetOptions" }
);
routes.MapHttpRoute(
"TaxonomyService-TagItem",
routeBase + "taxonomy/tagItem/{itemID}",
new { controller = "Taxonomy", action = "TagItem" }
);
}
示例7: Process
public void Process(PipelineArgs args)
{
Assert.ArgumentNotNull((object)args, "args");
IInsertRenderingArgs insertRenderingArgs = args as IInsertRenderingArgs;
if (insertRenderingArgs == null)
return;
Item renderingItem = insertRenderingArgs.RenderingItem;
Assert.IsNotNull((object)renderingItem, "renderingItem");
string placeholderKey = insertRenderingArgs.PlaceholderKey;
Assert.IsNotNullOrEmpty(placeholderKey, "placeholderKey");
string lastPart = StringUtil.GetLastPart(placeholderKey, '/', placeholderKey);
string[] arrKey = lastPart.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
string lastPartKey = arrKey[0];
RenderingDefinition renderingDefinition = new RenderingDefinition()
{
ItemID = renderingItem.ID.ToString(),
Placeholder = lastPartKey
};
if (insertRenderingArgs.Datasource != null)
renderingDefinition.Datasource = insertRenderingArgs.Datasource.ID.ToString();
Assert.IsNotNull((object)insertRenderingArgs.Device, "device");
this.InsertRenderingAt(insertRenderingArgs.Device, renderingDefinition, insertRenderingArgs.Position, insertRenderingArgs.AllowedRenderingsIds, arrKey[1]);
insertRenderingArgs.Result = new RenderingReference(renderingDefinition, insertRenderingArgs.Language, insertRenderingArgs.ContentDatabase);
}
示例8: Process
public void Process(PipelineArgs args)
{
if (Tracker.IsActive && Tracker.Current.Contact.Identifiers.IdentificationLevel != ContactIdentificationLevel.Known)
{
Tracker.Current.Session.Identify(this.UserName);
}
}
示例9: Process
/// <summary>
/// Processes the specified args.
/// </summary>
/// <param name="args">The args.</param>
public void Process(PipelineArgs args)
{
IUnityContainer container = args.CustomData["UnityContainer"] as IUnityContainer;
ShopContextFactory factory = container.Resolve<ShopContextFactory>();
container.RegisterType<ContextSwitcherDataSourceBase, ContentContextSwitcherDataSource>(new InjectionConstructor(factory));
}
示例10: Process
public void Process(PipelineArgs args)
{
var servicesConfig = GlobalConfiguration.Configuration;
var container = new Container(new IoC.Registry());
servicesConfig.DependencyResolver = new StructureMapDependencyResolver(container);
}
示例11: Process
public void Process(PipelineArgs args)
{
if (Context.ClientPage.IsEvent)
{
return;
}
var context = HttpContext.Current;
if (context == null)
{
return;
}
var page = context.Handler as Page;
if (page == null)
{
return;
}
Assert.IsNotNull(page.Header, "Content Editor <head> tag is missing runat='value'");
var scripts = new[]
{
"/sitecore/shell/Controls/Lib/Scriptaculous/Scriptaculous.js",
"/sitecore/shell/Controls/Lib/Scriptaculous/builder.js",
"/sitecore/shell/Controls/Lib/Scriptaculous/effects.js",
"/sitecore/shell/Controls/Lib/Scriptaculous/dragdrop.js",
"/sitecore/shell/Controls/Lib/Scriptaculous/slider.js"
};
foreach (var script in scripts)
{
page.Header.Controls.Add(new LiteralControl("<script type='text/javascript' language='javascript' src='{0}'></script>".FormatWith(script)));
}
}
示例12: InitAuthenticationProvider
public virtual void InitAuthenticationProvider(PipelineArgs args)
{
AuthenticationManager.Provider.Name.Returns("mock");
var user = User.FromName(@"sitecore\Anonymous", false);
AuthenticationManager.Provider.GetActiveUser().Returns(user);
}
示例13: Process
public void Process(PipelineArgs args)
{
RouteTable.Routes.MapRoute("Feature.Accounts.Api", "api/accounts/{action}", new
{
controller = "Accounts"
});
}
示例14: Process
public void Process(PipelineArgs args)
{
RouteTable.Routes.MapRoute(
name: "Feature.Demo.Api",
url: "api/demo/{action}",
defaults: new { controller = "Demo" });
}
示例15: Process
public virtual void Process(PipelineArgs args)
{
if (PipelineRun != null)
{
PipelineRun(this, new PipelineRunEventArgs(this.PipelineName, args));
}
}