本文整理汇总了C#中DisplayType.CreateNewDisplay方法的典型用法代码示例。如果您正苦于以下问题:C# DisplayType.CreateNewDisplay方法的具体用法?C# DisplayType.CreateNewDisplay怎么用?C# DisplayType.CreateNewDisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DisplayType
的用法示例。
在下文中一共展示了DisplayType.CreateNewDisplay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreatePresentationWithBackgrounds
private bool CreatePresentationWithBackgrounds(PresentationInfo presentationInfo, BackgroundImageDescriptor[] descriptors, DisplayType selectedDisplay)
{
PresentationInfo pi;
string uniqueName = presentationInfo.UniqueName;
Presentation presentation = PresentationController.NewPresentation(presentationInfo.Name, presentationInfo.Author, descriptors.Count());
presentation.UniqueName = uniqueName;
presentation.Comment = presentationInfo.Comment;
for (int i = 0; i < presentation.SlideList.Count; i++)
{
Display display = selectedDisplay.CreateNewDisplay();
ActiveDisplay activeDisplay = display as ActiveDisplay;
if (activeDisplay != null)
{
activeDisplay.BackgroundImage = descriptors[i].Id;
presentation.SlideList[i].DisplayList.Add(activeDisplay);
}
}
pi = new PresentationInfo(presentation);
creatingPresentation = pi;
int[] labelNotExists;
if (CreatePresentationResult.Ok == DesignerClient.Instance.PresentationWorker.CreatePresentation(pi, out labelNotExists))
{
if (!DesignerClient.Instance.IsStandAlone)
{
if (!DesignerClient.Instance.PresentationWorker.AcquireLockForPresentation(pi.UniqueName, RequireLock.ForEdit))
{
MessageBoxExt.Show("Не удалось заблокировать созданный сценарий для редактирования!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
foreach (Slide slide in presentation.SlideList)
{
if (!DesignerClient.Instance.PresentationWorker.AcquireLockForSlide(pi.UniqueName, slide.Id, RequireLock.ForEdit))
{
MessageBoxExt.Show("Не удалось заблокировать созданную сцену для редактирования!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
}
pi = new PresentationInfoExt(pi, new LockingInfo(identity, RequireLock.ForEdit, new PresentationKey(pi.UniqueName)));
}
else
pi = new PresentationInfoExt(pi, null);
int[] notLockedSlide;
ResourceDescriptor[] notExists;
DeviceResourceDescriptor[] deviceResourceDescriptorsNotExists;
if (!DesignerClient.Instance.PresentationWorker.SaveSlideChanges(pi.UniqueName,
presentation.SlideList.ToArray(),
out notLockedSlide,
out notExists,
out
deviceResourceDescriptorsNotExists,
out labelNotExists))
{
MessageBoxExt.Show("Не удалось сохранить созданные сцены!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
if (!DesignerClient.Instance.IsStandAlone)
foreach (Slide slide in presentation.SlideList)
{
DesignerClient.Instance.PresentationWorker.ReleaseLockForSlide(pi.UniqueName, slide.Id);
}
ShowJustCreatedPresentation(pi);
}
else
MessageBoxExt.Show("Не удалось создать сценарий!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return true;
}