本文整理汇总了C#中PageType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# PageType.ToString方法的具体用法?C# PageType.ToString怎么用?C# PageType.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageType
的用法示例。
在下文中一共展示了PageType.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GoToPage
public void GoToPage(PageType pageType,bool force)
{
if(_currentPageType == pageType) if (!force) return; //we're already on the same page, so don't bother doing anything
Page pageToCreate = null;
Debug.Log(pageType.ToString());
Type type = Type.GetType(pageType.ToString());
object o=Activator.CreateInstance(type);
pageToCreate = (Page)o;
//pageToCreate = (TPage)(System.Reflection.Assembly.GetExecutingAssembly().CreateInstance(pageType.ToString()));
if(pageToCreate != null) //destroy the old page and create a new one
{
_currentPageType = pageType;
if(_currentPage != null)
{
_stage.RemoveChild(_currentPage);
}
_currentPage = pageToCreate;
_stage.AddChild(_currentPage);
_currentPage.Start();
}
}
示例2: GetPageTypeName
public static string GetPageTypeName( PageType type )
{
if( type == PageType.GeneralQuestion )
return "General Question";
return type.ToString();
}
示例3: GetPageConfigurations
public List<PageConfiguration> GetPageConfigurations(PageType pageType)
{
var page = pageType.ToString();
using(_entities = new DBEntities())
{
return _entities.PageConfigurations.Where(p => p.Page == page).ToList();
}
}
示例4: GetPageTypeName
public static string GetPageTypeName( PageType type )
{
if ( type == PageType.VerbalHarassment )
return "Verbal Harassment";
else if ( type == PageType.PhysicalHarassment )
return "Physical Harassment";
else
return type.ToString();
}
示例5: GetPageType
private Type GetPageType(PageType pageType)
{
switch (pageType)
{
case PageType.SelectService:
return typeof(SelectServicePage);
case PageType.SelectRequestType:
return typeof(SelectRequestTypePage);
case PageType.SelectRequestDate:
return typeof(SelectRequestDatePage);
case PageType.SetUsername:
return typeof(SetClientPage);
case PageType.SelectSubjects:
return typeof(SelectSubjectsPage);
case PageType.SearchService:
return typeof(SearchServicePage);
case PageType.PrintCoupon:
return typeof(PrintCouponPage);
default:
throw new ApplicationException("Неизвестная страница: " + pageType.ToString());
}
}
示例6: GetIDByType
public static Guid GetIDByType(PageType contentType)
{
ContentPageType _type = ContentPageTypeList.Where(t => t.ContentTypeValue.ToLowerInvariant() == contentType.ToString().ToLowerInvariant()).FirstOrDefault();
return _type.ContentTypeID;
}