当前位置: 首页>>代码示例>>C#>>正文


C# IPage类代码示例

本文整理汇总了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;
        }
开发者ID:Steinerd,项目名称:BetterCMS,代码行数:36,代码来源:InheriteProjection.cs

示例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;
 }
开发者ID:RHMGLtd,项目名称:sourcecode,代码行数:7,代码来源:PagingParams.cs

示例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);
 }
开发者ID:BloomBooks,项目名称:BloomDesktop,代码行数:45,代码来源:BookThumbNailer.cs

示例4: ChangePage

 public void ChangePage(IPage page)
 {
     if (token != null)
         CurrentPage = page;
     else
         CurrentPage = new LoginVM();
 }
开发者ID:devalacarte,项目名称:kassysteem_nmct,代码行数:7,代码来源:ApplicationVM.cs

示例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;
 }
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:7,代码来源:PageRenderingHistory.cs

示例6: GeneralViewModel

 public GeneralViewModel(INavigator navigator, 
     IServicioMovil servicio,IPage page)
 {
     _navigator = navigator;
     _servicio = servicio;
     _page = page;
 }
开发者ID:cristajamar,项目名称:RedContactos2,代码行数:7,代码来源:GeneralViewModel.cs

示例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);
     }
 }
开发者ID:jamsoft,项目名称:WPF-Prism-Demo-Part1,代码行数:13,代码来源:MainRegionController.cs

示例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;
        }
开发者ID:albertromkes,项目名称:TridionMVCDotNet,代码行数:31,代码来源:WebServicePageFactory.cs

示例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);
 }
开发者ID:paulLozano90,项目名称:RedContactos,代码行数:7,代码来源:LoginViewModel.cs

示例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);
 }
开发者ID:FranLsz,项目名称:GestionDeTareasXamarin,代码行数:7,代码来源:NuevaTareaViewModel.cs

示例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");
        }
开发者ID:possan,项目名称:randomjunk,代码行数:33,代码来源:PageSerializer.cs

示例12: PageCopyAndConnectJob

 public PageCopyAndConnectJob(IPage page, ILinkElement linkElement, PageCopyAndConnectFlags flags)
     : base(page.Project)
 {
     PageToCopy = page;
     ConnectionTarget = linkElement;
     _flags = flags;
 }
开发者ID:erminas,项目名称:smartapi,代码行数:7,代码来源:IPageCopyAndConnectJob.cs

示例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);
        }
开发者ID:Evangielis,项目名称:TheAssembler,代码行数:26,代码来源:ControlConsole.cs

示例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");
 }
开发者ID:FranLsz,项目名称:GestionDeTareasXamarin,代码行数:7,代码来源:NuevoGrupoViewModel.cs

示例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;
        }
开发者ID:tkirda,项目名称:BetterCMS,代码行数:32,代码来源:PageJavaScriptProjectionFactory.cs


注:本文中的IPage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。