Example #1
0
        /// <summary>
        /// Initializes a new instance of the FrmNewNote class for a new note.
        /// </summary>
        /// <param name="notes">The class with access to all notes.</param>
        /// <param name="deltaX">X position change from center screen position to show form.</param>
        /// <param name="deltaY">Y position change from center screen position to show form.</param>
        /// <param name="contentclipboard"></param>
        public FrmNewNote(Notes notes, int deltaX, int deltaY, string newtitle, string newcontent)
        {
            this.ConstructFrmNewNote(notes);
            this.SetFormTitle(false);
            this.SetFormTooltips(false);
            this.Location = new Point((Screen.PrimaryScreen.WorkingArea.Width / 2) - (this.Width / 2) + deltaX, (Screen.PrimaryScreen.WorkingArea.Height / 2) - (this.Height / 2) + deltaY);
            this.note     = null;
            if (Settings.NotesDefaultRandomSkin)
            {
                Settings.NotesDefaultSkinnr = notes.GenerateRandomSkinnr();
            }

            this.SetColorsForm(Settings.NotesDefaultSkinnr);
            if (!string.IsNullOrEmpty(newtitle))
            {
                this.tbTitle.Text = newtitle;
            }
            else
            {
                if (Settings.NotesDefaultTitleDate)
                {
                    // The string returned by the ToShortDateString method is culture-sensitive.
                    this.tbTitle.Text = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString();
                }
            }

            if (!string.IsNullOrEmpty(newcontent))
            {
                this.rtbNewNote.Text = newcontent;
            }
        }