Beispiel #1
0
        public void CreateSymbol(EditorDiagram editor, GridPoint point)
        {
            CircuitProject project = editor.CircuitProject;
            DialogText     dialog  = new DialogText(null);
            bool?          result  = editor.Mainframe.ShowDialog(dialog);

            if (result.HasValue && result.Value && TextNote.IsValidText(dialog.Document))
            {
                project.InTransaction(() => project.TextNoteSet.Create(editor.Project.LogicalCircuit, point, dialog.Document));
            }
        }
Beispiel #2
0
        private void Edit(TextNote textNote)
        {
            DialogText dialog = new DialogText(textNote.Note);
            bool?      result = this.Mainframe.ShowDialog(dialog);

            if (result.HasValue && result.Value && !StringComparer.Ordinal.Equals(textNote.Note, dialog.Document))
            {
                if (TextNote.IsValidText(dialog.Document))
                {
                    this.CircuitProject.InTransaction(() => { textNote.Note = dialog.Document; });
                }
                else
                {
                    this.CircuitProject.InTransaction(() => textNote.Delete());
                }
            }
        }