本文整理汇总了C#中Epi.View.GetPageByPosition方法的典型用法代码示例。如果您正苦于以下问题:C# View.GetPageByPosition方法的具体用法?C# View.GetPageByPosition怎么用?C# View.GetPageByPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Epi.View
的用法示例。
在下文中一共展示了View.GetPageByPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CopyPages
private void CopyPages(Epi.Epi2000.View sourceView, View destinationView)
{
try
{
foreach (Epi.Epi2000.Page sourcePage in sourceView.Pages)
{
string validatedName = string.Empty;
// To prevent oddly-named pages from being imported and later causing errors.
for (int i = 0; i < sourcePage.Name.Length; i++)
{
string viewChar = sourcePage.Name.Substring(i, 1);
Match m = Regex.Match(viewChar, "[A-Za-z0-9 .]");
if (m.Success)
{
validatedName = validatedName + viewChar;
}
}
foreach (Epi.Epi2000.Page page in sourceView.Pages)
{
if (page.Position != sourcePage.Position && page.Name.Equals(sourcePage.Name))
{
validatedName = validatedName + " " + (sourcePage.Position + 1).ToString();
break;
}
}
if (sourcePage.Name != validatedName)
{
Logger.Log(DateTime.Now + ": " + string.Format(SharedStrings.IMPORT_NOTIFICATION_PAGE_RENAME, sourcePage.Name, validatedName));
sourcePage.Name = validatedName;
// necessary to re-set the page name in the check code block to match the validatedName
// we just set in the above line of code
sourcePage.RebuildCheckCode(
sourceProject.Metadata.GetPageCheckCode(sourceView, sourcePage.Position), sourceView);
}
destinationView.CreatePage(sourcePage.Name, sourcePage.Position);
Page destinationPage = destinationView.GetPageByPosition(sourcePage.Position);
sourcePage.CopyTo(destinationPage);
CheckCode.Append(destinationPage.CheckCodeBefore);
destinationPage.CheckCodeBefore = "";
destinationPage.SaveToDb();
RaiseEventImportStatus(destinationPage.DisplayName);
CopyFields(destinationPage);
}
UpdateMirrorFields(destinationView);
}
catch (Exception ex)
{
throw ex;
}
}