/// ------------------------------------------------------------------------------------ /// <summary> /// Load the Paratext project and enumerator, preparing us to read the data files. /// </summary> /// <param name="paratextProjectId">3-letter Paratext project ID</param> /// <returns>true if the project was loaded, else false</returns> /// ------------------------------------------------------------------------------------ protected virtual void LoadParatextProject(string paratextProjectId) { try { m_scParatextText = new SCRIPTUREOBJECTSLib.SCScriptureTextClass(); m_scParatextTextSegment = new SCRIPTUREOBJECTSLib.SCTextSegmentClass(); } catch (Exception e) { // Can't load Paratext project if Paratext is not installed. throw new ParatextLoadException( TeResourceHelper.GetResourceString("kstidCheckParatextInstallation"), e); } try { m_scParatextText.Load(paratextProjectId); // create ref objs of the Paratext lib SCRIPTUREOBJECTSLib.SCReference startRefPT = new SCRIPTUREOBJECTSLib.SCReference(); SCRIPTUREOBJECTSLib.SCReference endRefPT = new SCRIPTUREOBJECTSLib.SCReference(); startRefPT.Parse(m_settings.StartRef.AsString); endRefPT.Parse(m_settings.EndRef.AsString); // Now initialize the TextEnum with the range of scripture text we want m_scParatextTextEnum = m_scParatextText.TextEnum(startRefPT, endRefPT, (SCRIPTUREOBJECTSLib.SCTextType) 0, //scTitle | scSection | scVerseText | scNoteText | scOther) (SCRIPTUREOBJECTSLib.SCTextProperties) 0); } catch (Exception e) { string msg = string.Format( TeResourceHelper.GetResourceString("kstidParatextProjectLoadFailure"), paratextProjectId); throw new ParatextLoadException(msg, e); } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Load the Paratext project and enumerator, preparing us to read the data files. /// </summary> /// <param name="paratextProjectId">3-letter Paratext project ID</param> /// <returns>true if the project was loaded, else false</returns> /// ------------------------------------------------------------------------------------ protected virtual void LoadParatextProject(string paratextProjectId) { try { m_scParatextText = new SCRIPTUREOBJECTSLib.SCScriptureTextClass(); m_scParatextTextSegment = new SCRIPTUREOBJECTSLib.SCTextSegmentClass(); } catch (Exception e) { // Can't load Paratext project if Paratext is not installed. throw new ParatextLoadException( TeResourceHelper.GetResourceString("kstidCheckParatextInstallation"), e); } try { m_scParatextText.Load(paratextProjectId); // create ref objs of the Paratext lib SCRIPTUREOBJECTSLib.SCReference startRefPT = new SCRIPTUREOBJECTSLib.SCReference(); SCRIPTUREOBJECTSLib.SCReference endRefPT = new SCRIPTUREOBJECTSLib.SCReference(); startRefPT.Parse(m_settings.StartRef.AsString); endRefPT.Parse(m_settings.EndRef.AsString); // Now initialize the TextEnum with the range of scripture text we want m_scParatextTextEnum = m_scParatextText.TextEnum(startRefPT, endRefPT, (SCRIPTUREOBJECTSLib.SCTextType)0, //scTitle | scSection | scVerseText | scNoteText | scOther) (SCRIPTUREOBJECTSLib.SCTextProperties)0); } catch (Exception e) { string msg = string.Format( TeResourceHelper.GetResourceString("kstidParatextProjectLoadFailure"), paratextProjectId); throw new ParatextLoadException(msg, e); } }