Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the FrmNote class.
        /// </summary>
        /// <param name="notes">Notes class</param>
        /// <param name="note">Note data class.</param>
        public FrmNote(Notes notes, Note note)
        {
            this.DoubleBuffered = Settings.ProgramFormsDoublebuffered;
            this.InitializeComponent();
            this.notes = notes;
            this.note  = note;
            this.UpdateForm(false);
            Strings.TranslateForm(this);
            this.lblNoteTitle.Text = note.Title;
            this.rtbNote.BackColor = notes.GetPrimaryClr(note.SkinNr);
            try
            {
                if (string.IsNullOrEmpty(this.note.Tempcontent))
                {
                    this.rtbNote.Rtf = note.GetContent();
                }
                else
                {
                    this.rtbNote.Rtf      = this.note.Tempcontent;
                    this.note.Tempcontent = string.Empty;
                    this.note.Tempcontent = null;
                }
            }
            catch (ArgumentException argexc)
            {
                Log.Write(LogType.exception, "note " + note.Filename + ": " + argexc.Message);
            }

            this.SetTopmostNote();
            this.SetBounds(note.X, note.Y, note.Width, note.Height);
            this.SetLockedNote();
            this.SetRollupNote();
            this.SetWordwarpNote();
            this.UpdateForm(true);
        }