Ejemplo n.º 1
0
        public MainWindow()
        {
            isblack = false;
            RichTextBox rch = (RichTextBox)this.FindName("mainbox");

            siz = (ComboBox)this.FindName("Sizes");

            FontSizes = new List <int>();
            Colors    = new List <string>()
            {
                "Red", "Green", "Blue"
            };
            for (int i = 1; i < 50; i++)
            {
                FontSizes.Add(i);
            }



            OpenCommand        = new GeneralCommand(Open, null);
            CutCommand         = new GeneralCommand(Cut, null);
            CopyCommand        = new GeneralCommand(Copy, null);
            PasteCommand       = new GeneralCommand(Paste, null);
            SaveCommand        = new GeneralCommand(Save, null);
            NewCommand         = new GeneralCommand(New, null);
            CloseCommand       = new GeneralCommand(CloseW, null);
            ChangeLangCommand  = new GeneralCommand(ChangeLang, null);
            ChangeStyleCommand = new GeneralCommand(ChangeStyle, null);
            UndoCommand        = new GeneralCommand(U, null);
            RedoCommand        = new GeneralCommand(R, null);

            DataContext = this;
            System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo("ru-RU");
            InitializeComponent();

            string[] linesformenu = System.IO.File.ReadAllLines(@"lastopened.txt");

            foreach (var s in linesformenu)
            {
                MenuItem mi = new MenuItem();
                mi.Header = s;
                mi.Click += mi_Click;
                MainMenu.Items.Add(mi);
            }

            this.Title = "NewWindow" + ++WindowsCount;

            StreamResourceInfo sriCurs = Application.GetResourceStream(new Uri("cur.cur", UriKind.Relative));

            this.Cursor = new Cursor(sriCurs.Stream);
        }
Ejemplo n.º 2
0
        public Logic()
        {
            RichBoxText = "asd";
            FontSizes   = new List <int>();
            Colors      = new List <string>()
            {
                "Red", "Green", "Blue"
            };
            for (int i = 0; i < 50; i++)
            {
                FontSizes.Add(i);
            }

            OpenCommand = new GeneralCommand(Open, null);
            CutCommand  = new GeneralCommand(Cut, null);
        }