本文整理汇总了C#中AvalonDock.DocumentContent.Activate方法的典型用法代码示例。如果您正苦于以下问题:C# DocumentContent.Activate方法的具体用法?C# DocumentContent.Activate怎么用?C# DocumentContent.Activate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AvalonDock.DocumentContent
的用法示例。
在下文中一共展示了DocumentContent.Activate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NewEditor
public IEditor NewEditor()
{
DocumentContent document = new DocumentContent();
Editor editor = new Editor(document);
document.Show(manager);
document.Activate();
return editor;
}
示例2: ShowDocument
public static void ShowDocument(DocumentContent doc, bool floating)
{
doc.Show(DockingManager, floating);
doc.Activate();
}
示例3: ExportLayoutToDocument
private void ExportLayoutToDocument(object sender, RoutedEventArgs e)
{
DocumentContent doc = new DocumentContent()
{
Title = string.Format("Layout_{0}", DateTime.Now.ToString()),
Content = new TextBox()
{
AcceptsReturn = true,
VerticalScrollBarVisibility = ScrollBarVisibility.Auto,
HorizontalScrollBarVisibility = ScrollBarVisibility.Auto,
Text = DockManager.LayoutToString()
}
};
doc.Show(DockManager);
doc.Activate();
}
示例4: CreateEditorTab
/// <summary>
/// Creates a new tab for the editor
/// </summary>
/// <param name="file">File path (possibly empty)</param>
private void CreateEditorTab(string file = "")
{
// create new syntax highlight box
var info = new DocumentInfo();
var shbox = new SyntaxHighlightBox.SyntaxHighlightBox();
shbox.CurrentHighlighter = SyntaxHighlightBox.HighlighterManager.Instance.Highlighters["Mirelle"];
// create a new tab
var newdoc = new DocumentContent();
newdoc.Content = shbox;
if (file == "")
{
// mark tab as 'untitled'
newdoc.Title = Editor.Resources.Untitled + " " + UntitledCount.ToString();
UntitledCount++;
}
else
{
// load file into tab
try
{
var fi = new FileInfo(file);
info.FullPath = file;
newdoc.Title = info.Name = fi.Name;
var sr = fi.OpenText();
shbox.Text = sr.ReadToEnd().Replace("\t", " ");
shbox.Redraw();
sr.Close();
}
catch
{
Error(String.Format(Editor.Resources.FileNotFound, file));
return;
}
}
newdoc.Closing += (s, e) =>
{
// check for interface being disabled
if (DisableInterface)
{
e.Cancel = true;
return;
}
// check if there's need to saves
var docinfo = Documents[s as DocumentContent];
if (info.Modified)
{
var result = MessageBox.Show(Editor.Resources.SourceModified, Editor.Resources.Caption, MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
if (result == MessageBoxResult.Cancel)
e.Cancel = true;
}
if (!e.Cancel)
Documents.Remove((DocumentContent)s);
};
shbox.TextChanged += (s, e) =>
{
var dc = docContent.SelectedItem as DocumentContent;
if (!Documents[dc].Modified)
{
Documents[dc].Modified = true;
dc.Title += " *";
}
};
docContent.Items.Add(newdoc);
Documents.Add(newdoc, info);
newdoc.Activate();
}