Esempio n. 1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="MultilingScrBooks"/> class when there
        /// is an object that can dynamically provide the versification to use on the fly.
        /// </summary>
        /// <param name="versificationProvider">The Scripture project meta-data provider used
        /// to get the current versification system.</param>
        /// ------------------------------------------------------------------------------------
        public MultilingScrBooks(IScrProjMetaDataProvider versificationProvider)
        {
            m_versificationProvider = versificationProvider;

            // If values exist already, depend on collecting garbage.
            m_NameSets = new Dictionary <string, WsNames>(3);
            m_NameSets[kWsSilCodes] = SILNameSet;
            m_NameSets[kWsEnglish]  = EnglishNameSet;
            m_NameSets[kWsSpanish]  = SpanishNameSet;

            // Initialize the list of requested encodings with the built-in languages we provide
            List <string> encs = new List <string>(2);

            encs.AddRange(new [] { kWsEnglish, kWsSpanish });
            RequestedEncodings = encs;             // Calls RequestedEncodings:Set
        }
Esempio n. 2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Creates the object that can provide multi-lingual names and abbreviations for
		/// Scripture books.
		/// </summary>
		/// <param name="scrProj">The Scripture project meta-data provided (can be null).</param>
		/// <param name="versification">The default versification to use for references if
		/// scrProj is not set.</param>
		/// ------------------------------------------------------------------------------------
		protected virtual void CreateMultilingScrBooks(IScrProjMetaDataProvider scrProj, ScrVers versification)
		{
			m_mulScrBooks = scrProj != null ? new MultilingScrBooks(scrProj) : new MultilingScrBooks(versification);
		}
Esempio n. 3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Non-default constructor
		/// </summary>
		/// <param name="reference">Initial reference</param>
		/// <param name="scrProj">Object that can provide meta-dat information about a Scripture
		/// project.</param>
		/// <param name="versification">The versification to use if scrProj is not set.</param>
		/// ------------------------------------------------------------------------------------
		public ScrPassageControl(ScrReference reference, IScrProjMetaDataProvider scrProj,
			ScrVers versification)
		{
			m_scrProj = scrProj;

			SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer |
				ControlStyles.UserPaint | ControlStyles.ResizeRedraw, true);

			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();

			if (DesignMode)
				return;

			CreateMultilingScrBooks(scrProj, versification);
			Initialize(reference);

			m_dropdownForm = null;

#if __MonoCS__ // Setting MinumumSize allows mono's buggy ToolStrip layout of ToolStripControlHost's to work.
			MinimumSize = new Size(100, 20);
#endif
		}
Esempio n. 4
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Constructor that takes a "Scripture project" that provides versification info on
 /// the fly.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 public ScrBookControl(IScrProjMetaDataProvider scrProj) : base(null, scrProj, ScrVers.English)
 {
     txtScrRef.ReadOnly = true;
 }
Esempio n. 5
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Constructor that takes a "Scripture project" that provides versification info on
		/// the fly.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public ScrBookControl(IScrProjMetaDataProvider scrProj) : base(null, scrProj, ScrVers.English)
		{
			txtScrRef.ReadOnly = true;
		}
Esempio n. 6
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="ScriptureReferenceComparer"/> class.
 /// </summary>
 /// <param name="scrProj">An object which can provide metadata about the Scripture
 /// project (needed to get the current versification when constructing new
 /// ScrReferences).</param>
 /// ------------------------------------------------------------------------------------
 public ScriptureReferenceComparer(IScrProjMetaDataProvider scrProj)
 {
     m_scrProj = scrProj;
 }
Esempio n. 7
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Constructor for ScriptureReferenceComparer.
 /// Use this constructor when creating a comparer for the scripture checks result grid,
 /// since the scripture checks result grid may contain invalid references. We don't want
 /// to throw an assertion in that case.
 /// </summary>
 /// <param name="scrProj">An object which can provide metadata about the Scripture
 /// project (needed to get the current versification when constructing new
 /// ScrReferences).</param>
 /// <param name="failOnInvalidRef">Flag indicating whether to thow an ArgumentException
 /// if one or both of the references is invalid.</param>
 /// ------------------------------------------------------------------------------------
 public ScriptureReferenceComparer(IScrProjMetaDataProvider scrProj,
                                   bool failOnInvalidRef) : this(scrProj)
 {
     m_failOnInvalidRef = failOnInvalidRef;
 }
