本文整理汇总了C#中IPage类的典型用法代码示例。如果您正苦于以下问题:C# IPage类的具体用法?C# IPage怎么用?C# IPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPage类属于命名空间,在下文中一共展示了IPage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
/// <summary>
/// Renders an action projection to given html output.
/// </summary>
/// <param name="page">The page.</param>
/// <param name="securityService"></param>
/// <param name="html">The html helper.</param>
/// <returns><c>true</c> on success, otherwise <c>false</c>.</returns>
public override bool Render(IPage page, ISecurityService securityService, HtmlHelper html)
{
if (AccessRole != null && !securityService.IsAuthorized(AccessRole))
{
return false;
}
using (HtmlControlRenderer control = new HtmlControlRenderer(Tag))
{
OnPreRender(control, page, html);
using (HtmlTextWriter writer = new HtmlTextWriter(html.ViewContext.Writer))
{
control.RenderBeginTag(writer);
if (ChildProjections != null)
{
foreach (var htmlElementProjection in ChildProjections.OrderBy(f => f.Order))
{
htmlElementProjection.Render(page, securityService, html);
}
}
control.RenderEndTag(writer);
}
}
return true;
}
示例2: PagingParams
public PagingParams(IPage url)
{
PageNumber = url.PageNumber ?? 1;
PageSize = url.PageSize ?? 50;
SortColumn = url.SortColumn;
SortOrder = string.IsNullOrWhiteSpace(url.SortOrder) ? "asc" : url.SortOrder;
}
示例3: GetThumbnailForPage
/// <summary>
/// Currently used by the image server
/// to get thumbnails that are used in the add page dialog. Since this dialog can show
/// an enlarged version of the page, we generate these at a higher resolution than usual.
/// Also, to make more realistic views of template pages we insert fake text wherever
/// there is an empty edit block.
///
/// The result is cached for possible future use so the caller should not dispose of it.
/// </summary>
/// <param name="book"></param>
/// <param name="page"></param>
/// <param name="isLandscape"></param>
/// <returns></returns>
public Image GetThumbnailForPage(Book.Book book, IPage page, bool isLandscape)
{
var pageDom = book.GetThumbnailXmlDocumentForPage(page);
var thumbnailOptions = new HtmlThumbNailer.ThumbnailOptions()
{
BackgroundColor = Color.White,// matches the hand-made previews.
BorderStyle = HtmlThumbNailer.ThumbnailOptions.BorderStyles.None, // allows the HTML to add its preferred border in the larger preview
CenterImageUsingTransparentPadding = true
};
var pageDiv = pageDom.RawDom.SafeSelectNodes("descendant-or-self::div[contains(@class,'bloom-page')]").Cast<XmlElement>().FirstOrDefault();
// The actual page size is rather arbitrary, but we want the right ratio for A4.
// Using the actual A4 sizes in mm makes a big enough image to look good in the larger
// preview box on the right as well as giving exactly the ratio we want.
// We need to make the image the right shape to avoid some sort of shadow/box effects
// that I can't otherwise find a way to get rid of.
if (isLandscape)
{
thumbnailOptions.Width = 297;
thumbnailOptions.Height = 210;
pageDiv.SetAttribute("class", pageDiv.Attributes["class"].Value.Replace("Portrait", "Landscape"));
}
else
{
thumbnailOptions.Width = 210;
thumbnailOptions.Height = 297;
// On the offchance someone makes a template with by-default-landscape pages...
pageDiv.SetAttribute("class", pageDiv.Attributes["class"].Value.Replace("Landscape", "Portrait"));
}
// In different books (or even the same one) in the same session we may have portrait and landscape
// versions of the same template page. So we must use different IDs.
return _thumbnailProvider.GetThumbnail(page.Id + (isLandscape ? "L" : ""), pageDom, thumbnailOptions);
}
示例4: ChangePage
public void ChangePage(IPage page)
{
if (token != null)
CurrentPage = page;
else
CurrentPage = new LoginVM();
}
示例5: GetCacheKey
private static string GetCacheKey(IPage page)
{
var dataSourceId = page.DataSourceId;
string localizationInfo = dataSourceId.LocaleScope.ToString();
string dataScope = dataSourceId.DataScopeIdentifier.Name;
return page.Id + dataScope + localizationInfo;
}
示例6: GeneralViewModel
public GeneralViewModel(INavigator navigator,
IServicioMovil servicio,IPage page)
{
_navigator = navigator;
_servicio = servicio;
_page = page;
}
示例7: PageSelected
/// <summary>
/// Pages the selected.
/// </summary>
/// <param name="page">
/// The <c>page</c>.
/// </param>
private void PageSelected(IPage page)
{
if (page != null)
{
ShowPage(page);
}
}
示例8: TryFindPage
public bool TryFindPage(string Url, out IPage page)
{
var serializer = new XmlSerializer(typeof(Page));
page = null;
//Create WCF Client
using (var client = new TridionBrokerServiceClient())
{
//Create XML Document to hold Xml returned from WCF Client
var pageContent = new XmlDocument();
pageContent.LoadXml(client.FindPageByUrl(PublicationId, Url));
//Load XML into Reader for deserialization
using (var reader = new XmlNodeReader(pageContent.DocumentElement))
{
try
{
page = (IPage)serializer.Deserialize(reader);
LoadComponentModelsFromComponentFactory(page);
return true;
}
catch (Exception)
{
//return false;
//throw new FieldHasNoValueException();
}
}
}
return false;
}
示例9: LoginViewModel
public LoginViewModel(INavigator navigator, IServicioMovil servicio, IPage page) :
base(navigator, servicio, page)
{
Usuario = new UsuarioModel();
cmdLogin = new Command(RunLogin);
cmdAlta = new Command(RunAlta);
}
示例10: NuevaTareaViewModel
public NuevaTareaViewModel(INavigator navigator, IServicioDatos servicioDatos, Session session, IPage page) : base(navigator, servicioDatos, session, page)
{
_tarea = new TareaModel();
CmdAgregar = new Command(Agregar);
CmdAgregarUbicacion = new Command(AgregarUbicacion);
CmdAgregarImagen = new Command(AgregarImagen);
}
示例11: BuildPage
static void BuildPage(IPage page, XmlNode parent, XmlDocument doc)
{
XmlNode pagenode = doc.CreateElement("page");
parent.AppendChild(pagenode);
XmlNode titlenode = doc.CreateElement("title");
titlenode.AppendChild(doc.CreateTextNode(page.Title));
pagenode.AppendChild(titlenode);
XmlNode textnode = doc.CreateElement("text");
textnode.AppendChild(doc.CreateTextNode(page.Text));
pagenode.AppendChild(textnode);
XmlNode iconnode = doc.CreateElement("icon");
iconnode.AppendChild(doc.CreateTextNode(page.Icon));
pagenode.AppendChild(iconnode);
XmlNode rendermodenode = doc.CreateElement("rendermode");
rendermodenode.AppendChild(doc.CreateTextNode(page.RenderMode));
pagenode.AppendChild(rendermodenode);
XmlNode itemsnode = doc.CreateElement("items");
pagenode.AppendChild(itemsnode);
for (int j = 0; j < page.Items.Count; j++)
BuildIItem(page, doc, itemsnode, page.Items[j], "item");
XmlNode actionsnode = doc.CreateElement("actions");
pagenode.AppendChild(actionsnode);
for (int j = 0; j < page.Actions.Count; j++)
BuildIItem(page, doc, actionsnode, page.Actions[j], "action");
}
示例12: PageCopyAndConnectJob
public PageCopyAndConnectJob(IPage page, ILinkElement linkElement, PageCopyAndConnectFlags flags)
: base(page.Project)
{
PageToCopy = page;
ConnectionTarget = linkElement;
_flags = flags;
}
示例13: ControlConsole
public ControlConsole(ContentManager Content)
{
this.Texture = Content.Load<Texture2D>("Main");
this.overlay = Content.Load<Texture2D>("SlotBG");
name = "Mainframe";
activePage = this;
temp = new CriticalStat("Temp", 60, -0.001F, new Vector2(178, 246), Content.Load<SpriteFont>("MS Quartz"));
dist = new CriticalStat("Distance", 1000000, 1, Vector2.Zero, Content.Load<SpriteFont>("MS Quartz"));
power = new PowerBoard(Content);
vent = new VentBoard(Content);
DebugMode.vBoard = vent;
o2 = new O2Board(Content);
DebugMode.oBoard = o2;
man = new Manual(Content);
term = new Terminal(Content.Load<SpriteFont>("TerminalFont"),
Content.Load<Texture2D>("CompCons"), Content.Load<Texture2D>("Darkness"), o2, ">>");
allPages = new Dictionary<Rectangle, IPage>();
allPages.Add(powerRect, power);
allPages.Add(ventRect, vent);
allPages.Add(lmcRect, term);
allPages.Add(o2Rect, o2);
allPages.Add(manRect, man);
}
示例14: NuevoGrupoViewModel
public NuevoGrupoViewModel(INavigator navigator, IServicioDatos servicioDatos, Session session, IPage page) : base(navigator, servicioDatos, session, page)
{
_grupo = new GrupoModel();
CmdAgregar = new Command(Agregar);
CmdAgregarImagen = new Command(AgregarImagen);
MessagingCenter.Send(this, "Hola");
}
示例15: Create
public PageJavaScriptProjection Create(IPage page)
{
IJavaScriptAccessor jsAccessor = null;
Type pageType;
if (page is IProxy)
{
pageType = page.GetType().BaseType;
}
else
{
pageType = page.GetType();
}
string key = "JAVASCRIPTRENDERER-" + pageType.Name.ToUpperInvariant();
if (containerProvider.CurrentScope.IsRegisteredWithKey<IJavaScriptAccessor>(key))
{
jsAccessor = containerProvider.CurrentScope
.ResolveKeyed<IJavaScriptAccessor>(key, new Parameter[]
{
new PositionalParameter(0, page)
});
}
if (jsAccessor == null)
{
throw new CmsException(string.Format("No page javascript accessor was found for the page type {0}.", pageType.FullName));
}
var jsProjection = new PageJavaScriptProjection(page, jsAccessor);
return jsProjection;
}