本文整理汇总了C#中Page.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Page.ToString方法的具体用法?C# Page.ToString怎么用?C# Page.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page
的用法示例。
在下文中一共展示了Page.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppendScript
/// <summary>
/// 向当前页面动态输出客户端脚本代码
/// </summary>
/// <param name="javascript">javascript脚本段</param>
/// <param name="page">Page类的实例</param>
/// <param name="afterForm">是否紧跟在<form>标记之后输出javascript脚本,如果不是则在</form>标记之前输出脚本代码</param>
public static void AppendScript(string javascript, Page page, bool afterForm)
{
if (afterForm)
{
page.ClientScript.RegisterClientScriptBlock(page.GetType(), page.ToString(), javascript);
}
else
{
page.ClientScript.RegisterStartupScript(page.GetType(), page.ToString(),javascript);
}
}
示例2: SetStep
private void SetStep(Page step, Action<PageControl> initializer)
{
_page = step;
var field = typeof(Page).GetField(step.ToString());
var attributes = field.GetCustomAttributes(typeof(PageAttribute), true);
var pageType = ((PageAttribute)attributes[0]).Type;
var page = (PageControl)Activator.CreateInstance(pageType);
if (initializer != null)
initializer(page);
page.Dock = DockStyle.Fill;
var currentControls = new ArrayList(Controls);
Controls.Add(page);
foreach (Control control in currentControls)
{
Controls.Remove(control);
control.Dispose();
}
AcceptButton = page.AcceptButton;
CancelButton = page.CancelButton;
if (IsHandleCreated)
{
var acceptButton = AcceptButton as Button;
if (acceptButton != null)
acceptButton.Focus();
else
page.SelectNextControl(page, true, true, true, false);
}
}
示例3: ReturnFriendlyDescription
public void ReturnFriendlyDescription()
{
var page = new Page(0, 100);
Assert.Equal("0 - 100", page.ToString());
}
示例4: GetPageIndex
public static int GetPageIndex(Page page)
{
Type type = page.GetType();
FieldInfo fi = type.GetField(page.ToString());
PageIndexAttribute[] attrs = fi.GetCustomAttributes(typeof(PageIndexAttribute), false) as PageIndexAttribute[];
return attrs[0].PageIndex;
}
示例5: GetAccessKey
public static string GetAccessKey(Page page)
{
Type type = page.GetType();
FieldInfo fi = type.GetField(page.ToString());
PageAccessKeyAttribute[] attrs = fi.GetCustomAttributes(typeof(PageAccessKeyAttribute), false) as PageAccessKeyAttribute[];
return attrs[0].AccessKey;
}