/// <summary> /// Subscribes to the CollectionChanged event on the ObservableCollection of notes. /// </summary> /// <param name="sender"> /// The sending object of the event. /// </param> /// <param name="e"> /// The arguments of the PropertyChanged event. /// </param> private void OnNotesChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Add) { foreach (object item in e.NewItems) { Markings.Add(new MapLocationToolTipMarkingVM((IMarking)item)); } } if (e.Action == NotifyCollectionChangedAction.Remove) { foreach (object item in e.OldItems) { IMarking marking = (IMarking)item; foreach (var markingVM in Markings) { if (markingVM.Marking == marking) { Markings.Remove(markingVM); break; } } } } if (e.Action == NotifyCollectionChangedAction.Reset) { RefreshMarkings(); } }
/// <summary> /// Returns a new marking select popup control ViewModel instance for the specified /// marking. /// </summary> /// <param name="marking"> /// The marking. /// </param> /// <returns> /// A new marking select popup control ViewModel instance. /// </returns> private static MarkingSelectVM GetNonEntranceMarkingSelectPopupVM( IMarking marking) { if (NonEntranceMarkingSelect.Count == 0) { PopulateNonEntranceMarkingSelect(); } return(new MarkingSelectVM(marking, NonEntranceMarkingSelect, 238.0, 200.0)); }
/// <summary> /// Returns a new marking select popup control ViewModel instance for the specified /// marking. /// </summary> /// <param name="marking"> /// The marking. /// </param> /// <returns> /// A new marking select popup control ViewModel instance. /// </returns> private static MarkingSelectVM GetEntranceMarkingSelectPopupVM( IMarking marking) { if (EntranceMarkingSelect.Count == 0) { PopulateEntranceMarkingSelect(); } return(new MarkingSelectVM(marking, EntranceMarkingSelect, 374.0, 320.0)); }
/// <summary> /// Returns a new marking select popup control ViewModel instance. /// </summary> /// <param name="marking"> /// The marking. /// </param> /// <param name="location"> /// The location. /// </param> /// <returns> /// A new marking select popup control ViewModel instance. /// </returns> internal static NoteMarkingSelectVM GetNoteMarkingSelectVM( IMarking marking, ILocation location) { if (marking == null) { throw new ArgumentNullException(nameof(marking)); } if (location == null) { throw new ArgumentNullException(nameof(location)); } return(new NoteMarkingSelectVM(marking, NonEntranceMarkingSelect, location)); }
/// <summary> /// Returns a new set marking action. /// </summary> /// <param name="marking"> /// The marking to be changed. /// </param> /// <param name="newMarking"> /// The new mark value. /// </param> /// <returns> /// A new set marking action. /// </returns> public IUndoable GetSetMarking(IMarking marking, MarkType newMarking) { return(_setMarkingFactory(marking, newMarking)); }
/// <summary> /// Returns a new remove note action. /// </summary> /// <param name="marking"> /// The marking note to be removed. /// </param> /// <param name="location"> /// The location from which the note is removed. /// </param> /// <returns> /// A new remove note action. /// </returns> public IUndoable GetRemoveNote(IMarking marking, ILocation location) { return(_removeNoteFactory(marking, location)); }
/// <summary> /// Executes the action. /// </summary> public void Execute() { _note = MarkingFactory.GetMarking(); _location.Notes.Add(_note); }
/// <summary> /// Constructor /// </summary> /// <param name="marking"> /// The section data to be marked. /// </param> /// <param name="newMarking"> /// The marking to be applied to the section. /// </param> public SetMarking(IMarking marking, MarkType newMarking) { _marking = marking ?? throw new ArgumentNullException(nameof(marking)); _newMarking = newMarking; }
/// <summary> /// Constructor /// </summary> /// <param name="note"> /// The note to be removed. /// </param> /// <param name="location"> /// The location from which the note will be removed. /// </param> public RemoveNote(IMarking note, ILocation location) { _note = note; _location = location; }
/// <summary> /// Returns a new marking select popup control ViewModel instance. /// </summary> /// <param name="marking"> /// The marking. /// </param> /// <param name="location"> /// The location. /// </param> /// <returns> /// A new marking select popup control ViewModel instance. /// </returns> public INoteMarkingSelectVM GetNoteMarkingSelectVM( IMarking marking, ILocation location) { return(_noteSelectFactory(marking, _nonEntranceMarkingSelect, location)); }
/// <summary> /// Returns a new marking select popup control ViewModel instance for the specified /// marking. /// </summary> /// <param name="marking"> /// The marking. /// </param> /// <returns> /// A new marking select popup control ViewModel instance. /// </returns> private IMarkingSelectVM GetEntranceMarkingSelectPopupVM( IMarking marking) { return(_selectFactory(marking, _entranceMarkingSelect, 374.0, 320.0)); }
/// <summary> /// Returns a new marking select popup control ViewModel instance for the specified /// marking. /// </summary> /// <param name="marking"> /// The marking. /// </param> /// <returns> /// A new marking select popup control ViewModel instance. /// </returns> private IMarkingSelectVM GetNonEntranceMarkingSelectPopupVM( IMarking marking) { return(_selectFactory(marking, _nonEntranceMarkingSelect, 238.0, 200.0)); }
/// <summary> /// Constructor /// </summary> /// <param name="note"> /// The note to be removed. /// </param> /// <param name="location"> /// The location from which the note will be removed. /// </param> public RemoveNote(IMarking note, ILocation location) { _note = note ?? throw new ArgumentNullException(nameof(note)); _location = location ?? throw new ArgumentNullException(nameof(location)); }