using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace UniversalEditor
{
    public partial class TextEditor : DevExpress.XtraEditors.XtraForm
    {
        frmMain mainfrm;
        public TextEditor(frmMain main)
        {
            mainfrm = main;
            InitializeComponent();
            richEditControl1.Document.Sections[0].LineNumbering.RestartType = DevExpress.XtraRichEdit.API.Native.LineNumberingRestart.Continuous;
            richEditControl1.Document.Sections[0].LineNumbering.Start = 1;
            richEditControl1.Document.Sections[0].LineNumbering.CountBy = 1;
            richEditControl1.Document.Sections[0].LineNumbering.Distance = 0.1f;
            richEditControl1.Document.CharacterStyles["Line Number"].ForeColor = Color.LightGray;
        }

        private void richEditControl1_TextChanged(object sender, EventArgs e)
        {
            string t = mainfrm.FileTabs.SelectedTabPage.Text;
            string n = t.Replace("*", String.Empty);
            mainfrm.FileTabs.SelectedTabPage.Text = n;
            mainfrm.FileTabs.SelectedTabPage.Text = mainfrm.FileTabs.SelectedTabPage.Text + "*";
        }
    }
}