Dynamo.Graph.Workspaces.WorkspaceModel.AddAnnotation C# (CSharp) Method

AddAnnotation() private method

private AddAnnotation ( string text, System.Guid id ) : AnnotationModel
text string
id System.Guid
return AnnotationModel
        internal AnnotationModel AddAnnotation(string text, Guid id)
        {
            var selectedNodes = this.Nodes == null ? null:this.Nodes.Where(s => s.IsSelected);
            var selectedNotes = this.Notes == null ? null: this.Notes.Where(s => s.IsSelected);

            if (!CheckIfModelExistsInSameGroup(selectedNodes, selectedNotes))
            {
                var annotationModel = new AnnotationModel(selectedNodes, selectedNotes)
                {
                    GUID = id,
                    AnnotationText = text
                };
                annotationModel.ModelBaseRequested += annotationModel_GetModelBase;
                annotationModel.Disposed += (_) => annotationModel.ModelBaseRequested -= annotationModel_GetModelBase;
                AddNewAnnotation(annotationModel);
                HasUnsavedChanges = true;
                return annotationModel;
            }
            return null;
        }

Same methods

WorkspaceModel::AddAnnotation ( AnnotationModel annotationModel ) : void
WorkspaceModel