1- using System . Collections . Generic ;
1+ using System ;
2+ using System . Collections . Generic ;
23using System . Globalization ;
34using System . Text ;
45using SIL . Scripture ;
@@ -8,6 +9,7 @@ namespace SIL.Machine.Corpora
89 public class ParatextProjectSettings
910 {
1011 public ParatextProjectSettings (
12+ string guid ,
1113 string name ,
1214 string fullName ,
1315 Encoding encoding ,
@@ -19,9 +21,14 @@ public ParatextProjectSettings(
1921 string biblicalTermsListType ,
2022 string biblicalTermsProjectName ,
2123 string biblicalTermsFileName ,
22- string languageCode
24+ string languageCode ,
25+ string translationType ,
26+ string parentGuid = null ,
27+ string parentName = null ,
28+ ParatextProjectSettings parentSettings = null
2329 )
2430 {
31+ Guid = guid ;
2532 Name = name ;
2633 FullName = fullName ;
2734 Encoding = encoding ;
@@ -34,21 +41,40 @@ string languageCode
3441 BiblicalTermsProjectName = biblicalTermsProjectName ;
3542 BiblicalTermsFileName = biblicalTermsFileName ;
3643 LanguageCode = languageCode ;
44+ TranslationType = translationType ;
45+ ParentGuid = parentGuid ;
46+ ParentName = parentName ;
47+ Parent = parentSettings ;
3748 }
3849
50+ public string Guid { get ; }
3951 public string Name { get ; }
4052 public string FullName { get ; }
4153 public Encoding Encoding { get ; }
42- public ScrVers Versification { get ; }
54+ public ScrVers Versification { get ; private set ; }
4355 public UsfmStylesheet Stylesheet { get ; }
4456 public string FileNamePrefix { get ; }
4557 public string FileNameForm { get ; }
4658 public string FileNameSuffix { get ; }
4759 public string BiblicalTermsListType { get ; }
4860 public string BiblicalTermsProjectName { get ; }
4961 public string BiblicalTermsFileName { get ; }
50-
5162 public string LanguageCode { get ; }
63+ public string TranslationType { get ; }
64+ public string ParentGuid { get ; }
65+ public string ParentName { get ; }
66+ public ParatextProjectSettings Parent
67+ {
68+ get { return _parent ; }
69+ set
70+ {
71+ if ( ! IsDaughterProjectOf ( value ) )
72+ throw new ArgumentException ( $ "Project { value . Name } is not the parent project of project { Name } .") ;
73+ _parent = value ;
74+ Versification = value . Versification ;
75+ }
76+ }
77+ private ParatextProjectSettings _parent ;
5278
5379 public bool IsBookFileName ( string fileName , out string bookId )
5480 {
@@ -114,6 +140,15 @@ public IEnumerable<string> GetAllScriptureBookIds()
114140 }
115141 }
116142
143+ public bool HasParent => ! string . IsNullOrEmpty ( ParentGuid ) ;
144+
145+ public bool IsDaughterProjectOf ( ParatextProjectSettings parentSettings )
146+ {
147+ if ( ! HasParent )
148+ return false ;
149+ return ParentGuid . Equals ( parentSettings . Guid ) ;
150+ }
151+
117152 private static string GetBookFileNameDigits ( string bookId )
118153 {
119154 int bookNum = Canon . BookIdToNumber ( bookId ) ;
0 commit comments