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


C# IPage.GetType方法代码示例

本文整理汇总了C#中IPage.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IPage.GetType方法的具体用法?C# IPage.GetType怎么用?C# IPage.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPage的用法示例。


在下文中一共展示了IPage.GetType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: Create

        public PageStylesheetProjection Create(IPage page, IEnumerable<IOptionValue> options)
        {
            IStylesheetAccessor jsAccessor = null;
            Type pageType;
            if (page is IProxy)
            {
                pageType = page.GetType().BaseType;
            }
            else
            {
                pageType = page.GetType();
            }

            string key = "STYLESHEETRENDERER-" + pageType.Name.ToUpperInvariant();

            if (containerProvider.CurrentScope.IsRegisteredWithKey<IStylesheetAccessor>(key))
            {
                jsAccessor = containerProvider.CurrentScope
                    .ResolveKeyed<IStylesheetAccessor>(key, new Parameter[]
                                                             {
                                                                 new PositionalParameter(0, page),
                                                                 new PositionalParameter(1, options)
                                                             });
            }

            if (jsAccessor == null)
            {
                throw new CmsException(string.Format("No page style sheet accessor was found for the page type {0}.", pageType.FullName));
            }

            var jsProjection = new PageStylesheetProjection(page, jsAccessor);
            return jsProjection;
        }
开发者ID:wezmag,项目名称:BetterCMS,代码行数:33,代码来源:PageStylesheetProjectionFactory.cs

示例3: OnAppearing

		public virtual async Task OnAppearing(IPage CurrentPage)
		{
			if (this.CurrentPage == null || CurrentPage.GetType () != this.CurrentPage.GetType ()) {
				this.SetCurrentPage = CurrentPage;
			}

		}
开发者ID:ddomengeaux,项目名称:xamarin-amccorma,代码行数:7,代码来源:NavigationAwareViewModel.cs

示例4: OnNavigatingTo

		public virtual async Task OnNavigatingTo (IPage CurrentPage)
		{
			if (this.CurrentPage == null || CurrentPage.GetType () != this.CurrentPage.GetType ()) {
				this.SetCurrentPage = CurrentPage;
			}
		}
开发者ID:ddomengeaux,项目名称:xamarin-amccorma,代码行数:6,代码来源:NavigationAwareViewModel.cs

示例5: ResolveControllerName

        /// <summary>
        ///     Resolves the name of the controller.
        /// </summary>
        /// <param name="currentPage">The current page.</param>
        /// <returns></returns>
        /// <exception cref="System.NullReferenceException">Missing ContentType attribute</exception>
        protected string ResolveControllerName(IPage currentPage)
        {
            var contentTypeAttribute = currentPage.GetType().GetAttribute<ContentTypeAttribute>();

            if (contentTypeAttribute == null)
            {
                throw new NullReferenceException("Missing ContentType attribute");
            }

            return contentTypeAttribute.ControllerType == null
                ? currentPage.GetType().Name
                : this.ControllerMapper.GetControllerName(contentTypeAttribute.ControllerType);
        }
开发者ID:nwendel,项目名称:brickpile,代码行数:19,代码来源:DefaultRoute.cs

示例6: GetWriteablePage

 public IPage GetWriteablePage(ulong commitId, IPage page)
 {
     if (!CanWrite) throw new InvalidOperationException("Attempt to retrieve a writeable page from a read-only store");
     var p = page as BinaryFilePage;
     if (p == null)
     {
         throw new ArgumentException("Expected a BinaryFilePage instance. Received a " + page.GetType().FullName);
     }
     if (p.IsWriteable)
     {
         return p;
     }
     p.MakeWriteable(commitId);
     return p;
 }
开发者ID:GTuritto,项目名称:BrightstarDB,代码行数:15,代码来源:BinaryFilePageStore.cs


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