当前位置: 首页>>代码示例>>C#>>正文


C# DocumentContent.Activate方法代码示例

本文整理汇总了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;
 }
开发者ID:conradz,项目名称:Edit5,代码行数:8,代码来源:EditorProvider.cs

示例2: ShowDocument

 public static void ShowDocument(DocumentContent doc, bool floating)
 {
     doc.Show(DockingManager, floating);
     doc.Activate();
 }
开发者ID:HaKDMoDz,项目名称:Irelia,代码行数:5,代码来源:DocumentService.cs

示例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();
        }
开发者ID:Reticulatas,项目名称:AvalonDock,代码行数:17,代码来源:MainWindow.xaml.cs

示例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();
        }
开发者ID:menozz,项目名称:mirelle,代码行数:78,代码来源:MainWindow.Logic.cs


注:本文中的AvalonDock.DocumentContent.Activate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。