Esempio n. 8
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Creates the object that can provide multi-lingual names and abbreviations for
 /// Scripture books.
 /// </summary>
 /// <param name="scrProj">The Scripture project.</param>
 /// <param name="versification">ignored</param>
 /// ------------------------------------------------------------------------------------
 protected override void CreateMultilingScrBooks(IScrProjMetaDataProvider scrProj, ScrVers versification)
 {
     m_mulScrBooks = new DBMultilingScrBooks((IScripture)scrProj);
 }
        //ScriptureReferenceComparer m_scrRefComparer;
        //private bool m_assertOnInvalidRef = true;
        #endregion

        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="ScrReferencePositionComparer"/> class.
        /// </summary>
        /// <param name="scrProj">An object which can provide metadata about the Scripture
        /// project (needed to get the current versification when constructing new
        /// ScrReferences).</param>
        /// <param name="assertOnInvalidRef">Flag indicating whether to complain about invalid
        /// references.</param>
        /// ------------------------------------------------------------------------------------
        public ScrReferencePositionComparer(IScrProjMetaDataProvider scrProj,
                                            bool assertOnInvalidRef)
        {
            //m_assertOnInvalidRef = assertOnInvalidRef;
            //m_scrRefComparer = new ScriptureReferenceComparer(scrProj, assertOnInvalidRef);
        }
Esempio n. 10
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="MultilingScrBooks"/> class.
		/// </summary>
		/// <param name="versificationProvider">The Scripture project meta-data provider used
		/// to get the current versification system.</param>
		/// ------------------------------------------------------------------------------------
		public MultilingScrBooks(IScrProjMetaDataProvider versificationProvider)
		{
			m_versificationProvider = versificationProvider;
			InitNameSets();
		}
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="ScrReferencePositionComparer"/> class.
		/// </summary>
		/// <param name="scrProj">An object which can provide metadata about the Scripture
		/// project (needed to get the current versification when constructing new
		/// ScrReferences).</param>
		/// <param name="assertOnInvalidRef">Flag indicating whether to complain about invalid
		/// references.</param>
		/// ------------------------------------------------------------------------------------
		public ScrReferencePositionComparer(IScrProjMetaDataProvider scrProj,
			bool assertOnInvalidRef)
		{
			m_assertOnInvalidRef = assertOnInvalidRef;
			m_scrRefComparer = new ScriptureReferenceComparer(scrProj, assertOnInvalidRef);
		}
Esempio n. 12
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Creates the object that can provide multi-lingual names and abbreviations for
		/// Scripture books.
		/// </summary>
		/// <param name="scrProj">The Scripture project.</param>
		/// <param name="versification">ignored</param>
		/// ------------------------------------------------------------------------------------
		protected override void CreateMultilingScrBooks(IScrProjMetaDataProvider scrProj, ScrVers versification)
		{
			m_mulScrBooks = new DBMultilingScrBooks((IScripture)scrProj);
		}
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Constructor for ScriptureReferenceComparer.
		/// Use this constructor when creating a comparer for the scripture checks result grid,
		/// since the scripture checks result grid may contain invalid references. We don't want
		/// to throw an assertion in that case.
		/// </summary>
		/// <param name="scrProj">An object which can provide metadata about the Scripture
		/// project (needed to get the current versification when constructing new
		/// ScrReferences).</param>
		/// <param name="failOnInvalidRef">Flag indicating whether to thow an ArgumentException
		/// if one or both of the references is invalid.</param>
		/// ------------------------------------------------------------------------------------
		public ScriptureReferenceComparer(IScrProjMetaDataProvider scrProj,
			bool failOnInvalidRef) : this(scrProj)
		{
			m_failOnInvalidRef = failOnInvalidRef;
		}
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="ScriptureReferenceComparer"/> class.
		/// </summary>
		/// <param name="scrProj">An object which can provide metadata about the Scripture
		/// project (needed to get the current versification when constructing new
		/// ScrReferences).</param>
		/// ------------------------------------------------------------------------------------
		public ScriptureReferenceComparer(IScrProjMetaDataProvider scrProj)
		{
			m_scrProj = scrProj;
		}
Esempio n. 15
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="MultilingScrBooks"/> class when there
		/// is an object that can dynamically provide the versification to use on the fly.
		/// </summary>
		/// <param name="versificationProvider">The Scripture project meta-data provider used
		/// to get the current versification system.</param>
		/// ------------------------------------------------------------------------------------
		public MultilingScrBooks(IScrProjMetaDataProvider versificationProvider)
		{
			m_versificationProvider = versificationProvider;

			// If values exist already, depend on collecting garbage.
			m_NameSets = new Dictionary<string, WsNames>(3);
			m_NameSets[kWsSilCodes] = SILNameSet;
			m_NameSets[kWsEnglish] = EnglishNameSet;
			m_NameSets[kWsSpanish] = SpanishNameSet;

			// Initialize the list of requested encodings with the built-in languages we provide
			List<string> encs = new List<string>(2);
			encs.AddRange(new [] { kWsEnglish, kWsSpanish });
			RequestedEncodings = encs; // Calls RequestedEncodings:Set
		}
Esempio n. 16
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="MultilingScrBooks"/> class.
 /// </summary>
 /// <param name="versificationProvider">The Scripture project meta-data provider used
 /// to get the current versification system.</param>
 /// ------------------------------------------------------------------------------------
 public MultilingScrBooks(IScrProjMetaDataProvider versificationProvider)
 {
     m_versificationProvider = versificationProvider;
     InitNameSets();
 }