diff --git a/src/SIL.LCModel/DomainImpl/CmObject.cs b/src/SIL.LCModel/DomainImpl/CmObject.cs
index b71c6623..fa0e5a3c 100644
--- a/src/SIL.LCModel/DomainImpl/CmObject.cs
+++ b/src/SIL.LCModel/DomainImpl/CmObject.cs
@@ -3447,7 +3447,7 @@ int ICmObjectOrIdInternal.GetHvo(IdentityMap identityMap)
// These methods allow a real CmObject to be used where we would sometimes use a surrogate.
#region ICmObjectOrSurrogate Members
- string ICmObjectOrSurrogate.XML
+ string GetStringRepresentation
{
get { return ((ICmObjectInternal)this).ToXmlString(); }
}
@@ -3462,7 +3462,7 @@ string ICmObjectOrSurrogate.Classname
get { return ClassName; }
}
- byte[] ICmObjectOrSurrogate.XMLBytes
+ byte[] GetByteRepresentation
{
get { return ((ICmObjectInternal)this).ToXmlBytes(); }
}
@@ -3484,6 +3484,17 @@ bool ICmObjectOrSurrogate.HasObject
get { return true; }
}
+ ///
+ /// The DTO for this class (which came from storage? which can go to storage?)
+ ///
+ ICmObjectDTO ICmObjectOrSurrogate.DTO
+ {
+ get
+ {
+ return ((BackendProvider)Cache.ServiceLocator.GetInstance())
+ .MakeDTO(this);
+ }
+ }
#endregion
#region IReferenceSource Members
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000002.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000002.cs
index 25dfaeb7..02254ab0 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000002.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000002.cs
@@ -48,7 +48,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
{
DataMigrationServices.CheckVersionNumber(domainObjectDtoRepository, 7000001);
- var parasToChangeClasses = new List();
+ var parasToChangeClasses = new List();
foreach (var stTxtPara in domainObjectDtoRepository.AllInstancesSansSubclasses("StTxtPara"))
{
var paraOwner = domainObjectDtoRepository.GetOwningDTO(stTxtPara);
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000003.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000003.cs
index adff0cc7..249355f6 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000003.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000003.cs
@@ -49,7 +49,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
{
DataMigrationServices.CheckVersionNumber(domainObjectDtoRepository, 7000002);
- var footnotesToChangeClasses = new List();
+ var footnotesToChangeClasses = new List();
foreach (var footnote in domainObjectDtoRepository.AllInstancesSansSubclasses("StFootnote"))
{
XElement footnoteEl = XElement.Parse(footnote.Xml);
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000005.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000005.cs
index a8244396..715bef39 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000005.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000005.cs
@@ -102,7 +102,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
new XElement("AUni", new XAttribute("ws", "en"), "Analysis")),
new XElement("UnderColor", new XAttribute("val", "255")),
new XElement("UnderStyle", new XAttribute("val", "1"))));
- domainObjectDtoRepository.Add(new DomainObjectDTO("82290763-1633-4998-8317-0EC3F5027FBD",
+ domainObjectDtoRepository.Add(new DomainObjectXMLDTO("82290763-1633-4998-8317-0EC3F5027FBD",
"CmPossibility", typeElement.ToString()));
// 3. Move the attributes that are in RnEvent and RnAnalysis into RnGenericRec.
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000008.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000008.cs
index dd9c0835..eb6d9d16 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000008.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000008.cs
@@ -72,7 +72,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
};
//Collect up the ones to be removed.
- var goners = new List();
+ var goners = new List();
foreach (var annDTO in domainObjectDtoRepository.AllInstancesSansSubclasses("CmBaseAnnotation"))
{
var annElement = XElement.Parse(annDTO.Xml);
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000010.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000010.cs
index 933f6322..12e700a7 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000010.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000010.cs
@@ -76,8 +76,8 @@ public void PerformMigration(IDomainObjectDTORepository dtoRepos)
// The old objects to be removed go into 'goners'.
// In this case, it is the annotation defn type objects.
- var goners = new List((int) (dtoRepos.Count*0.80));
- DomainObjectDTO dtoGoner;
+ var goners = new List((int) (dtoRepos.Count*0.80));
+ DomainObjectXMLDTO dtoGoner;
if (dtoRepos.TryGetValue(DataMigrationServices.kSegmentAnnDefnGuid, out dtoGoner))
goners.Add(dtoGoner);
if (dtoRepos.TryGetValue(DataMigrationServices.kTwficAnnDefnGuid, out dtoGoner))
@@ -245,7 +245,7 @@ public void PerformMigration(IDomainObjectDTORepository dtoRepos)
private static void DeleteCcwgWithGuidIndex(IDomainObjectDTORepository dtoRepos)
{
- var goners = new List();
+ var goners = new List();
var ccwgs = dtoRepos.AllInstancesSansSubclasses("ConstChartWordGroup");
foreach (var dto in ccwgs)
{
@@ -277,7 +277,7 @@ private static void DeleteCcwgWithGuidIndex(IDomainObjectDTORepository dtoRepos)
}
private static void DeleteUnneededGoners(IDomainObjectDTORepository dtoRepos,
- IEnumerable goners, ICollection neededGoners)
+ IEnumerable goners, ICollection neededGoners)
{
// We have run out of memory during this data migration on large projects. (See
// FWR-3849.) One possible reason is that we can make 15000+ copies of LangProject
@@ -291,10 +291,10 @@ private static void DeleteUnneededGoners(IDomainObjectDTORepository dtoRepos,
Where(t => (t.Attribute("t") != null && t.Attribute("t").Value == "o")).Count();
if (cAnn > 0)
{
- var gonersInLangProject = new List(cAnn);
+ var gonersInLangProject = new List(cAnn);
foreach (var goner in goners)
{
- DomainObjectDTO gonerActual;
+ DomainObjectXMLDTO gonerActual;
if (!dtoRepos.TryGetValue(goner.Guid, out gonerActual))
continue; // Not in repos.
if (neededGoners.Contains(goner.Guid))
@@ -329,7 +329,7 @@ private static void SortOutMultipleXficBackrefs(IDomainObjectDTORepository dtoRe
Dictionary oldCcas,
Dictionary ccaGuidMap,
IEnumerable oldCcrs,
- List goners)
+ List goners)
{
// Look for any xfics that have multiple CCA backrefs.
// If we find any, look through backrefs of CCAs and backrefs of xfic.BeginObj
@@ -674,7 +674,7 @@ private static List> ProcessDiscourseData(IDomain
halfBakedCcwgItems, refsFromAppliesTo, oldCCAs, ccaGuidMap, newGuid.ToString().ToLowerInvariant())));
// Add DTO to repos.
- dtoRepos.Add(new DomainObjectDTO(newGuid.ToString().ToLowerInvariant(), className, newCCRElement.ToString()));
+ dtoRepos.Add(new DomainObjectXMLDTO(newGuid.ToString().ToLowerInvariant(), className, newCCRElement.ToString()));
}
return halfBakedCcwgItems;
@@ -942,7 +942,7 @@ private static IEnumerable ConvertCCAsAndAddCCRObjSurElements(
retval.Add(DataMigrationServices.CreateOwningObjSurElement(newGuid));
// Add newly converted CCA to repos.
- dtoRepos.Add(new DomainObjectDTO(newGuid, newClassName, newCCAElement.ToString()));
+ dtoRepos.Add(new DomainObjectXMLDTO(newGuid, newClassName, newCCAElement.ToString()));
}
return retval;
@@ -1022,7 +1022,7 @@ private static List GetAStrElements(byte[] xmlBytes, int ichMin, int i
}
private static void DeleteImmediatelyAllUnlovedCCRs(
- IDomainObjectDTORepository dtoRepos, ICollection goners,
+ IDomainObjectDTORepository dtoRepos, ICollection goners,
IDictionary xficHasTextOrDiscourseBackReference,
ICollection oldCCRs,
IDictionary oldCCAs,
@@ -1060,7 +1060,7 @@ from objsurElement in allChartElements.Descendants("Rows").Elements("objsur")
private static void DeleteImmediatelyBadCca(IDomainObjectDTORepository dtoRepos,
string gonerCcaGuid,
- ICollection goners,
+ ICollection goners,
IDictionary ccaGuidMap,
IDictionary oldCcas,
IDictionary xficHasTextOrDiscourseBackReference)
@@ -1353,7 +1353,7 @@ private static void ProcessParagraphs(
newSegmentElement = DeleteTemporaryAnalyses(newSegmentElement);
// Create a new Segment instance DTO from the 'newSegmentElement',
// and add it to repos.
- var newSegDto = new DomainObjectDTO(newSegGuid, "Segment", newSegmentElement.ToString());
+ var newSegDto = new DomainObjectXMLDTO(newSegGuid, "Segment", newSegmentElement.ToString());
dtoRepos.Add(newSegDto);
}
@@ -1485,7 +1485,7 @@ private static void CreateTemporaryXfic(bool fWfic, int beginOffset, int endOffs
}
private static void CollectIndirectAnnotations(
- IDomainObjectDTORepository dtoRepos, ICollection goners,
+ IDomainObjectDTORepository dtoRepos, ICollection goners,
IDictionary oldCCAs,
IDictionary ccaGuidMap,
IDictionary xficHasTextOrDiscourseBackReference,
@@ -1632,7 +1632,7 @@ private static void RemoveMismatchedAppliesToRefs(byte[] xmlBytes, ICollection goners,
+ IDomainObjectDTORepository dtoRepos, ICollection goners,
IDictionary oldCCAs,
IDictionary ccaGuidMap,
IDictionary xficHasTextOrDiscourseBackReference,
@@ -1641,7 +1641,7 @@ private static void CollectBaseAnnotations(
IDictionary>> paraToDuplicateOldXfics,
IDictionary> paraToOldXfics)
{
- var newPunctForms = new Dictionary();
+ var newPunctForms = new Dictionary();
foreach (var baseAnnDto in dtoRepos.AllInstancesSansSubclasses("CmBaseAnnotation"))
{
var surrGuid = GetAnnotationTypeGuid(baseAnnDto.XmlBytes);
@@ -1712,8 +1712,8 @@ private static string GetAnnotationTypeGuid(byte[] xmlBytes)
private static bool EnsurePficHasInstanceOf(
IDomainObjectDTORepository dtoRepos,
- DomainObjectDTO dtoPfic,
- IDictionary newPunctForms)
+ DomainObjectXMLDTO dtoPfic,
+ IDictionary newPunctForms)
{
var pficElement = dtoPfic.XmlBytes;
/*
@@ -1795,7 +1795,7 @@ private static bool EnsurePficHasInstanceOf(
// then make the new PF object, and return true.
// Find/Create PunctuationForm object that has a Form in the matching IcuLocale & matching string.
var key = icuLocale + "-" + newForm;
- DomainObjectDTO dtoMatchingPf;
+ DomainObjectXMLDTO dtoMatchingPf;
if (!newPunctForms.TryGetValue(key, out dtoMatchingPf))
{
// Create new PunctuationForm dto.
@@ -1809,7 +1809,7 @@ private static bool EnsurePficHasInstanceOf(
new XElement("Form",
new XElement("Str",
new XElement("Run", new XAttribute("ws", icuLocale), newForm)))));
- dtoMatchingPf = new DomainObjectDTO(newPunctFormGuid, className, newPfElement.ToString());
+ dtoMatchingPf = new DomainObjectXMLDTO(newPunctFormGuid, className, newPfElement.ToString());
// Add new PunctuationForm to dtoRepos.
dtoRepos.Add(dtoMatchingPf);
// Add new PunctuationForm to newPunctForms.
@@ -1830,7 +1830,7 @@ private static bool EnsurePficHasInstanceOf(
}
private static void MarkParaAsNeedingTokenization(IDomainObjectDTORepository dtoRepos,
- DomainObjectDTO paraDto)
+ DomainObjectXMLDTO paraDto)
{
var stTxtParaBounds = new ElementBounds(paraDto.XmlBytes, s_tagsStTxtPara);
if (!stTxtParaBounds.IsValid)
@@ -1917,19 +1917,19 @@ private static XElement CreateATranslation(string oldSegGuid, Dictionary goners,
+ private static void PreprocessTextTagAnnotation(ICollection goners,
ICollection annElements,
- DomainObjectDTO annDto,
+ DomainObjectXMLDTO annDto,
byte[] annElement)
{
goners.Add(annDto);
annElements.Add(annElement);
}
- private static void PreprocessDiscourseAnnotation(ICollection goners,
+ private static void PreprocessDiscourseAnnotation(ICollection goners,
IDictionary annElements,
IDictionary ccaGuidMap,
- DomainObjectDTO annDto, byte[] annElement)
+ DomainObjectXMLDTO annDto, byte[] annElement)
{
goners.Add(annDto);
var oldGuid = GetGuid(annElement);
@@ -1939,8 +1939,8 @@ private static void PreprocessDiscourseAnnotation(ICollection g
ccaGuidMap.Add(new Guid(oldGuid), Guid.NewGuid());
}
- private static void PreprocessDiscourseAnnotation(ICollection goners,
- ICollection annElements, DomainObjectDTO annDto, byte[] annElement)
+ private static void PreprocessDiscourseAnnotation(ICollection goners,
+ ICollection annElements, DomainObjectXMLDTO annDto, byte[] annElement)
{
goners.Add(annDto);
var annoBounds = new ElementBounds(annElement, s_tagsCmAnnotation);
@@ -1952,8 +1952,8 @@ private static void PreprocessDiscourseAnnotation(ICollection g
annElements.Add(annElement);
}
- private static void PreprocessTranslationOrNoteAnnotation(ICollection goners,
- Dictionary> annElements, DomainObjectDTO annDto, byte[] annElement)
+ private static void PreprocessTranslationOrNoteAnnotation(ICollection goners,
+ Dictionary> annElements, DomainObjectXMLDTO annDto, byte[] annElement)
{
goners.Add(annDto);
var annoBounds = new ElementBounds(annElement, s_tagsCmAnnotation);
@@ -1980,10 +1980,10 @@ private static void PreprocessTranslationOrNoteAnnotation(ICollection goners,
+ ICollection goners,
IDictionary>> paraToDuplicates,
IDictionary> paraToAnnotation,
- DomainObjectDTO baseAnnDto, byte[] annElement, bool checkOnInstanceOf)
+ DomainObjectXMLDTO baseAnnDto, byte[] annElement, bool checkOnInstanceOf)
{
goners.Add(baseAnnDto);
@@ -2106,7 +2106,7 @@ private static XElement AddNotes(IDomainObjectDTORepository dtoRepos, string new
new XElement("CmObject"),
new XElement("Note", GetOptionalComment(oldNotePair, "Content")));
// Create new dto and add to repos.
- var newNoteDto = new DomainObjectDTO(newNoteGuid, "Note", newNoteElement.ToString());
+ var newNoteDto = new DomainObjectXMLDTO(newNoteGuid, "Note", newNoteElement.ToString());
dtoRepos.Add(newNoteDto);
}
}
@@ -2121,7 +2121,7 @@ private static XElement AddSegmentAnalyses(
ICollection oldTextTags,
string newSegmentGuid,
bool isLastOldSegment,
- DomainObjectDTO paraDto)
+ DomainObjectXMLDTO paraDto)
{
XElement retval = null;
@@ -2288,7 +2288,7 @@ where GetAnnotationTypeGuid(xficKvp.Value) == DataMigrationServices.kTwficAnnDef
new XElement("Tag", DataMigrationServices.CreateReferenceObjSurElement(GetInstanceOfGuid(oldTextTagAnnElement)))));
// Add new DTO to repos.
- var newTextTagDto = new DomainObjectDTO(newTextTagGuid, "TextTag", newTextTagElement.ToString());
+ var newTextTagDto = new DomainObjectXMLDTO(newTextTagGuid, "TextTag", newTextTagElement.ToString());
dtoRepos.Add(newTextTagDto);
// Add new TextTag to owning prop on owner as objsur element.
var owningStTextElement = XElement.Parse(owningStText.Xml);
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000011.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000011.cs
index e5cb1d92..d0582fd9 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000011.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000011.cs
@@ -22,16 +22,16 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
{
DataMigrationServices.CheckVersionNumber(domainObjectDtoRepository, 7000010);
- DomainObjectDTO nbkDto = domainObjectDtoRepository.AllInstancesSansSubclasses("RnResearchNbk").First();
+ DomainObjectXMLDTO nbkDto = domainObjectDtoRepository.AllInstancesSansSubclasses("RnResearchNbk").First();
XElement nbkElem = XElement.Parse(nbkDto.Xml);
var recTypesGuid = (string) nbkElem.XPathSelectElement("RnResearchNbk/RecTypes/objsur").Attribute("guid");
- var stack = new Stack(domainObjectDtoRepository.GetDirectlyOwnedDTOs(recTypesGuid));
- IEnumerable recDtos = domainObjectDtoRepository.AllInstancesSansSubclasses("RnGenericRec");
- IEnumerable overlayDtos = domainObjectDtoRepository.AllInstancesSansSubclasses("CmOverlay");
+ var stack = new Stack(domainObjectDtoRepository.GetDirectlyOwnedDTOs(recTypesGuid));
+ IEnumerable recDtos = domainObjectDtoRepository.AllInstancesSansSubclasses("RnGenericRec");
+ IEnumerable overlayDtos = domainObjectDtoRepository.AllInstancesSansSubclasses("CmOverlay");
while (stack.Count > 0)
{
- DomainObjectDTO dto = stack.Pop();
- foreach (DomainObjectDTO childDto in domainObjectDtoRepository.GetDirectlyOwnedDTOs(dto.Guid))
+ DomainObjectXMLDTO dto = stack.Pop();
+ foreach (DomainObjectXMLDTO childDto in domainObjectDtoRepository.GetDirectlyOwnedDTOs(dto.Guid))
stack.Push(childDto);
XElement posElem = XElement.Parse(dto.Xml);
XElement uniElem = posElem.XPathSelectElement("CmPossibility/Abbreviation/AUni[@ws='en']");
@@ -70,7 +70,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
}
}
- DomainObjectDTO recTypesDto = domainObjectDtoRepository.GetDTO(recTypesGuid);
+ DomainObjectXMLDTO recTypesDto = domainObjectDtoRepository.GetDTO(recTypesGuid);
DataMigrationServices.ChangeGuid(domainObjectDtoRepository, recTypesDto, "D9D55B12-EA5E-11DE-95EF-0013722F8DEC", overlayDtos);
DataMigrationServices.IncrementVersionNumber(domainObjectDtoRepository);
}
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000012.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000012.cs
index c4da94d9..902c0eb0 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000012.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000012.cs
@@ -48,7 +48,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
/// Name of the object containing fieldToDelete.
/// The name of the field to delete.
/// ------------------------------------------------------------------------------------
- private void RemoveField(DomainObjectDTO dto, XElement objElement, string fieldToDelete)
+ private void RemoveField(DomainObjectXMLDTO dto, XElement objElement, string fieldToDelete)
{
XElement rmElement = objElement.Element(fieldToDelete);
if (rmElement != null)
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000013.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000013.cs
index b6296091..7f5a537f 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000013.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000013.cs
@@ -28,7 +28,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
// 1) Select the ConstChartWordGroup class objects.
// 2) Convert any with null BeginSegment reference to ConstChartTag objects with null Tag reference.
- var objsToChangeClasses = new List();
+ var objsToChangeClasses = new List();
foreach (var cellPartDto in domainObjectDtoRepository.AllInstancesSansSubclasses("ConstChartWordGroup"))
{
var rtElement = XElement.Parse(cellPartDto.Xml);
@@ -72,7 +72,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
/// Name of the object containing fieldToDelete.
/// The name of the field to delete.
/// ------------------------------------------------------------------------------------
- private void RemoveField(DomainObjectDTO dto, XElement objElement, string fieldToDelete)
+ private void RemoveField(DomainObjectXMLDTO dto, XElement objElement, string fieldToDelete)
{
XElement rmElement = objElement.Element(fieldToDelete);
if (rmElement != null)
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000014.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000014.cs
index 16a40c12..b3827d07 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000014.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000014.cs
@@ -119,7 +119,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
DataMigrationServices.IncrementVersionNumber(domainObjectDtoRepository);
}
- private static DomainObjectDTO MakeEvaluation(string ownerGuid, IDomainObjectDTORepository domainObjectDtoRepository, XElement agentElement, string owningAttr)
+ private static DomainObjectXMLDTO MakeEvaluation(string ownerGuid, IDomainObjectDTORepository domainObjectDtoRepository, XElement agentElement, string owningAttr)
{
var newGuid = Guid.NewGuid().ToString().ToLower();
var newEvalElt = new XElement("rt",
@@ -129,7 +129,7 @@ private static DomainObjectDTO MakeEvaluation(string ownerGuid, IDomainObjectDTO
new XElement("CmObject"),
new XElement("CmAgentEvaluation"));
// Create new dto and add to repos.
- var newEval = new DomainObjectDTO(newGuid, "CmAgentEvaluation", newEvalElt.ToString());
+ var newEval = new DomainObjectXMLDTO(newGuid, "CmAgentEvaluation", newEvalElt.ToString());
domainObjectDtoRepository.Add(newEval);
agentElement.Add(new XElement(owningAttr,
new XElement("objsur", new XAttribute("t", "o"), new XAttribute("guid", newGuid))));
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000016.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000016.cs
index a375904d..eab5779b 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000016.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000016.cs
@@ -64,7 +64,7 @@ public void PerformMigration(IDomainObjectDTORepository repoDTO)
{
DataMigrationServices.CheckVersionNumber(repoDTO, 7000015);
- DomainObjectDTO dtoList = repoDTO.GetDTO(ksguidRecTypesList);
+ DomainObjectXMLDTO dtoList = repoDTO.GetDTO(ksguidRecTypesList);
XElement xeList = XElement.Parse(dtoList.Xml);
XElement xeListPossibilities = xeList.XPathSelectElement("Possibilities");
if (xeListPossibilities == null)
@@ -73,10 +73,10 @@ public void PerformMigration(IDomainObjectDTORepository repoDTO)
xeList.Add(xeListPossibilities);
}
// The user can edit the list, so these might possibly have been deleted (or moved). :-(
- DomainObjectDTO dtoObservation = GetDTOIfItExists(repoDTO, ksguidObservation);
- DomainObjectDTO dtoConversation = GetDTOIfItExists(repoDTO, ksguidConversation);
- DomainObjectDTO dtoInterview = GetDTOIfItExists(repoDTO, ksguidInterview);
- DomainObjectDTO dtoPerformance = GetDTOIfItExists(repoDTO, ksguidPerformance);
+ DomainObjectXMLDTO dtoObservation = GetDTOIfItExists(repoDTO, ksguidObservation);
+ DomainObjectXMLDTO dtoConversation = GetDTOIfItExists(repoDTO, ksguidConversation);
+ DomainObjectXMLDTO dtoInterview = GetDTOIfItExists(repoDTO, ksguidInterview);
+ DomainObjectXMLDTO dtoPerformance = GetDTOIfItExists(repoDTO, ksguidPerformance);
// Create the new Event, Methodology, and Weather record types.
var nowStr = DateTime.Now.ToLCMTimeFormatWithMillisString();
@@ -90,7 +90,7 @@ public void PerformMigration(IDomainObjectDTORepository repoDTO)
sb.AppendFormat("", nowStr);
sb.Append("");
XElement xeEvent = XElement.Parse(sb.ToString());
- var dtoEvent = new DomainObjectDTO(ksguidEvent, "CmPossibility", xeEvent.ToString());
+ var dtoEvent = new DomainObjectXMLDTO(ksguidEvent, "CmPossibility", xeEvent.ToString());
repoDTO.Add(dtoEvent);
xeListPossibilities.AddFirst(DataMigrationServices.CreateOwningObjSurElement(ksguidEvent));
@@ -102,7 +102,7 @@ public void PerformMigration(IDomainObjectDTORepository repoDTO)
sb.AppendFormat("", nowStr);
sb.AppendFormat("", nowStr);
sb.Append("");
- var dtoMethod = new DomainObjectDTO(ksguidMethodology, "CmPossibility", sb.ToString());
+ var dtoMethod = new DomainObjectXMLDTO(ksguidMethodology, "CmPossibility", sb.ToString());
repoDTO.Add(dtoMethod);
xeListPossibilities.LastNode.AddAfterSelf(DataMigrationServices.CreateOwningObjSurElement(ksguidMethodology));
@@ -114,7 +114,7 @@ public void PerformMigration(IDomainObjectDTORepository repoDTO)
sb.AppendFormat("", nowStr);
sb.AppendFormat("", nowStr);
sb.Append("");
- var dtoWeather = new DomainObjectDTO(ksguidWeather, "CmPossibility", sb.ToString());
+ var dtoWeather = new DomainObjectXMLDTO(ksguidWeather, "CmPossibility", sb.ToString());
repoDTO.Add(dtoWeather);
xeListPossibilities.LastNode.AddAfterSelf(DataMigrationServices.CreateOwningObjSurElement(ksguidWeather));
@@ -133,7 +133,7 @@ public void PerformMigration(IDomainObjectDTORepository repoDTO)
DataMigrationServices.IncrementVersionNumber(repoDTO);
}
- private void ChangeOwner(IDomainObjectDTORepository repoDTO, DomainObjectDTO dto, string sGuidNew,
+ private void ChangeOwner(IDomainObjectDTORepository repoDTO, DomainObjectXMLDTO dto, string sGuidNew,
string xpathNew)
{
XElement xe = XElement.Parse(dto.Xml);
@@ -151,7 +151,7 @@ private void ChangeOwner(IDomainObjectDTORepository repoDTO, DomainObjectDTO dto
DataMigrationServices.UpdateDTO(repoDTO, dto, xe.ToString());
if (sGuidOld != null)
{
- DomainObjectDTO dtoOldOwner = repoDTO.GetDTO(sGuidOld);
+ DomainObjectXMLDTO dtoOldOwner = repoDTO.GetDTO(sGuidOld);
XElement xeOldOwner = XElement.Parse(dtoOldOwner.Xml);
string xpathOld = string.Format(".//objsur[@t='o' and @guid='{0}']", dto.Guid);
XElement xeOldRef = xeOldOwner.XPathSelectElement(xpathOld);
@@ -183,7 +183,7 @@ private void ChangeOwner(IDomainObjectDTORepository repoDTO, DomainObjectDTO dto
DataMigrationServices.UpdateDTO(repoDTO, dtoOldOwner, xeOldOwner.ToString());
}
}
- DomainObjectDTO dtoNewOwner = repoDTO.GetDTO(sGuidNew);
+ DomainObjectXMLDTO dtoNewOwner = repoDTO.GetDTO(sGuidNew);
XElement xeNewOwner = XElement.Parse(dtoNewOwner.Xml);
XElement xeNewField = xeNewOwner.XPathSelectElement(xpathNew);
if (xeNewField == null)
@@ -243,7 +243,7 @@ private static XElement CreateXPathElementsAsNeeded(string xpathNew, XElement xe
return null;
}
- private static DomainObjectDTO GetDTOIfItExists(IDomainObjectDTORepository dtoRepository, string sGuid)
+ private static DomainObjectXMLDTO GetDTOIfItExists(IDomainObjectDTORepository dtoRepository, string sGuid)
{
try
{
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000017.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000017.cs
index 22326b7e..cc10b3b6 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000017.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000017.cs
@@ -32,7 +32,7 @@ internal class DataMigration7000017 : IDataMigration
///
public void PerformMigration(IDomainObjectDTORepository repoDTO)
{
- var collectOverlaysToRemove = new List();
+ var collectOverlaysToRemove = new List();
bool fWeatherUsed = IsWeatherUsed(repoDTO, collectOverlaysToRemove);
if (fWeatherUsed)
ConvertWeatherToCustomListAndField(repoDTO);
@@ -45,9 +45,9 @@ public void PerformMigration(IDomainObjectDTORepository repoDTO)
DataMigrationServices.IncrementVersionNumber(repoDTO);
}
- private void RemoveUnwantedOverlays(IDomainObjectDTORepository repoDTO, List collectOverlaysToRemove)
+ private void RemoveUnwantedOverlays(IDomainObjectDTORepository repoDTO, List collectOverlaysToRemove)
{
- DomainObjectDTO dtoLP = GetDtoLangProj(repoDTO);
+ DomainObjectXMLDTO dtoLP = GetDtoLangProj(repoDTO);
foreach (var dto in collectOverlaysToRemove)
{
RemoveOverlayElement(dtoLP, dto.Guid);
@@ -62,10 +62,10 @@ private void RemoveUnwantedOverlays(IDomainObjectDTORepository repoDTO, List rgdtoDead = new List();
+ List rgdtoDead = new List();
GatherDeadObjects(repoDTO, dtoDeadList, rgdtoDead);
foreach (var dto in rgdtoDead)
repoDTO.Remove(dto);
@@ -92,9 +92,9 @@ private void DeleteWeatherListAndField(IDomainObjectDTORepository repoDTO)
}
}
- private DomainObjectDTO GetDtoLangProj(IDomainObjectDTORepository repoDTO)
+ private DomainObjectXMLDTO GetDtoLangProj(IDomainObjectDTORepository repoDTO)
{
- DomainObjectDTO dtoLP = null;
+ DomainObjectXMLDTO dtoLP = null;
foreach (var dto in repoDTO.AllInstancesWithSubclasses("LangProject"))
{
dtoLP = dto;
@@ -116,15 +116,15 @@ private string RemoveEmptyWeather(string sXml, int idx)
return sXml;
}
- private void GatherDeadObjects(IDomainObjectDTORepository repoDTO, DomainObjectDTO dtoDead,
- List rgdtoDead)
+ private void GatherDeadObjects(IDomainObjectDTORepository repoDTO, DomainObjectXMLDTO dtoDead,
+ List rgdtoDead)
{
rgdtoDead.Add(dtoDead);
foreach (var dto in repoDTO.GetDirectlyOwnedDTOs(dtoDead.Guid))
GatherDeadObjects(repoDTO, dto, rgdtoDead);
}
- private string RemoveWeatherConditionsElement(DomainObjectDTO dtoLP)
+ private string RemoveWeatherConditionsElement(DomainObjectXMLDTO dtoLP)
{
string sLpXml = dtoLP.Xml;
int idx = sLpXml.IndexOf("");
@@ -135,7 +135,7 @@ private string RemoveWeatherConditionsElement(DomainObjectDTO dtoLP)
return ExtractFirstGuid(sWeatherConditions, 0, " guid=\"");
}
- private void RemoveOverlayElement(DomainObjectDTO dtoLP, string overlayGuid)
+ private void RemoveOverlayElement(DomainObjectXMLDTO dtoLP, string overlayGuid)
{
string sLpXml = dtoLP.Xml;
int idx = sLpXml.IndexOf("");
@@ -197,7 +197,7 @@ private string ExtractFirstGuid(string sElement, int startIndex, string sAttrTag
private void ConvertWeatherToCustomListAndField(IDomainObjectDTORepository repoDTO)
{
// Change the Weather list to being unowned.
- DomainObjectDTO dtoLP = null;
+ DomainObjectXMLDTO dtoLP = null;
foreach (var dto in repoDTO.AllInstancesWithSubclasses("LangProject"))
{
dtoLP = dto;
@@ -205,7 +205,7 @@ private void ConvertWeatherToCustomListAndField(IDomainObjectDTORepository repoD
}
string sWeatherListGuid = RemoveWeatherConditionsElement(dtoLP).ToLowerInvariant();
repoDTO.Update(dtoLP);
- DomainObjectDTO dtoWeatherList = null;
+ DomainObjectXMLDTO dtoWeatherList = null;
foreach (var dto in repoDTO.AllInstancesWithSubclasses("CmPossibilityList"))
{
if (dto.Guid.ToLowerInvariant() == sWeatherListGuid)
@@ -254,13 +254,13 @@ private string RemoveOwnerGuid(string sXml)
return sXml.Remove(idx, idxLim - idx);
}
- private bool IsWeatherUsed(IDomainObjectDTORepository repoDTO, List collectOverlaysToRemove)
+ private bool IsWeatherUsed(IDomainObjectDTORepository repoDTO, List collectOverlaysToRemove)
{
- DomainObjectDTO dtoLP = GetDtoLangProj(repoDTO);
+ DomainObjectXMLDTO dtoLP = GetDtoLangProj(repoDTO);
string sLpXml = dtoLP.Xml;
int idxW = sLpXml.IndexOf("");
var sguidWeather = ExtractFirstGuid(sLpXml, idxW, " guid=\"");
- DomainObjectDTO dtoWeather = repoDTO.GetDTO(sguidWeather);
+ DomainObjectXMLDTO dtoWeather = repoDTO.GetDTO(sguidWeather);
var weatherItems = new HashSet();
CollectItems(repoDTO, dtoWeather, weatherItems);
foreach (var dto in repoDTO.AllInstancesWithSubclasses("RnGenericRec"))
@@ -337,7 +337,7 @@ private bool StringContainsRefToItemInList(string elementName, HashSet w
/// Add to weatherItems the guids of all the things owned directly or indirectly by dtoRoot.
/// Does not include the root itself.
///
- private void CollectItems(IDomainObjectDTORepository repoDTO, DomainObjectDTO dtoRoot, HashSet guidCollector)
+ private void CollectItems(IDomainObjectDTORepository repoDTO, DomainObjectXMLDTO dtoRoot, HashSet guidCollector)
{
foreach (var dto in repoDTO.GetDirectlyOwnedDTOs(dtoRoot.Guid))
{
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000018.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000018.cs
index 7599fc82..77f8f017 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000018.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000018.cs
@@ -27,15 +27,15 @@ internal class DataMigration7000018 : IDataMigration
{
IDomainObjectDTORepository m_repoDTO;
/// list of objects affected by TE's stylesheet
- HashSet m_scrDtos = new HashSet();
+ HashSet m_scrDtos = new HashSet();
/// the LangProject object
- DomainObjectDTO m_dtoLangProj;
+ DomainObjectXMLDTO m_dtoLangProj;
/// XML string representation of the <Styles> field in the LangProject object
string m_sLangProjStyles;
/// the LangProject StStyle objects
- List m_langProjStyles = new List();
+ List m_langProjStyles = new List();
///
- Dictionary m_mapPropsToStyle = new Dictionary();
+ Dictionary m_mapPropsToStyle = new Dictionary();
Dictionary m_mapStyleNameToGuid = new Dictionary();
int m_cNewCharStyles = 0;
int m_cNewParaStyles = 0;
@@ -59,12 +59,12 @@ public void PerformMigration(IDomainObjectDTORepository repoDTO)
// Get the list of StStyle DTOs from the LexDb.Styles field, and delete the
// LexDb.Styles field.
string sClass = "LexDb";
- DomainObjectDTO dtoLexDb = GetFirstInstance(sClass);
+ DomainObjectXMLDTO dtoLexDb = GetFirstInstance(sClass);
string sXmlLexDb = dtoLexDb.Xml;
int idxStyles = sXmlLexDb.IndexOf("");
int idxStylesLim = sXmlLexDb.IndexOf("") + 9;
string sLexDbStyles = sXmlLexDb.Substring(idxStyles, idxStylesLim - idxStyles);
- List stylesLexDb = new List();
+ List stylesLexDb = new List();
foreach (string sGuid in GetGuidList(sLexDbStyles))
{
var dto = m_repoDTO.GetDTO(sGuid);
@@ -84,12 +84,12 @@ public void PerformMigration(IDomainObjectDTORepository repoDTO)
List styleNames = new List();
m_langProjStyles.Clear();
m_mapStyleNameToGuid.Clear();
- DomainObjectDTO dtoHyperlink = null;
- DomainObjectDTO dtoExternalLink = null;
- DomainObjectDTO dtoInternalLink = null;
- DomainObjectDTO dtoLanguageCode = null;
- DomainObjectDTO dtoWrtSysAbbr = null;
- DomainObjectDTO dtoStrong = null;
+ DomainObjectXMLDTO dtoHyperlink = null;
+ DomainObjectXMLDTO dtoExternalLink = null;
+ DomainObjectXMLDTO dtoInternalLink = null;
+ DomainObjectXMLDTO dtoLanguageCode = null;
+ DomainObjectXMLDTO dtoWrtSysAbbr = null;
+ DomainObjectXMLDTO dtoStrong = null;
foreach (string sGuid in GetGuidList(m_sLangProjStyles))
{
var dto = m_repoDTO.GetDTO(sGuid);
@@ -303,9 +303,9 @@ private void UpdateStyleCrossReference(Dictionary mapLexDbStyleG
}
}
- private DomainObjectDTO CreateCharStyle(string sName, string sProp, ContextValues context)
+ private DomainObjectXMLDTO CreateCharStyle(string sName, string sProp, ContextValues context)
{
- DomainObjectDTO dtoStyle;
+ DomainObjectXMLDTO dtoStyle;
Guid guid = Guid.NewGuid();
string sGuid = guid.ToString().ToLowerInvariant();
StringBuilder sb = new StringBuilder();
@@ -322,7 +322,7 @@ private DomainObjectDTO CreateCharStyle(string sName, string sProp, ContextValue
if (context != ContextValues.General)
sb.AppendLine(String.Format("", (int)context));
sb.AppendLine("");
- dtoStyle = new DomainObjectDTO(sGuid, "StStyle", sb.ToString());
+ dtoStyle = new DomainObjectXMLDTO(sGuid, "StStyle", sb.ToString());
m_repoDTO.Add(dtoStyle);
int idxEnd = m_sLangProjStyles.IndexOf("");
m_sLangProjStyles = m_sLangProjStyles.Insert(idxEnd, String.Format("{1}", sGuid, Environment.NewLine));
@@ -331,7 +331,7 @@ private DomainObjectDTO CreateCharStyle(string sName, string sProp, ContextValue
private void UpdateStyleLinks(Dictionary mapStyleGuids)
{
- foreach (DomainObjectDTO dto in m_repoDTO.AllInstancesSansSubclasses("StStyle"))
+ foreach (DomainObjectXMLDTO dto in m_repoDTO.AllInstancesSansSubclasses("StStyle"))
{
string sXml = dto.Xml;
if (sXml.Contains("") || sXml.Contains(""))
@@ -348,7 +348,7 @@ private void UpdateStyleLinks(Dictionary mapStyleGuids)
}
// Also change any references in Data Notebook UserViewField objects, even though
// these probably don't matter.
- foreach (DomainObjectDTO dto in m_repoDTO.AllInstancesSansSubclasses("UserViewField"))
+ foreach (DomainObjectXMLDTO dto in m_repoDTO.AllInstancesSansSubclasses("UserViewField"))
{
string sXml = dto.Xml;
if (!sXml.Contains(" mapStyleGuids,
return false;
}
- private string DeleteStyle(string sLangProjStyles, DomainObjectDTO dto)
+ private string DeleteStyle(string sLangProjStyles, DomainObjectXMLDTO dto)
{
string sGuid = dto.Guid.ToLowerInvariant();
m_repoDTO.Remove(dto);
@@ -415,7 +415,7 @@ where os.Attribute("guid").Value.ToLowerInvariant() == sGuid && os.Attribute("t"
return sLangProjStyles;
}
- private void SetOwnerGuid(DomainObjectDTO dto, string sGuidNewOwner)
+ private void SetOwnerGuid(DomainObjectXMLDTO dto, string sGuidNewOwner)
{
string sXml = dto.Xml;
int idx = sXml.IndexOf(" ownerguid=") + 11;
@@ -437,7 +437,7 @@ private string GetStyleName(string sXmlStyle)
return sXmlName.Substring(idx, idxLim - idx);
}
- private DomainObjectDTO GetFirstInstance(string sClass)
+ private DomainObjectXMLDTO GetFirstInstance(string sClass)
{
foreach (var dto in m_repoDTO.AllInstancesSansSubclasses(sClass))
{
@@ -475,7 +475,7 @@ private void ChangeStyleReferences()
byte[] rgbExternalLink2 = Encoding.UTF8.GetBytes(" namedStyle='External Link'");
byte[] rgbInternalLink2 = Encoding.UTF8.GetBytes(" namedStyle='Internal Link'");
byte[] rgbLanguageCode2 = Encoding.UTF8.GetBytes(" namedStyle='Language Code'");
- foreach (DomainObjectDTO dto in m_repoDTO.AllInstancesWithValidClasses())
+ foreach (DomainObjectXMLDTO dto in m_repoDTO.AllInstancesWithValidClasses())
{
if (m_scrDtos.Contains(dto))
continue;
@@ -518,7 +518,7 @@ private void EnsureScrObjListFull()
{
if (m_scrDtos.Count == 0)
{
- foreach (DomainObjectDTO dto in m_repoDTO.AllInstancesSansSubclasses("Scripture"))
+ foreach (DomainObjectXMLDTO dto in m_repoDTO.AllInstancesSansSubclasses("Scripture"))
{
m_scrDtos.Add(dto);
AddOwnedObjects(dto, m_scrDtos);
@@ -530,7 +530,7 @@ private void ReplaceDirectFormattingWithStyles()
{
EnsureScrObjListFull();
byte[] rgbRun = Encoding.UTF8.GetBytes("");
+ DomainObjectXMLDTO dtoStyle = GetMatchingStyle(sNormDirectFmt, "");
ReplaceRunDirectFmts(xe, GetStyleName(dtoStyle.Xml));
fUpdate = true;
}
@@ -556,7 +556,7 @@ private void ReplaceDirectFormattingWithStyles()
}
}
byte[] rgbProp = Encoding.UTF8.GetBytes("");
- dtoStyle = new DomainObjectDTO(guidNew.ToString().ToLowerInvariant(), "StStyle", sb.ToString());
+ dtoStyle = new DomainObjectXMLDTO(guidNew.ToString().ToLowerInvariant(), "StStyle", sb.ToString());
m_repoDTO.Add(dtoStyle);
int idxEnd = m_sLangProjStyles.IndexOf("");
m_sLangProjStyles = m_sLangProjStyles.Insert(idxEnd, String.Format("{1}",
@@ -637,14 +637,14 @@ private DomainObjectDTO GetMatchingStyle(string sNormProps, string sTypeVal)
private void LoadPropsToStyleMap()
{
- foreach (DomainObjectDTO dto in m_langProjStyles)
+ foreach (DomainObjectXMLDTO dto in m_langProjStyles)
{
string sNormProps = GetNormalizedStyleProps(dto);
if (String.IsNullOrEmpty(sNormProps))
continue; // empty definition is possible...
// More than one style can have the same properties -- we'll use the first, or
// the first without a element (ie, the general context).
- DomainObjectDTO dtoPrior;
+ DomainObjectXMLDTO dtoPrior;
if (m_mapPropsToStyle.TryGetValue(sNormProps, out dtoPrior))
{
if (dtoPrior.Xml.Contains(" 0;
}
- private void AddOwnedObjects(DomainObjectDTO dto, HashSet scrObjs)
+ private void AddOwnedObjects(DomainObjectXMLDTO dto, HashSet scrObjs)
{
- foreach (DomainObjectDTO dtoOwned in m_repoDTO.GetDirectlyOwnedDTOs(dto.Guid))
+ foreach (DomainObjectXMLDTO dtoOwned in m_repoDTO.GetDirectlyOwnedDTOs(dto.Guid))
{
scrObjs.Add(dtoOwned);
AddOwnedObjects(dtoOwned, scrObjs);
@@ -1031,7 +1031,7 @@ private void ReplacePropDirectFmts(XElement xeProp, string sStyleName)
private void EnsureBuiltinStylesAreMarkedBuiltin()
{
- foreach (DomainObjectDTO dto in m_langProjStyles)
+ foreach (DomainObjectXMLDTO dto in m_langProjStyles)
{
string sXml = dto.Xml;
if (IsStyleBuiltIn(sXml))
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000019.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000019.cs
index e77ba652..59cf8647 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000019.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000019.cs
@@ -60,8 +60,8 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
DataMigrationServices.CheckVersionNumber(domainObjectDtoRepository, 7000018);
// collect all writing system info
- var guidToWsInfo = new Dictionary>();
- foreach (DomainObjectDTO wsDto in domainObjectDtoRepository.AllInstancesSansSubclasses("LgWritingSystem").ToArray())
+ var guidToWsInfo = new Dictionary>();
+ foreach (DomainObjectXMLDTO wsDto in domainObjectDtoRepository.AllInstancesSansSubclasses("LgWritingSystem").ToArray())
{
XElement wsElem = XElement.Parse(wsDto.Xml);
XElement icuLocaleElem = wsElem.Element("ICULocale");
@@ -71,11 +71,11 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
}
// remove all CmSortSpec objects
- foreach (DomainObjectDTO sortSpecDto in domainObjectDtoRepository.AllInstancesSansSubclasses("CmSortSpec").ToArray())
+ foreach (DomainObjectXMLDTO sortSpecDto in domainObjectDtoRepository.AllInstancesSansSubclasses("CmSortSpec").ToArray())
domainObjectDtoRepository.Remove(sortSpecDto);
// remove SortSpecs property from LangProject
- DomainObjectDTO lpDto = domainObjectDtoRepository.AllInstancesSansSubclasses("LangProject").First();
+ DomainObjectXMLDTO lpDto = domainObjectDtoRepository.AllInstancesSansSubclasses("LangProject").First();
XElement lpElem = XElement.Parse(lpDto.Xml);
XElement sortSpecsElem = lpElem.Element("SortSpecs");
bool lpModified = false;
@@ -126,7 +126,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
ConvertAllIcuLocalesToLangTags(domainObjectDtoRepository, "ScrImportSource", referencedWsIds);
// convert all ICU locales to Language Tags and remove legacy magic font names
- foreach (DomainObjectDTO dto in domainObjectDtoRepository.AllInstances())
+ foreach (DomainObjectXMLDTO dto in domainObjectDtoRepository.AllInstances())
UpdateStringsAndProps(domainObjectDtoRepository, dto, referencedWsIds);
var localStoreFolder = Path.Combine(domainObjectDtoRepository.ProjectFolder, LcmFileHelper.ksWritingSystemsDir);
@@ -136,7 +136,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
// extracting data from the obsolete writing system object's XML.
if (!string.IsNullOrEmpty(domainObjectDtoRepository.ProjectFolder))
{
- foreach (Tuple wsInfo in guidToWsInfo.Values)
+ foreach (Tuple wsInfo in guidToWsInfo.Values)
{
if (referencedWsIds.Contains(wsInfo.Item1))
{
@@ -168,7 +168,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
}
}
}
- foreach (Tuple wsInfo in guidToWsInfo.Values)
+ foreach (Tuple wsInfo in guidToWsInfo.Values)
{
// this should also remove all LgCollations as well
DataMigrationServices.RemoveIncludingOwnedObjects(domainObjectDtoRepository, wsInfo.Item2, false);
@@ -180,7 +180,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
private static void ConvertAllIcuLocalesToLangTags(IDomainObjectDTORepository domainObjectDtoRepository, string className,
HashSet referencedWsIds)
{
- foreach (DomainObjectDTO dto in domainObjectDtoRepository.AllInstancesWithSubclasses(className))
+ foreach (DomainObjectXMLDTO dto in domainObjectDtoRepository.AllInstancesWithSubclasses(className))
{
XElement elem = XElement.Parse(dto.Xml);
XElement icuLocaleElem = elem.Element("ICULocale");
@@ -196,7 +196,7 @@ private static void ConvertAllIcuLocalesToLangTags(IDomainObjectDTORepository do
}
}
- private static void UpdateStringsAndProps(IDomainObjectDTORepository domainObjectDtoRepository, DomainObjectDTO dto,
+ private static void UpdateStringsAndProps(IDomainObjectDTORepository domainObjectDtoRepository, DomainObjectXMLDTO dto,
HashSet referencedWsIds)
{
XElement objElem = XElement.Parse(dto.Xml);
@@ -286,9 +286,9 @@ private static bool UpdateFontAttribute(XElement elem)
}
private static void ConvertAllRefsToStrings(IDomainObjectDTORepository domainObjectDtoRepository, string className,
- Dictionary> guidToWsInfo, HashSet referencedWsIds)
+ Dictionary> guidToWsInfo, HashSet referencedWsIds)
{
- foreach (DomainObjectDTO dto in domainObjectDtoRepository.AllInstancesWithSubclasses(className))
+ foreach (DomainObjectXMLDTO dto in domainObjectDtoRepository.AllInstancesWithSubclasses(className))
{
XElement elem = XElement.Parse(dto.Xml);
if (ConvertRefToString(elem.Element("WritingSystem"), guidToWsInfo, referencedWsIds))
@@ -296,7 +296,7 @@ private static void ConvertAllRefsToStrings(IDomainObjectDTORepository domainObj
}
}
- private static bool ConvertRefToString(XElement refElem, Dictionary> guidToWsInfo,
+ private static bool ConvertRefToString(XElement refElem, Dictionary> guidToWsInfo,
HashSet referencedWsIds)
{
if (refElem == null)
@@ -474,7 +474,7 @@ private static void FillWritingSystemFromLcm(IDomainObjectDTORepository domainOb
if (surElem != null)
{
var guid = (string) surElem.Attribute("guid");
- DomainObjectDTO collDto = domainObjectDtoRepository.GetDTO(guid);
+ DomainObjectXMLDTO collDto = domainObjectDtoRepository.GetDTO(guid);
XElement collElem = XElement.Parse(collDto.Xml);
string sortRules = GetUnicode(collElem, "ICURules");
if (!string.IsNullOrEmpty(sortRules))
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000020.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000020.cs
index 9f1c688b..c901effa 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000020.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000020.cs
@@ -30,7 +30,7 @@ public void PerformMigration(IDomainObjectDTORepository repoDto)
{
DataMigrationServices.CheckVersionNumber(repoDto, 7000019);
- var viewsToDelete = new List();
+ var viewsToDelete = new List();
foreach (var dtoView in repoDto.AllInstancesSansSubclasses("UserView"))
{
var xeView = XElement.Parse(dtoView.Xml);
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000022.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000022.cs
index 4aa7d65f..4521f66f 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000022.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000022.cs
@@ -198,7 +198,7 @@ private static XElement MakeEmptyNameElementInList(XElement listElement)
return nameElem;
}
- private static DomainObjectDTO GetListDto(IDomainObjectDTORepository dtoRepos,
+ private static DomainObjectXMLDTO GetListDto(IDomainObjectDTORepository dtoRepos,
XElement owningElem, string flidName)
{
var xPath = flidName + "/objsur";
@@ -206,7 +206,7 @@ private static DomainObjectDTO GetListDto(IDomainObjectDTORepository dtoRepos,
if (objsurElem == null)
return null;
var guid = objsurElem.Attribute("guid").Value;
- DomainObjectDTO dto;
+ DomainObjectXMLDTO dto;
if(dtoRepos.TryGetValue(guid, out dto))
return dto;
return null;
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000024.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000024.cs
index c1d13535..5c98b6dd 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000024.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000024.cs
@@ -196,7 +196,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
/// Given that the element has been changed to represent the desired new state of the DTO,
/// save the change.
///
- private void UpdateDto(IDomainObjectDTORepository domainObjectDtoRepository, DomainObjectDTO dto, XElement element)
+ private void UpdateDto(IDomainObjectDTORepository domainObjectDtoRepository, DomainObjectXMLDTO dto, XElement element)
{
dto.Xml = element.ToString();
domainObjectDtoRepository.Update(dto);
@@ -207,7 +207,7 @@ private void UpdateDto(IDomainObjectDTORepository domainObjectDtoRepository, Dom
///
private void UpdateDto(IDomainObjectDTORepository domainObjectDtoRepository, XElement element)
{
- DomainObjectDTO dto = domainObjectDtoRepository.GetDTO(element.Attribute("guid").Value);
+ DomainObjectXMLDTO dto = domainObjectDtoRepository.GetDTO(element.Attribute("guid").Value);
dto.Xml = element.ToString();
domainObjectDtoRepository.Update(dto);
}
@@ -232,7 +232,7 @@ private string MakeStatus(IDomainObjectDTORepository domainObjectDtoRepository,
new XAttribute("ownerguid", langPossListGuid),
MakeMultiUnicode("Name", name),
MakeMultiUnicode("Abbreviation", abbr));
- var dtoConfirmed = new DomainObjectDTO(statusConfirmedGuid, "CmPossibility", confirmed.ToString());
+ var dtoConfirmed = new DomainObjectXMLDTO(statusConfirmedGuid, "CmPossibility", confirmed.ToString());
domainObjectDtoRepository.Add(dtoConfirmed);
langPossListElement.Element("Possibilities").Add(MakeOwningSurrogate(statusConfirmedGuid));
return statusConfirmedGuid;
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000025.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000025.cs
index af5537a8..1adef1f4 100644
Binary files a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000025.cs and b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000025.cs differ
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000026.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000026.cs
index ab3c48dc..ef5b7723 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000026.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000026.cs
@@ -74,7 +74,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
/// Given that the element has been changed to represent the desired new state of the DTO,
/// save the change.
///
- private void UpdateDto(IDomainObjectDTORepository domainObjectDtoRepository, DomainObjectDTO dto, XElement element)
+ private void UpdateDto(IDomainObjectDTORepository domainObjectDtoRepository, DomainObjectXMLDTO dto, XElement element)
{
dto.Xml = element.ToString();
domainObjectDtoRepository.Update(dto);
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000027.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000027.cs
index 7a72a73f..c10a41a4 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000027.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000027.cs
@@ -61,7 +61,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
XAttribute linkAttr = run.Attribute("ownlink");
if (linkAttr == null)
continue; // Run doesn't contain a link
- DomainObjectDTO linkObj;
+ DomainObjectXMLDTO linkObj;
// skip links to missing footnotes - user will have to clean these up later.
if (!domainObjectDtoRepository.TryGetValue(linkAttr.Value, out linkObj))
continue;
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000029.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000029.cs
index 6fda2160..6f106e1c 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000029.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000029.cs
@@ -100,7 +100,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
/// Given that the element has been changed to represent the desired new state of the DTO,
/// save the change.
///
- private void UpdateDto(IDomainObjectDTORepository domainObjectDtoRepository, DomainObjectDTO dto, XElement element)
+ private void UpdateDto(IDomainObjectDTORepository domainObjectDtoRepository, DomainObjectXMLDTO dto, XElement element)
{
dto.Xml = element.ToString();
domainObjectDtoRepository.Update(dto);
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000030.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000030.cs
index e471e7b7..aa03d6f2 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000030.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000030.cs
@@ -83,7 +83,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
//-------------------------------------------------
var langProjectGuid = langProjElement.Attribute("guid").Value;
var filePathsInTsStringsElement = AddFilePathsInTsStringsElement(langProjElement);
- DomainObjectDTO cmFolderDto;
+ DomainObjectXMLDTO cmFolderDto;
var cmFolderXElement = MakeCmFolder(domainObjectDtoRepository, langProjectGuid, filePathsInTsStringsElement, CmFolderTags.LocalFilePathsInTsStrings,
out cmFolderDto);
UpdateDto(domainObjectDtoRepository, langProjDto, langProjElement);
@@ -128,7 +128,7 @@ private XElement AddFilePathsInTsStringsElement(XElement langProject)
//
//
private XElement MakeCmFolder(IDomainObjectDTORepository domainObjectDtoRepository, string langProjectGuid,
- XElement filePathsInTsStringsCmFolder, string name, out DomainObjectDTO folderDto)
+ XElement filePathsInTsStringsCmFolder, string name, out DomainObjectXMLDTO folderDto)
{
string cmFolderGuid;
cmFolderGuid = Guid.NewGuid().ToString();
@@ -138,7 +138,7 @@ private XElement MakeCmFolder(IDomainObjectDTORepository domainObjectDtoReposito
new XAttribute("ownerguid", langProjectGuid),
MakeMultiUnicode("Name", name),
new XElement("Files"));
- folderDto = new DomainObjectDTO(cmFolderGuid, "CmFolder", cmFolderXML.ToString());
+ folderDto = new DomainObjectXMLDTO(cmFolderGuid, "CmFolder", cmFolderXML.ToString());
domainObjectDtoRepository.Add(folderDto);
filePathsInTsStringsCmFolder.Add(MakeOwningSurrogate(cmFolderGuid));
return cmFolderXML;
@@ -162,7 +162,7 @@ private void MakeCmFile(IDomainObjectDTORepository domainObjectDtoRepository, st
new XAttribute("class", "CmFile"),
new XAttribute("ownerguid", langCmFolderGuid),
MakeUnicode("InternalPath", path));
- var dtoConfirmed = new DomainObjectDTO(cmFileGuid, "CmFile", cmFileXElement.ToString());
+ var dtoConfirmed = new DomainObjectXMLDTO(cmFileGuid, "CmFile", cmFileXElement.ToString());
domainObjectDtoRepository.Add(dtoConfirmed);
langCmFolder.Element("Files").Add(MakeOwningSurrogate(cmFileGuid));
}
@@ -249,7 +249,7 @@ private List ProcessExternalLinksRelativePaths(IDomainObjectDTORepositor
/// Given that the element has been changed to represent the desired new state of the DTO,
/// save the change.
///
- private void UpdateDto(IDomainObjectDTORepository domainObjectDtoRepository, DomainObjectDTO dto, XElement element)
+ private void UpdateDto(IDomainObjectDTORepository domainObjectDtoRepository, DomainObjectXMLDTO dto, XElement element)
{
dto.Xml = element.ToString();
domainObjectDtoRepository.Update(dto);
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000031.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000031.cs
index 8b3a06c5..03d6f261 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000031.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000031.cs
@@ -55,8 +55,8 @@ public void PerformMigration(IDomainObjectDTORepository repoDto)
{
DataMigrationServices.CheckVersionNumber(repoDto, 7000030);
- List viewsToDelete = new List();
- foreach (DomainObjectDTO dtoView in repoDto.AllInstancesSansSubclasses("UserView"))
+ List viewsToDelete = new List();
+ foreach (DomainObjectXMLDTO dtoView in repoDto.AllInstancesSansSubclasses("UserView"))
{
XElement xeView = XElement.Parse(dtoView.Xml);
XElement xeApp = xeView.Element("App");
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000034.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000034.cs
index b49a1903..324c8a4f 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000034.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000034.cs
@@ -57,7 +57,7 @@ public void PerformMigration(IDomainObjectDTORepository repoDto)
if (pictures != null && pictures.Elements().Count() > 1)
{
- DomainObjectDTO folder = null;
+ DomainObjectXMLDTO folder = null;
bool foundFiles = false;
foreach (var x in pictures.Elements())
{
@@ -84,8 +84,8 @@ public void PerformMigration(IDomainObjectDTORepository repoDto)
DataMigrationServices.IncrementVersionNumber(repoDto);
}
- private void MoveFileReferences(IDomainObjectDTORepository repoDto, DomainObjectDTO langProj,
- DomainObjectDTO srcFolder, DomainObjectDTO destFolder)
+ private void MoveFileReferences(IDomainObjectDTORepository repoDto, DomainObjectXMLDTO langProj,
+ DomainObjectXMLDTO srcFolder, DomainObjectXMLDTO destFolder)
{
var srcFolderElement = XElement.Parse(srcFolder.Xml);
var destFolderElement = XElement.Parse(destFolder.Xml);
@@ -105,7 +105,7 @@ private void MoveFileReferences(IDomainObjectDTORepository repoDto, DomainObject
DataMigrationServices.UpdateDTO(repoDto, destFolder, destFolderElement.ToString());
}
- private void RemoveReferenceFromPictures(IDomainObjectDTORepository repoDto, DomainObjectDTO langProj,
+ private void RemoveReferenceFromPictures(IDomainObjectDTORepository repoDto, DomainObjectXMLDTO langProj,
string guid)
{
var langProjElement = XElement.Parse(langProj.Xml);
@@ -121,7 +121,7 @@ private void RemoveReferenceFromPictures(IDomainObjectDTORepository repoDto, Dom
}
private void RemoveInvalidFiles(IDomainObjectDTORepository repoDto,
- DomainObjectDTO langProj, DomainObjectDTO folder)
+ DomainObjectXMLDTO langProj, DomainObjectXMLDTO folder)
{
var langProjElement = XElement.Parse(langProj.Xml);
var pictures = langProjElement.Element("Pictures");
@@ -151,7 +151,7 @@ private void RemoveInvalidFiles(IDomainObjectDTORepository repoDto,
}
}
- private void MoveFileToFolder(IDomainObjectDTORepository repoDto, DomainObjectDTO folder, DomainObjectDTO fileToMove)
+ private void MoveFileToFolder(IDomainObjectDTORepository repoDto, DomainObjectXMLDTO folder, DomainObjectXMLDTO fileToMove)
{
// Create surogate for file and add it to the folder
var surrogate = DataMigrationServices.CreateOwningObjSurElement(fileToMove.Guid);
@@ -166,11 +166,11 @@ private void MoveFileToFolder(IDomainObjectDTORepository repoDto, DomainObjectDT
DataMigrationServices.UpdateDTO(repoDto, fileToMove, fileElement.ToString());
}
- private void UpdatePictureReferences(IDomainObjectDTORepository repoDto, DomainObjectDTO file,
+ private void UpdatePictureReferences(IDomainObjectDTORepository repoDto, DomainObjectXMLDTO file,
string replacementFileGuid,
- Dictionary> pictureMap)
+ Dictionary> pictureMap)
{
- List pictures;
+ List pictures;
if(pictureMap.TryGetValue(file.Guid, out pictures))
{
foreach (var picture in pictures)
@@ -183,9 +183,9 @@ private void UpdatePictureReferences(IDomainObjectDTORepository repoDto, DomainO
}
}
- private Dictionary> CreateFileGuidToPictureMap(IDomainObjectDTORepository repoDto)
+ private Dictionary> CreateFileGuidToPictureMap(IDomainObjectDTORepository repoDto)
{
- var map = new Dictionary>();
+ var map = new Dictionary>();
foreach (var picture in repoDto.AllInstancesSansSubclasses("CmPicture"))
{
// all TE pictures are unowned, so no need to look at those with owners
@@ -200,10 +200,10 @@ private Dictionary> CreateFileGuidToPictureMap(IDo
var objSurrogateElement = pictureFileElement.Element("objsur");
var fileGuid = objSurrogateElement.Attribute("guid").Value;
- List list;
+ List list;
if (!map.TryGetValue(fileGuid, out list))
{
- list = new List();
+ list = new List();
map[fileGuid] = list;
}
list.Add(picture);
@@ -212,7 +212,7 @@ private Dictionary> CreateFileGuidToPictureMap(IDo
return map;
}
- private Dictionary CreateFilePathToGuidMap(IDomainObjectDTORepository repoDto, DomainObjectDTO folder)
+ private Dictionary CreateFilePathToGuidMap(IDomainObjectDTORepository repoDto, DomainObjectXMLDTO folder)
{
var folderElement = XElement.Parse(folder.Xml);
var map = new Dictionary();
@@ -226,7 +226,7 @@ private Dictionary CreateFilePathToGuidMap(IDomainObjectDTORepos
return map;
}
- private string GetFilePath(DomainObjectDTO file)
+ private string GetFilePath(DomainObjectXMLDTO file)
{
var fileElement = XElement.Parse(file.Xml);
var pathElement = fileElement.Element("InternalPath");
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000041.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000041.cs
index 2d3d7ccc..9e9c798f 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000041.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000041.cs
@@ -58,17 +58,17 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
if (dtoPubList == null || dtoPubList.Count() == 0) // add the Publications list to the project
{ // This list is owned by LexDb
var ieDtoLexDb = domainObjectDtoRepository.AllInstancesSansSubclasses("LexDb");
- Debug.Assert(ieDtoLexDb != null && ieDtoLexDb.Count() == 1, "Project has no LexDb Dto or more than one");
- var dtoLexDb = ieDtoLexDb.First();
+ Debug.Assert(ieDtoLexDb != null && ieDtoLexDb.Count() == 1, "Project has no LexDb Dto or more than one");
+ var dtoLexDb = ieDtoLexDb.First();
var xNode = XElement.Parse(dtoLexDb.Xml);
var ksguidLexDb = xNode.Attribute("guid").Value;
var nowStr = DateTime.Now.ToLCMTimeFormatWithMillisString();
string xmlStrPub =
"";
- var dtoPub = new DomainObjectDTO(ksguidPubList, "CmPossibilityList", xmlStrPub);
+ var dtoPub = new DomainObjectXMLDTO(ksguidPubList, "CmPossibilityList", xmlStrPub);
string xmlStrMD = "";
- var dtoMD = new DomainObjectDTO(ksguidMainDictionary, "CmPossibility", xmlStrMD);
+ var dtoMD = new DomainObjectXMLDTO(ksguidMainDictionary, "CmPossibility", xmlStrMD);
domainObjectDtoRepository.Add(dtoMD);
domainObjectDtoRepository.Add(dtoPub);
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000042.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000042.cs
index 799ce8e8..f93ae95c 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000042.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000042.cs
@@ -116,7 +116,7 @@ private void FixOwnershipOfSubtypes(IDomainObjectDTORepository repoDto)
var cFixed = 0;
foreach (var dtoSub in repoDto.GetDirectlyOwnedDTOs(dto.Guid))
{
- DomainObjectDTO dtoOwner;
+ DomainObjectXMLDTO dtoOwner;
if (!repoDto.TryGetOwner(dtoSub.Guid, out dtoOwner) || dtoOwner != dto)
{
// we have a broken ownership link -- fix it!
@@ -183,14 +183,14 @@ private void FixOrAddMissingTypes(IDomainObjectDTORepository repoDto, IEnumerabl
if (m_mapNameGuid.Count > 0)
{
BuildNewTypeMaps();
- var newTypes = new HashSet();
+ var newTypes = new HashSet();
foreach (var guid in m_mapGuidName.Keys)
{
// We need to create this LexEntryType!
var rgNewDtos = m_mapGuidNewDtos[guid];
foreach (var info in rgNewDtos)
{
- var dto = new DomainObjectDTO(info.Guid, info.ClassName, info.Xml);
+ var dto = new DomainObjectXMLDTO(info.Guid, info.ClassName, info.Xml);
repoDto.Add(dto);
if (info.ClassName == "LexEntryType")
newTypes.Add(dto);
@@ -257,7 +257,7 @@ private void ChangeInvalidGuid(IDomainObjectDTORepository repoDto, LexTypeInfo i
m_mapBadGoodGuids.Add(guidBad, guidStd);
var className = info.DTO.Classname;
repoDto.Remove(info.DTO);
- info.DTO = new DomainObjectDTO(guidStd, className, info.XmlElement.ToString());
+ info.DTO = new DomainObjectXMLDTO(guidStd, className, info.XmlElement.ToString());
repoDto.Add(info.DTO);
// Fix the owning reference (but only if it's one of the two lists, because otherwise
// it might be contained in a LexTypeInfo that hasn't yet been processed).
@@ -265,7 +265,7 @@ private void ChangeInvalidGuid(IDomainObjectDTORepository repoDto, LexTypeInfo i
var good = String.Format("guid=\"{0}\"", guidStd);
var bad2 = String.Format("guid='{0}'", guidBad); // probably pure paranoia...
var good2 = String.Format("guid='{0}'", guidStd);
- DomainObjectDTO dtoOwner;
+ DomainObjectXMLDTO dtoOwner;
if (repoDto.TryGetOwner(info.DTO.Guid, out dtoOwner) && dtoOwner.Classname == "CmPossibilityList")
{
dtoOwner.Xml = dtoOwner.Xml.Replace(bad, good).Replace(bad2, good2);
@@ -1847,10 +1847,10 @@ private static string GetGuidValue(XNode xe, string xpath)
///
internal class LexTypeInfo
{
- public DomainObjectDTO DTO { get; set; }
+ public DomainObjectXMLDTO DTO { get; set; }
public XElement XmlElement { get; private set; }
- internal LexTypeInfo(DomainObjectDTO dto, XElement xe)
+ internal LexTypeInfo(DomainObjectXMLDTO dto, XElement xe)
{
DTO = dto;
XmlElement = xe;
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000047.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000047.cs
index 0712d4fb..7bee6062 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000047.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000047.cs
@@ -49,10 +49,10 @@ public void PerformMigration(IDomainObjectDTORepository repoDto)
{
DataMigrationServices.CheckVersionNumber(repoDto, 7000046);
- Dictionary mapOfRenderingsToChk = new Dictionary();
- HashSet renderingsToDelete = new HashSet();
+ Dictionary mapOfRenderingsToChk = new Dictionary();
+ HashSet renderingsToDelete = new HashSet();
- foreach (DomainObjectDTO dto in repoDto.AllInstances())
+ foreach (DomainObjectXMLDTO dto in repoDto.AllInstances())
{
XElement data = XElement.Parse(dto.Xml);
XAttribute classAttr = data.Attribute("class");
@@ -71,9 +71,9 @@ public void PerformMigration(IDomainObjectDTORepository repoDto)
}
}
- foreach (DomainObjectDTO rendering in renderingsToDelete)
+ foreach (DomainObjectXMLDTO rendering in renderingsToDelete)
{
- DomainObjectDTO chkTerm = mapOfRenderingsToChk[new Guid(rendering.Guid)];
+ DomainObjectXMLDTO chkTerm = mapOfRenderingsToChk[new Guid(rendering.Guid)];
XElement termData = XElement.Parse(chkTerm.Xml);
XElement renderings = termData.Element("Renderings");
XElement bogusRendering = renderings.Elements().First(e => e.Attribute("guid").Value.Equals(rendering.Guid, StringComparison.OrdinalIgnoreCase));
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000051.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000051.cs
index d053e7dc..c351891c 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000051.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000051.cs
@@ -36,7 +36,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
var lpElement = XElement.Parse(data);
lpElement.Attribute("guid").Value = newGuidValue;
- var newLpDto = new DomainObjectDTO(newGuidValue, className, lpElement.ToString());
+ var newLpDto = new DomainObjectXMLDTO(newGuidValue, className, lpElement.ToString());
domainObjectDtoRepository.Add(newLpDto);
// Change ownerguid attr for each owned item to new guid.
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000056.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000056.cs
index 39648477..32e2e0d0 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000056.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000056.cs
@@ -46,7 +46,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
var newPhPhonDataElt = new XElement("PhPhonData",
new XAttribute("guid", sPhPhonDataGuid),
new XAttribute("ownerguid", wmbLangProj.Guid));
- wmbPhonData = new DomainObjectDTO(sPhPhonDataGuid, "PhPhonData", newPhPhonDataElt.ToString());
+ wmbPhonData = new DomainObjectXMLDTO(sPhPhonDataGuid, "PhPhonData", newPhPhonDataElt.ToString());
domainObjectDtoRepository.Add(wmbPhonData);
}
XElement wmbPhonDataElt = XElement.Parse(wmbPhonData.Xml);
@@ -83,7 +83,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
sb.Append("");
sb.Append("");
var newCmPossibilityListElt = XElement.Parse(sb.ToString());
- var dtoCmPossibilityList = new DomainObjectDTO(sPossibilityListGuid, "CmPossibilityList", newCmPossibilityListElt.ToString());
+ var dtoCmPossibilityList = new DomainObjectXMLDTO(sPossibilityListGuid, "CmPossibilityList", newCmPossibilityListElt.ToString());
domainObjectDtoRepository.Add(dtoCmPossibilityList);
DataMigrationServices.IncrementVersionNumber(domainObjectDtoRepository);
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000057.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000057.cs
index a7ecfdbe..96e7e263 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000057.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000057.cs
@@ -33,7 +33,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
// first change the class of all the known systemGuids
foreach (var systemGuid in irregularlyInflectedFormVariantTypeSystemGuids)
{
- DomainObjectDTO dtoVariantType;
+ DomainObjectXMLDTO dtoVariantType;
// LT-13312 Note some projects may not have these guids.
if (domainObjectDtoRepository.TryGetValue(systemGuid, out dtoVariantType))
{
@@ -44,7 +44,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
DataMigrationServices.IncrementVersionNumber(domainObjectDtoRepository);
}
- void ChangeClassOfOwnerAndChildren(IDomainObjectDTORepository dtoRepo, DomainObjectDTO dtoToChange, string oldClassname, string newClassname)
+ void ChangeClassOfOwnerAndChildren(IDomainObjectDTORepository dtoRepo, DomainObjectXMLDTO dtoToChange, string oldClassname, string newClassname)
{
// bail out if we've already changed the class name (assume we've already changed its children too).
if (!TryChangeOwnerClass(dtoRepo, dtoToChange, oldClassname, newClassname))
@@ -55,7 +55,7 @@ void ChangeClassOfOwnerAndChildren(IDomainObjectDTORepository dtoRepo, DomainObj
}
}
- bool TryChangeOwnerClass(IDomainObjectDTORepository dtoRepo, DomainObjectDTO dtoToChange, string oldClassname, string newClassname)
+ bool TryChangeOwnerClass(IDomainObjectDTORepository dtoRepo, DomainObjectXMLDTO dtoToChange, string oldClassname, string newClassname)
{
XElement dtoToChangeElt = XElement.Parse(dtoToChange.Xml);
if (dtoToChangeElt.Attribute("class").Value != oldClassname)
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000058.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000058.cs
index 34d96006..332bd912 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000058.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000058.cs
@@ -26,7 +26,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
DataMigrationServices.CheckVersionNumber(domainObjectDtoRepository, 7000057);
{
// LT-13312 Note some projects may not have these guids.
- DomainObjectDTO dtoVariantType;
+ DomainObjectXMLDTO dtoVariantType;
if (domainObjectDtoRepository.TryGetValue(LexEntryTypeTags.kguidLexTypPluralVar.ToString(), out dtoVariantType))
AddGlossAppendIfEmpty(domainObjectDtoRepository, dtoVariantType, ".pl");
if (domainObjectDtoRepository.TryGetValue(LexEntryTypeTags.kguidLexTypPastVar.ToString(), out dtoVariantType))
@@ -35,7 +35,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
DataMigrationServices.IncrementVersionNumber(domainObjectDtoRepository);
}
- static private void AddGlossAppendIfEmpty(IDomainObjectDTORepository dtoRepo, DomainObjectDTO dtoToChange, string glossAppend)
+ static private void AddGlossAppendIfEmpty(IDomainObjectDTORepository dtoRepo, DomainObjectXMLDTO dtoToChange, string glossAppend)
{
XElement dtoToChangeElt = XElement.Parse(dtoToChange.Xml);
XElement glossAppendElt = dtoToChangeElt.XPathSelectElement("GlossAppend");
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000065.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000065.cs
index 0fbdc211..7c130f94 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000065.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000065.cs
@@ -117,7 +117,7 @@ public void PerformMigration(IDomainObjectDTORepository domainObjectDtoRepositor
DataMigrationServices.IncrementVersionNumber(domainObjectDtoRepository);
}
- private static void GetWsNamesFromReversalIndex(DomainObjectDTO revIndexDto, Dictionary wsCodeNameDict )
+ private static void GetWsNamesFromReversalIndex(DomainObjectXMLDTO revIndexDto, Dictionary wsCodeNameDict )
{
var wsElt = XElement.Parse(revIndexDto.Xml).Element(Name);
var existingNameAUniElts = wsElt.Elements(Auni);
@@ -129,7 +129,7 @@ private static void GetWsNamesFromReversalIndex(DomainObjectDTO revIndexDto, Dic
}
}
- private static bool GetGuidForPosListSafely(DomainObjectDTO revIndexDto, out string possListGuid)
+ private static bool GetGuidForPosListSafely(DomainObjectXMLDTO revIndexDto, out string possListGuid)
{
possListGuid = string.Empty;
var posElt = XElement.Parse(revIndexDto.Xml).Element("PartsOfSpeech");
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000069.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000069.cs
index df1947e8..61fe3638 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000069.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000069.cs
@@ -188,7 +188,7 @@ private static void UpdateRestrictions(IDomainObjectDTORepository repoDto)
}
}
- private static void ChangeMultiUnicodeElementToMultiString(IDomainObjectDTORepository repoDto, DomainObjectDTO dto,
+ private static void ChangeMultiUnicodeElementToMultiString(IDomainObjectDTORepository repoDto, DomainObjectXMLDTO dto,
string xpathToMultiUnicodeElement)
{
const string auniXpath = "/AUni";
@@ -328,7 +328,7 @@ private static void CreateLexEntryType(IDomainObjectDTORepository repoDto, strin
repoDto.Update(entryTypeDto);
}
- internal static void AddRefType(XElement data, IDomainObjectDTORepository repoDto, DomainObjectDTO dto, string tagName, string guid, bool owned)
+ internal static void AddRefType(XElement data, IDomainObjectDTORepository repoDto, DomainObjectXMLDTO dto, string tagName, string guid, bool owned)
{
var varElementTag = data.Element(tagName);
if (varElementTag == null)
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000070.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000070.cs
index 1a5ba35d..8ba28377 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000070.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000070.cs
@@ -31,8 +31,8 @@ public void PerformMigration(IDomainObjectDTORepository repoDto)
private void RenameDuplicateCustomListsAndFixBadLists(IDomainObjectDTORepository repoDto)
{
var allLists = repoDto.AllInstancesWithSubclasses("CmPossibilityList");
- var namesAndLists = new Dictionary, DomainObjectDTO>();
- var duplicates = new List>();
+ var namesAndLists = new Dictionary, DomainObjectXMLDTO>();
+ var duplicates = new List>();
foreach (var list in allLists)
{
var listElement = XElement.Parse(list.Xml);
@@ -70,7 +70,7 @@ private void RenameDuplicateCustomListsAndFixBadLists(IDomainObjectDTORepository
continue;
if (namesAndLists.ContainsKey(key))
{
- duplicates.Add(new Tuple(namesAndLists[key], list));
+ duplicates.Add(new Tuple(namesAndLists[key], list));
}
else
{
@@ -94,7 +94,7 @@ private void RenameDuplicateCustomListsAndFixBadLists(IDomainObjectDTORepository
}
}
- private void AppendCustomToNamesAndUpdate(IDomainObjectDTORepository repoDto, DomainObjectDTO dto, XElement dtoXml)
+ private void AppendCustomToNamesAndUpdate(IDomainObjectDTORepository repoDto, DomainObjectXMLDTO dto, XElement dtoXml)
{
var names = dtoXml.Elements("Name");
foreach (var titleElement in names.Select(name => name.Element("AUni")).Where(titleElement => titleElement != null))
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigrationServices.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigrationServices.cs
index 69cac31f..bfd62dfc 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigrationServices.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigrationServices.cs
@@ -59,7 +59,7 @@ internal static void IncrementVersionNumber(IDomainObjectDTORepository dtoRepos)
/// or an emty string.
///
internal static void UpdateDTO(IDomainObjectDTORepository dtoRepos,
- DomainObjectDTO dirtball, string newXmlValue)
+ DomainObjectXMLDTO dirtball, string newXmlValue)
{
if (dtoRepos == null) throw new ArgumentNullException("dtoRepos");
if (dirtball == null) throw new ArgumentNullException("dirtball");
@@ -78,7 +78,7 @@ internal static void UpdateDTO(IDomainObjectDTORepository dtoRepos,
/// or an emty string.
///
internal static void UpdateDTO(IDomainObjectDTORepository dtoRepos,
- DomainObjectDTO dirtball, byte[] newXmlBytes)
+ DomainObjectXMLDTO dirtball, byte[] newXmlBytes)
{
if (dtoRepos == null) throw new ArgumentNullException("dtoRepos");
if (dirtball == null) throw new ArgumentNullException("dirtball");
@@ -97,7 +97,7 @@ internal static void UpdateDTO(IDomainObjectDTORepository dtoRepos,
/// or an emty string.
///
internal static void UpdateDTO(IDomainObjectDTORepository dtoRepos,
- DomainObjectDTO dirtball, string newXmlValue, string oldClassName)
+ DomainObjectXMLDTO dirtball, string newXmlValue, string oldClassName)
{
dtoRepos.ChangeClass(dirtball, oldClassName);
UpdateDTO(dtoRepos, dirtball, newXmlValue);
@@ -107,9 +107,9 @@ internal static void UpdateDTO(IDomainObjectDTORepository dtoRepos,
/// Remove and everything it owns.
/// Be sure to include removing goner from its optional owning property.
///
- internal static void RemoveIncludingOwnedObjects(IDomainObjectDTORepository dtoRepos, DomainObjectDTO goner, bool removeFromOwner)
+ internal static void RemoveIncludingOwnedObjects(IDomainObjectDTORepository dtoRepos, DomainObjectXMLDTO goner, bool removeFromOwner)
{
- DomainObjectDTO gonerActual;
+ DomainObjectXMLDTO gonerActual;
if (!dtoRepos.TryGetValue(goner.Guid, out gonerActual))
return; // Not in repos.
@@ -143,7 +143,7 @@ where objSurNode.Attribute("t").Value == "o" && objSurNode.Attribute("guid").Val
/// Remove a number of objects with a common owner, and everything they own.
///
internal static void RemoveMultipleIncludingOwnedObjects(IDomainObjectDTORepository dtoRepos,
- List goners, DomainObjectDTO ownerDto)
+ List goners, DomainObjectXMLDTO ownerDto)
{
if (ownerDto != null)
{
@@ -198,7 +198,7 @@ internal static void Delint(IDomainObjectDTORepository dtoRepos)
private static void RemoveZombies(
IDomainObjectDTORepository dtoRepos,
- IList allDtos)
+ IList allDtos)
{
var count = allDtos.Count;
var legalOwnerlessClasses = new HashSet
@@ -226,15 +226,15 @@ private static void RemoveZombies(
legalOwnerlessClasses.Add("Text");
- var goners = new List(count);
+ var goners = new List(count);
// Key is guid of owner. Value is set of guids it owns.
// In one very large project that ran out of memory, it had 1281871 dtos, and
// 115694 of them owned more than one other dto. So we'll guess that 1/10th
// of the total count is a reasonable estimate for the capacity of ownerMap.
- var ownerMap = new Dictionary>(count/10);
+ var ownerMap = new Dictionary>(count/10);
foreach (var currentDto in allDtos)
{
- DomainObjectDTO owningDto;
+ DomainObjectXMLDTO owningDto;
if (dtoRepos.TryGetOwner(currentDto.Guid, out owningDto))
{
if (owningDto == null)
@@ -295,7 +295,7 @@ private static HashSet GetOwnees(byte[] xmlBytes)
private static void RemoveDanglingReferences(
IDomainObjectDTORepository dtoRepos,
- IEnumerable allDtos)
+ IEnumerable allDtos)
{
foreach (var currentDto in allDtos)
{
@@ -305,7 +305,7 @@ private static void RemoveDanglingReferences(
// See if it is a dangling ref, where target object has been deleted.
foreach (var targetGuid in referredToGuids)
{
- DomainObjectDTO referencedDto;
+ DomainObjectXMLDTO referencedDto;
if (dtoRepos.TryGetValue(targetGuid, out referencedDto))
continue;
@@ -336,7 +336,7 @@ private static void RemoveDanglingReferences(
private static void RemoveEmptyPropertyElements(
IDomainObjectDTORepository dtoRepos,
- IEnumerable allInstancesWithValidClasses)
+ IEnumerable allInstancesWithValidClasses)
{
foreach (var currentDto in allInstancesWithValidClasses)
{
@@ -344,7 +344,7 @@ private static void RemoveEmptyPropertyElements(
}
}
- private static bool RemoveEmptyPropertyElements(IDomainObjectDTORepository dtoRepos, DomainObjectDTO currentDto, XContainer rtElement)
+ private static bool RemoveEmptyPropertyElements(IDomainObjectDTORepository dtoRepos, DomainObjectXMLDTO currentDto, XContainer rtElement)
{
var propertyElements = (rtElement.Element("CmObject") != null)
? rtElement.Elements().Elements() // Two levels for old stuff before DM15
@@ -374,7 +374,7 @@ private static bool RemoveEmptyPropertyElements(IDomainObjectDTORepository dtoRe
///
///
///
- private static void ChangeClass(DomainObjectDTO target, string oldClass, string newClass)
+ private static void ChangeClass(DomainObjectXMLDTO target, string oldClass, string newClass)
{
// If there's no unexpected white space we can do this efficiently.
// This depends (like various other code) on NOT having unexpected white space around the '='.
@@ -391,7 +391,7 @@ private static void ChangeClass(DomainObjectDTO target, string oldClass, string
/// Change class of object to a new subclass of the original class.
/// Caller still needs to move it from one collection to another in the repository.
///
- internal static void ChangeToSubClass(DomainObjectDTO target, string oldClass, string newClass)
+ internal static void ChangeToSubClass(DomainObjectXMLDTO target, string oldClass, string newClass)
{
ChangeClass(target, oldClass, newClass);
// Need to fill in the new empty element. It will be right before the closing <\rt>.
@@ -406,7 +406,7 @@ internal static void ChangeToSubClass(DomainObjectDTO target, string oldClass, s
target.XmlBytes = input.ReplaceSubArray(index, 0, insertBytes);
}
- private static string[] ExtractReferencedObjects(DomainObjectDTO dto)
+ private static string[] ExtractReferencedObjects(DomainObjectXMLDTO dto)
{
var rootElement = XElement.Parse(dto.Xml);
@@ -487,8 +487,8 @@ private enum ObjSurType
/// The dto.
/// The new GUID.
/// The possible referrers.
- internal static void ChangeGuid(IDomainObjectDTORepository dtoRepos, DomainObjectDTO dto, string newGuid,
- IEnumerable possibleReferrers)
+ internal static void ChangeGuid(IDomainObjectDTORepository dtoRepos, DomainObjectXMLDTO dto, string newGuid,
+ IEnumerable possibleReferrers)
{
// if the DTO already has the new GUID, don't do anything
if (dto.Guid.ToLowerInvariant() == newGuid.ToLowerInvariant())
@@ -496,8 +496,8 @@ internal static void ChangeGuid(IDomainObjectDTORepository dtoRepos, DomainObjec
XElement rtElem = XElement.Parse(dto.Xml);
rtElem.Attribute("guid").Value = newGuid;
- dtoRepos.Add(new DomainObjectDTO(newGuid, dto.Classname, rtElem.ToString()));
- foreach (DomainObjectDTO ownedDto in dtoRepos.GetDirectlyOwnedDTOs(dto.Guid))
+ dtoRepos.Add(new DomainObjectXMLDTO(newGuid, dto.Classname, rtElem.ToString()));
+ foreach (DomainObjectXMLDTO ownedDto in dtoRepos.GetDirectlyOwnedDTOs(dto.Guid))
{
XElement ownedElem = XElement.Parse(ownedDto.Xml);
ownedElem.Attribute("ownerguid").Value = newGuid;
@@ -510,13 +510,13 @@ internal static void ChangeGuid(IDomainObjectDTORepository dtoRepos, DomainObjec
if (possibleReferrers != null)
{
- foreach (DomainObjectDTO referrer in possibleReferrers)
+ foreach (DomainObjectXMLDTO referrer in possibleReferrers)
UpdateObjSurElement(dtoRepos, referrer, dto.Guid, newGuid);
}
dtoRepos.Remove(dto);
}
- private static void UpdateObjSurElement(IDomainObjectDTORepository dtoRepos, DomainObjectDTO dto, string oldGuid, string newGuid)
+ private static void UpdateObjSurElement(IDomainObjectDTORepository dtoRepos, DomainObjectXMLDTO dto, string oldGuid, string newGuid)
{
var rtElem = XElement.Parse(dto.Xml);
var ownObjSurGuidAttr = (from objSurNode in rtElem.Descendants("objsur")
@@ -593,11 +593,11 @@ public static void CreatePossibilityList(IDomainObjectDTORepository dtoRepo, str
sb.Append($"");
sb.Append("");
- var newList = new DomainObjectDTO(listGuid, "CmPossibilityList", sb.ToString());
+ var newList = new DomainObjectXMLDTO(listGuid, "CmPossibilityList", sb.ToString());
dtoRepo.Add(newList);
}
- private static DomainObjectDTO FindMatchingCustomList(IEnumerable allCmPossibilityLists,
+ private static DomainObjectXMLDTO FindMatchingCustomList(IEnumerable allCmPossibilityLists,
Tuple[] languageAbbrAndNames)
{
var englishTitle = languageAbbrAndNames.First(t => t.Item1 == "en").Item3;
@@ -620,7 +620,7 @@ private static DomainObjectDTO FindMatchingCustomList(IEnumerable
/// Creates a CmPossibility with all the basic properties filled in for the xml (necessary for S/R) and adds it to the dto
///
- public static DomainObjectDTO CreatePossibility(IDomainObjectDTORepository repoDto, string listGuid, string possibilityGuid, string name,
+ public static DomainObjectXMLDTO CreatePossibility(IDomainObjectDTORepository repoDto, string listGuid, string possibilityGuid, string name,
string abbr, DateTime createTime, string className = "CmPossibility")
{
var sb = new StringBuilder();
@@ -641,7 +641,7 @@ public static DomainObjectDTO CreatePossibility(IDomainObjectDTORepository repoD
sb.Append("");
sb.Append("");
sb.Append("");
- var dtoCmPossibility = new DomainObjectDTO(possibilityGuid, className, sb.ToString());
+ var dtoCmPossibility = new DomainObjectXMLDTO(possibilityGuid, className, sb.ToString());
repoDto.Add(dtoCmPossibility);
return dtoCmPossibility;
}
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DomainObjectDTO.cs b/src/SIL.LCModel/DomainServices/DataMigration/DomainObjectXMLDTO.cs
similarity index 93%
rename from src/SIL.LCModel/DomainServices/DataMigration/DomainObjectDTO.cs
rename to src/SIL.LCModel/DomainServices/DataMigration/DomainObjectXMLDTO.cs
index 8a2ab948..b45d9630 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/DomainObjectDTO.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/DomainObjectXMLDTO.cs
@@ -20,7 +20,7 @@ namespace SIL.LCModel.DomainServices.DataMigration
/// Instances of this object will be available to DM-land via a special Repository.
///
/// ----------------------------------------------------------------------------------------
- internal class DomainObjectDTO
+ internal class DomainObjectXMLDTO
{
private readonly string m_guid;
private string m_classname;
@@ -34,7 +34,7 @@ internal class DomainObjectDTO
/// The CmObject's class name.
/// The CmObject's xml representation.
/// ------------------------------------------------------------------------------------
- internal DomainObjectDTO(string guid, string classname, byte[] xml)
+ internal DomainObjectXMLDTO(string guid, string classname, byte[] xml)
{
if (string.IsNullOrEmpty(guid)) throw new ArgumentNullException("guid");
if (string.IsNullOrEmpty(classname)) throw new ArgumentNullException("classname");
@@ -45,7 +45,7 @@ internal DomainObjectDTO(string guid, string classname, byte[] xml)
m_xml = xml;
}
- internal DomainObjectDTO(string guid, string classname, string xml)
+ internal DomainObjectXMLDTO(string guid, string classname, string xml)
: this(guid, classname, Encoding.UTF8.GetBytes(xml))
{
@@ -113,10 +113,10 @@ public override bool Equals(object obj)
{
if (obj == null)
return false;
- if (!(obj is DomainObjectDTO))
+ if (!(obj is DomainObjectXMLDTO))
return false;
- return m_guid.ToLower() == ((DomainObjectDTO)obj).m_guid.ToLower();
+ return m_guid.ToLower() == ((DomainObjectXMLDTO)obj).m_guid.ToLower();
}
///
@@ -140,7 +140,7 @@ public override string ToString()
/// ----------------------------------------------------------------------------------------
///
- /// Provide information on class and superclass of a .
+ /// Provide information on class and superclass of a .
///
/// ----------------------------------------------------------------------------------------
internal class ClassStructureInfo
diff --git a/src/SIL.LCModel/DomainServices/DataMigration/IDomainObjectDTORepository.cs b/src/SIL.LCModel/DomainServices/DataMigration/IDomainObjectDTORepository.cs
index b6580dcf..a72bdca3 100644
--- a/src/SIL.LCModel/DomainServices/DataMigration/IDomainObjectDTORepository.cs
+++ b/src/SIL.LCModel/DomainServices/DataMigration/IDomainObjectDTORepository.cs
@@ -38,52 +38,52 @@ internal interface IDomainObjectDTORepository
/// ------------------------------------------------------------------------------------
///
- /// Get the with the specified Guid (as string).
+ /// Get the with the specified Guid (as string).
///
- /// The guid of the as a string.
+ /// The guid of the as a string.
///
- /// The with the given .
+ /// The with the given .
///
///
/// Thrown if the requested object is not in the repository.
///
/// ------------------------------------------------------------------------------------
- DomainObjectDTO GetDTO(string guid);
+ DomainObjectXMLDTO GetDTO(string guid);
///
- /// Try to get the with the given
+ /// Try to get the with the given
/// .
///
- /// The guid for the sought after .
- /// The sought after ,
+ /// The guid for the sought after .
+ /// The sought after ,
/// or null, if not found.
/// 'true' if the object exists, otherwise 'false'.
- bool TryGetValue(string guid, out DomainObjectDTO dtoWithGuid);
+ bool TryGetValue(string guid, out DomainObjectXMLDTO dtoWithGuid);
///
- /// Try to get the owning DTO of the given
+ /// Try to get the owning DTO of the given
/// .
///
- /// The guid for the sought after owning .
- /// The sought after ,
+ /// The guid for the sought after owning .
+ /// The sought after ,
/// or null, if no onwer at all.
/// 'true' if the owner exists, otherwise 'false'.
- bool TryGetOwner(string guid, out DomainObjectDTO owningDto);
+ bool TryGetOwner(string guid, out DomainObjectXMLDTO owningDto);
/// ------------------------------------------------------------------------------------
///
- /// Get the owner for the specified object.
+ /// Get the owner for the specified object.
///
- /// The owned .
+ /// The owned .
///
- /// The owner for the given ,
+ /// The owner for the given ,
/// or null, if there is no owner.
///
///
/// Thrown if the owned object is not in the repository.
///
/// ------------------------------------------------------------------------------------
- DomainObjectDTO GetOwningDTO(DomainObjectDTO ownedObj);
+ DomainObjectXMLDTO GetOwningDTO(DomainObjectXMLDTO ownedObj);
/// ------------------------------------------------------------------------------------
///
@@ -91,13 +91,13 @@ internal interface IDomainObjectDTORepository
///
/// The owning guid.
///
- /// An enumeration of zero, or more owned objects.
+ /// An enumeration of zero, or more owned objects.
///
///
/// Thrown if the Guid is not in the repository.
///
/// ------------------------------------------------------------------------------------
- IEnumerable GetDirectlyOwnedDTOs(string guid);
+ IEnumerable GetDirectlyOwnedDTOs(string guid);
/// ------------------------------------------------------------------------------------
///
@@ -106,11 +106,11 @@ internal interface IDomainObjectDTORepository
///
/// The class of instances to get.
///
- /// An enumeration of zero, or more instances
+ /// An enumeration of zero, or more instances
/// of the given class.
///
/// ------------------------------------------------------------------------------------
- IEnumerable AllInstancesSansSubclasses(string classname);
+ IEnumerable AllInstancesSansSubclasses(string classname);
/// ------------------------------------------------------------------------------------
///
@@ -119,7 +119,7 @@ internal interface IDomainObjectDTORepository
///
/// The class of instances to get, including subclasses.
///
- /// An enumeration of zero, or more instances
+ /// An enumeration of zero, or more instances
/// of the given class.
///
///
@@ -127,35 +127,35 @@ internal interface IDomainObjectDTORepository
/// which may not match that of the data bieng migrated.
///
/// ------------------------------------------------------------------------------------
- IEnumerable AllInstancesWithSubclasses(string classname);
+ IEnumerable AllInstancesWithSubclasses(string classname);
///
/// Equivalent to AllInstancesWithSubclasses("CmObject") but more efficient and less
/// likely to cause out-of-memory through large object heap fragmentation.
///
///
- IEnumerable AllInstancesWithValidClasses();
+ IEnumerable AllInstancesWithValidClasses();
///
/// Get all instances, including ones that are no longer in the model.
/// This will not return DTOs that have been deleted, however.
///
- IEnumerable AllInstances();
+ IEnumerable AllInstances();
///
- /// Add a new to the repository.
+ /// Add a new to the repository.
///
/// The new object to add.
- void Add(DomainObjectDTO newby);
+ void Add(DomainObjectXMLDTO newby);
///
- /// Remove a 'deleted' from the repository.
+ /// Remove a 'deleted' from the repository.
///
/// The deletion of the underlying CmObject object won't happen,
/// until the entire current migration is finished.
///
/// The object being deleted.
- void Remove(DomainObjectDTO goner);
+ void Remove(DomainObjectXMLDTO goner);
///
/// Let the Repository know that has been modified.
@@ -165,7 +165,7 @@ internal interface IDomainObjectDTORepository
/// The underlying CmObject won't be changed, until the end of the current
/// migration is finished.
///
- void Update(DomainObjectDTO dirtball);
+ void Update(DomainObjectXMLDTO dirtball);
///
/// Let the Repository know that has been modified,
@@ -178,9 +178,9 @@ internal interface IDomainObjectDTORepository
/// The underlying CmObject won't be changed, until the end of the current
/// migration is finished.
///
- void Update(DomainObjectDTO dirtball, ClassStructureInfo oldClassStructure, ClassStructureInfo newClassStructure);
+ void Update(DomainObjectXMLDTO dirtball, ClassStructureInfo oldClassStructure, ClassStructureInfo newClassStructure);
- void ChangeClass(DomainObjectDTO dirtball, string oldClassName);
+ void ChangeClass(DomainObjectXMLDTO dirtball, string oldClassName);
///
/// Get the count of dtos in the repository.
@@ -222,8 +222,8 @@ void CreateCustomField(string className, string fieldName, CellarPropertyType cp
internal sealed class DomainObjectDtoRepository : IDomainObjectDTORepository
{
- private readonly HashSet m_dtos;
- private readonly Dictionary m_dtoByGuid;
+ private readonly HashSet m_dtos;
+ private readonly Dictionary m_dtoByGuid;
private readonly Dictionary> m_classesAndTheirDirectSubclasses = new Dictionary>();
/// Class name is the key, superclass is the value of that.
private readonly Dictionary m_classAndSuperClass = new Dictionary();
@@ -231,12 +231,12 @@ internal sealed class DomainObjectDtoRepository : IDomainObjectDTORepository
/// For each class name that occurs on an element in the DTO collection, store a hash set of the instances
/// which have exactly that class. (Unlike an earlier version, does NOT include instances of subclasses.)
///
- private readonly Dictionary> m_dtosByClass = new Dictionary>();
- private readonly HashSet m_newbies = new HashSet();
- private readonly HashSet m_dirtballs = new HashSet();
- private readonly HashSet m_goners = new HashSet();
+ private readonly Dictionary> m_dtosByClass = new Dictionary>();
+ private readonly HashSet m_newbies = new HashSet();
+ private readonly HashSet m_dirtballs = new HashSet();
+ private readonly HashSet m_goners = new HashSet();
private int m_currentModelVersionNumber;
- private readonly HashSet m_oldTimers = new HashSet();
+ private readonly HashSet m_oldTimers = new HashSet