// ------------------------------------------------- AddComment public void AddComment (CommentToCircle comment) { if (comment != null) { comments .Add (comment); } }
// ------------------------------------------------- InsertComment public void InsertComment (int iPos, CommentToCircle comment) { iPos = Math .Min (Math .Max (0, iPos), comments .Count); comments .Insert (iPos, comment); }
// ------------------------------------------------- Click_btnAdd private void Click_btnAdd (object sender, EventArgs e) { string str = textNewComment .Text .TrimEnd (); if (string .IsNullOrEmpty (str)) { MessageBox .Show ("Text of the new comment is not ready", "Add comment", MessageBoxButtons .OK, MessageBoxIcon .Exclamation); return; } CommentToCircle cmnt = new CommentToCircle (this, polygon .Center, polygon .Radius, 0, 0, str, fontComment, 0, clrComment); polygon .InsertComment (0, cmnt); RenewMover (); Invalidate (); }