/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes the scripture note import manager. /// </summary> /// ------------------------------------------------------------------------------------ public static void Initialize(IScripture scr, int bookNum, string alternateRfcWsDir) { s_scr = scr; if (!string.IsNullOrEmpty(alternateRfcWsDir)) { s_alternateRfcWsDir = alternateRfcWsDir; } CacheCheckIds(); if (s_rfcWs == null) { s_rfcWs = new RfcWritingSystem(s_scr.Cache, false); } if (bookNum != s_prevBookNum) { s_prevBookNum = bookNum; s_annotationList = (ScrBookAnnotations)scr.BookAnnotationsOS[bookNum - 1]; s_existingAnnotations = new Dictionary <ScrScriptureNote.ScrNoteKey, ScrScriptureNote>(); foreach (ScrScriptureNote ann in s_annotationList.NotesOS) { s_existingAnnotations[ann.Key] = ann; } } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Cleanups the scripture note import manager. /// </summary> /// ------------------------------------------------------------------------------------ public static void Cleanup() { s_existingAnnotations = null; s_checkNamesToGuids = null; s_annotationList = null; s_rfcWs = null; s_prevBookNum = 0; s_scr = null; }