本文整理汇总了C#中ComponentFactory.Krypton.Navigator.KryptonPage.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# KryptonPage.Dispose方法的具体用法?C# KryptonPage.Dispose怎么用?C# KryptonPage.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ComponentFactory.Krypton.Navigator.KryptonPage
的用法示例。
在下文中一共展示了KryptonPage.Dispose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PageDragStart
private void PageDragStart(Point pt)
{
if (DragPageNotify != null)
{
// Create a page that will be dragged
_dragPage = new KryptonPage();
_dragPage.Text = _dragNode.Text;
_dragPage.TextTitle = _dragNode.Text + " Title";
_dragPage.TextDescription = _dragNode.Text + " Description";
_dragPage.ImageSmall = ImageList.Images[int.Parse((string)_dragNode.Tag)];
_dragPage.Tag = _dragNode.Tag;
// Create a rich text box with some sample text inside
KryptonRichTextBox rtb = new KryptonRichTextBox();
rtb.Text = "This page (" + _dragPage.Text + ") contains a rich text box control as example content.";
rtb.Dock = DockStyle.Fill;
rtb.StateCommon.Border.Draw = InheritBool.False;
// Add rich text box as the contents of the page
_dragPage.Padding = new Padding(5);
_dragPage.Controls.Add(rtb);
// Give the notify interface a chance to reject the attempt to drag
PageDragCancelEventArgs de = new PageDragCancelEventArgs(PointToScreen(pt), Point.Empty, this, new KryptonPage[] { _dragPage });
DragPageNotify.PageDragStart(this, null, de);
if (de.Cancel)
{
// No longer need the temporary drag page
_dragPage.Dispose();
_dragPage = null;
}
else
{
_dragging = true;
Capture = true;
}
}
}
示例2: CloseMemoPage
private bool CloseMemoPage(KryptonPage page)
{
// We must have a page to actually close
if (page != null)
{
// If the page is dirty then we need to ask if it should be saved
if (page.Text.EndsWith("*"))
{
switch(MessageBox.Show("Do you want to save changes to '" + page.Text.TrimEnd('*') + "' ?",
"Memo Editor", MessageBoxButtons.YesNoCancel))
{
case DialogResult.Cancel:
// Returning true indicates the operation was cancelled
return true;
case DialogResult.Yes:
SaveMemoPage(page);
break;
case DialogResult.No:
break;
}
}
// Remove the page from the containing cell
KryptonWorkspaceCell cell = kryptonWorkspace.CellForPage(page);
cell.Pages.Remove(page);
page.Dispose();
UpdateApplicationTitle();
UpdateOptions();
}
// Returning false indicates the operation was not cancelled
return false;
}