public void RemoveMapNote(String mapId, Position position) { MapNoteCollection mapNotes = GetMapNotes(mapId); MapNote mapNote; if (mapNotes.TryGetValue(position, out mapNote) && mapNotes.Remove(position) && RemovedMapNote != null) { RemovedMapNote(this, new MapNoteEventArgs(mapId, mapNote)); } }
public MapNote FindMapNote(String mapId, Position position) { MapNoteCollection mapNoteCollection = FindMapNotes(mapId); MapNote result; if (mapNoteCollection != null && mapNoteCollection.TryGetValue(position, out result)) { return(result); } return(null); }
public MapNote GetMapNote(String mapId, Position position) { MapNoteCollection mapNotes = GetMapNotes(mapId); MapNote mapNote; if (!mapNotes.TryGetValue(position, out mapNote)) { mapNote = new MapNote(mapId, position, null); mapNotes.Add(position, mapNote); if (AddedMapNote != null) { AddedMapNote(this, new MapNoteEventArgs(mapId, mapNote)); } } return(mapNote); }
public void SetMapNoteText(String mapId, Position position, String text) { MapNoteCollection mapNotes = GetMapNotes(mapId); MapNote mapNote; Boolean flag; if (!mapNotes.TryGetValue(position, out mapNote)) { mapNote = new MapNote(mapId, position, text); mapNotes.Add(position, mapNote); flag = true; } else { flag = (mapNote.Note != text); mapNote.Note = text; } if (flag && UpdatedMapNoteText != null) { UpdatedMapNoteText(this, new MapNoteEventArgs(mapId, mapNote)); } }