Exemple #1
0
        private void OpenFileHandler( SimpleEditFileHandler.SEFileHandler p, bool loadAsTxt )
        {
            if ( loadAsTxt )
            {
                StreamReader r = new StreamReader(loadedFile.FullName);

                textBoxRich.Visible = false;
                textBoxSimple.Visible = true;
                toolBar.Visible = false;

                textBoxSimple.Text = r.ReadToEnd();

                r.Close();
                r.Dispose();
            }
            else
            {
                if ( p == null )
                {
                    throw new Exception("Plugin error");
                }

                if ( p.Load(loadedFile.FullName) )
                {
                    if ( p.isRtf )
                    {
                        textBoxRich.Visible = true;
                        textBoxSimple.Visible = false;
                        toolBar.Visible = true;

                        textBoxRich.Rtf = p.Content;
                    }
                    else
                    {
                        textBoxRich.Visible = false;
                        textBoxSimple.Visible = true;
                        toolBar.Visible = false;

                        textBoxSimple.Text = p.Content;
                    }
                }

                p.Dispose();
            }

            this.Text = loadedFile.Name + " - " + AppName;
        }
Exemple #2
0
 private void OpenFileHandler( SimpleEditFileHandler.SEFileHandler p )
 {
     OpenFileHandler(p, false);
 }