// copy the evidence dictionary
Dictionary<string, DictionaryProxy<int, string>> tmpEvidenceAllelesProxy = new Dictionary<string, DictionaryProxy<int, string>>();
foreach (string key in EvidenceAlleles.Keys)
{
Dictionary<int, string> curDict = EvidenceAlleles[key];
DictionaryProxy<int, string> tmpDict = new DictionaryProxy<int, string>(curDict);
tmpEvidenceAllelesProxy.Add(key, tmpDict);
}
EvidenceAllelesProxy = new DictionaryProxy<string, DictionaryProxy<int, string>>(tmpEvidenceAllelesProxy);
// copy the comparisons dictionary
Dictionary<int, DictionaryProxy<string, string>> tmpComparisonAllelesProxy = new Dictionary<int, DictionaryProxy<string, string>>();
foreach (int key in ComparisonAlleles.Keys)
{
Dictionary<string, string> curDict = ComparisonAlleles[key];
DictionaryProxy<string, string> tmpDict = new DictionaryProxy<string, string>(curDict);
tmpComparisonAllelesProxy.Add(key, tmpDict);
}
ComparisonAllelesProxy = new DictionaryProxy<int, DictionaryProxy<string, string>>(tmpComparisonAllelesProxy);
// copy the knowns dictionary
Dictionary<int, DictionaryProxy<string, string>> tmpKnownsAllelesProxy = new Dictionary<int, DictionaryProxy<string, string>>();
foreach (int key in KnownsAlleles.Keys)
{
Dictionary<string, string> curDict = KnownsAlleles[key];
DictionaryProxy<string, string> tmpDict = new DictionaryProxy<string, string>(curDict);
tmpKnownsAllelesProxy.Add(key, tmpDict);
}
KnownsAllelesProxy = new DictionaryProxy<int, DictionaryProxy<string, string>>(tmpKnownsAllelesProxy);
// copy the evidence
Dictionary<string, DictionaryProxy<int, string>> tmpEvidenceAllelesProxy = val.EvidenceAllelesProxy.ToDictionary();
foreach (string key in tmpEvidenceAllelesProxy.Keys)
{
Dictionary<int, string> curDict = tmpEvidenceAllelesProxy[key].ToDictionary();
val.EvidenceAlleles.Add(key, curDict);
}
// copy the comparisons
Dictionary<int, DictionaryProxy<string, string>> tmpComparisonAllelesProxy = val.ComparisonAllelesProxy.ToDictionary();
foreach (int key in tmpComparisonAllelesProxy.Keys)
{
Dictionary<string, string> curDict = tmpComparisonAllelesProxy[key].ToDictionary();
val.ComparisonAlleles.Add(key, curDict);
}
// copy the knowns
Dictionary<int, DictionaryProxy<string, string>> tmpKnownsAllelesProxy = val.KnownsAllelesProxy.ToDictionary();
foreach (int key in tmpKnownsAllelesProxy.Keys)
{
Dictionary<string, string> curDict = tmpKnownsAllelesProxy[key].ToDictionary();
val.KnownsAlleles.Add(key, curDict);
}
Copy-pasting is a powerful programming technique.
t. Rajesh