//------------------------------------------------------------------- public void MenuCreateComment_Click(object sender, EventArgs e) { if (_MenuTaxonTreeNode == null) { return; } TaxonComments.CommentFileCreate(_MenuTaxonTreeNode); }
//--------------------------------------------------------------------------------- private void ButtonCreateComment_Click(object sender, EventArgs e) { if (Edited == null) { return; } if (TaxonComments.CommentFile(Edited) != null) { return; } TaxonComments.CommentFileCreateResult result = TaxonComments.CommentFileCreate(Edited); if (result == TaxonComments.CommentFileCreateResult.Success) { splitContainerComments.Visible = false; Comments.RefreshContent(true); return; } string message = "Creation failed:\n "; if (result == TaxonComments.CommentFileCreateResult.ExistsAlready) { message += "a comment file already exists"; } else if (result == TaxonComments.CommentFileCreateResult.NoNameAndID) { message += "taxon as no name or id, click on ID button to create a new TOL ID"; } else if (result == TaxonComments.CommentFileCreateResult.NoCollection) { message += "No available collection, edit collections before creating comments"; } else { message += "unknown reason"; } Loggers.WriteError(LogTags.Comment, message); }