private void CMAnnotation_Click(object sender, RoutedEventArgs e) { //show keyboard and clean result tpKeyboard.ResultClear(); tpKeyboard.Visibility = Visibility.Visible; Note newNote = new Note(); newNote.Annotation = new StickyNote(lastPosition.X, lastPosition.Y); newNote.Annotation.Width = 150; newNote.Annotation.Height = 150; newNote.Annotation.WidthFactor = Core.Profile.PixelsPerCm.Width; newNote.Annotation.HeightFactor = Core.Profile.PixelsPerCm.Height; newNote.Icon = new Image { Width = 1, Height = 0.8 }; string strUri2 = (Environment.CurrentDirectory + "\\Images\\ICON.png"); newNote.Icon.Source = new BitmapImage(new Uri(strUri2)); newNote.Icon.Margin = new Thickness(lastPosition.X, lastPosition.Y - newNote.Icon.Height, 0, 0); AddNote(newNote); ActualDocument[ActualPage].Annotations.Add(newNote); //Update current note ActualNote = newNote; }
private void RemoveNote(Note note) { note.Annotation.getBClose().Click -= bStickyNoteClose_Click; note.Annotation.getGNote().MouseMove -= StickyNoteButton_MouseMove; note.Annotation.getGNote().MouseDown -= StickyNoteButton_MouseDown; note.Annotation.getGNote().MouseUp -= StickyNoteButton_MouseUp; note.Annotation.getTextField().PreviewMouseDown -= StickyNoteTextBox_PreviewMouseDown; note.Annotation.getTextField().PreviewMouseMove -= StickyNoteTextBox_PreviewMouseMove; note.Icon.MouseDown -= Icon_MouseDown; cHighlights.Children.Remove(note.Annotation); cHighlights.Children.Remove(note.Icon); }
private void AddNote(Note note) { note.Annotation.getBClose().Click += bStickyNoteClose_Click; note.Annotation.getGNote().MouseMove += StickyNoteButton_MouseMove; note.Annotation.getGNote().MouseDown += StickyNoteButton_MouseDown; note.Annotation.getGNote().MouseUp += StickyNoteButton_MouseUp; note.Annotation.getTextField().PreviewMouseDown += StickyNoteTextBox_PreviewMouseDown; note.Annotation.getTextField().PreviewMouseMove += StickyNoteTextBox_PreviewMouseMove; note.Icon.MouseDown += Icon_MouseDown; cHighlights.Children.Add(note.Annotation); cHighlights.Children.Add(note.Icon); }
public IActiveReaderMarker Clone() { Note clone = new Note(); clone.AnnotationObject = AnnotationObject; clone.IconXAML = IconXAML; return clone; }