Пример #1
0
 public static string ShowEditor(string initial, TextEditorType type, bool dialog)
 {
     TextEditor se = new TextEditor(initial, type);
     if (dialog) se.ShowDialog();
     else se.Show();
     return se.saved;
 }
		public static TextEditor CreateNewEditor (TextEditorType textEditorType = TextEditorType.Default)
		{
			var result = new TextEditor (currentFactory.CreateNewEditor (), textEditorType) {
				ZoomLevel = zoomLevel
			};
			result.ZoomLevelChanged += delegate {
				zoomLevel.Value = result.ZoomLevel;
			};
			return result;
		}
Пример #3
0
    public static string ShowEditor(string initial, TextEditorType type, bool dialog)
    {
      var se = new TextEditor(initial, type);
      se.Text = "Readme editor";

      if (dialog)
      {
        se.ShowDialog();
      }
      else
      {
        se.Show();
      }
      return se.saved;
    }
Пример #4
0
 private TextEditor(string text, TextEditorType type)
 {
   InitializeComponent();
   Icon = Resources.fomm02;
   Settings.Default.windowPositions.GetWindowPosition("TextEditor", this);
   switch (type)
   {
     case TextEditorType.Text:
       rtbEdit = new RichTextBox();
       panel1.Controls.Add(rtbEdit);
       rtbEdit.Text = text;
       rtbEdit.Dock = DockStyle.Fill;
       rtbEdit.TextChanged += textChanged;
       break;
   }
 }
Пример #5
0
 private TextEditor(string text, TextEditorType type)
 {
     InitializeComponent();
     Icon = Resources.fomm02;
     Settings.Default.windowPositions.GetWindowPosition("TextEditor", this);
     switch (type)
     {
     case TextEditorType.Text:
         rtbEdit = new RichTextBox();
         panel1.Controls.Add(rtbEdit);
         rtbEdit.Text         = text;
         rtbEdit.Dock         = DockStyle.Fill;
         rtbEdit.TextChanged += textChanged;
         break;
     }
 }
Пример #6
0
        public static TextEditor CreateNewEditor(IReadonlyTextDocument document, TextEditorType textEditorType = TextEditorType.Default)
        {
            if (document == null)
            {
                throw new System.ArgumentNullException("document");
            }
            var result = new TextEditor(currentFactory.CreateNewEditor(document), textEditorType)
            {
                ZoomLevel = zoomLevel
            };

            result.ZoomLevelChanged += delegate {
                zoomLevel.Value = result.ZoomLevel;
            };
            return(result);
        }
Пример #7
0
 ITextEditorImpl ITextEditorFactory.CreateNewEditor(IReadonlyTextDocument document, TextEditorType textEditorType)
 {
     return(new SourceEditorView(document, textEditorType));
 }
Пример #8
0
 ITextEditorImpl ITextEditorFactory.CreateNewEditor(string fileName, string mimeType, TextEditorType textEditorType)
 {
     return(new SourceEditorView(fileName, mimeType, textEditorType));
 }
Пример #9
0
 ITextEditorImpl ITextEditorFactory.CreateNewEditor(TextEditorType textEditorType)
 {
     return(new SourceEditorView(textEditorType));
 }
Пример #10
0
        public static TextEditor CreateNewEditor(DocumentContext ctx, IReadonlyTextDocument document, TextEditorType textEditorType = TextEditorType.Default)
        {
            var result = CreateNewEditor(document, textEditorType);

            result.InitializeExtensionChain(ctx);
            return(result);
        }
Пример #11
0
		public static TextEditor CreateNewEditor (IReadonlyTextDocument document, TextEditorType textEditorType = TextEditorType.Default)
		{
			if (document == null)
				throw new System.ArgumentNullException ("document");
			var result = new TextEditor (currentFactory.CreateNewEditor (document), textEditorType) {
				ZoomLevel = zoomLevel
			};
			result.ZoomLevelChanged += delegate {
				zoomLevel.Value = result.ZoomLevel;
			};
			return result;
		}
Пример #12
0
		public static TextEditor CreateNewEditor (DocumentContext ctx, IReadonlyTextDocument document, TextEditorType textEditorType = TextEditorType.Default)
		{
			var result = CreateNewEditor (document, textEditorType);
			result.InitializeExtensionChain (ctx);
			return result;
		}
Пример #13
0
        public static TextEditor CreateNewEditor(TextBufferFileModel textBufferFileModel, TextEditorType textEditorType = TextEditorType.Default)
        {
            var result = new TextEditor(currentFactory.CreateNewEditor(textBufferFileModel), textEditorType);

            InitializeTextEditor(result);
            return(result);
        }