Beispiel #1
0
 private void loadComparison()
 {
     Comparison blank = new Comparison(this.refId, this.queryId);
     if (this.noteHolders.ContainsKey(blank))
     {
         this.currentComparison = noteHolders[blank];
     }
     else
     {
         this.currentComparison = blank;
     }
     this.notesBox.Text = "";
     this.notesBox.IsEnabled = false;
 }
Beispiel #2
0
        private void loadNotesFrom(string filename)
        {
            using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read))
            {
                XDocument doc = XDocument.Load(fs);
                XElement root = doc.Root;

                //Load sequence files
                var filesElement = root.Element(XName.Get("Files"));
                string[] files = filesElement.Value.Split(System.Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries );
                loadFiles(files);

                //Load sequence notes
                foreach (var notesEl in root.Elements(XName.Get("Notes")))
                {
                    Comparison comp = new Comparison(
                        notesEl.Attribute(XName.Get("reference")).Value,
                        notesEl.Attribute(XName.Get("query")).Value);

                    foreach (var noteEl in notesEl.Elements(XName.Get("Note")))
                    {
                        int index = Int32.Parse(noteEl.Attribute(XName.Get("mismatch")).Value);
                        comp.MakeNote(index, noteEl.Value);
                    }

                    if (noteHolders.ContainsKey(comp))
                    {
                        noteHolders[comp] = comp;
                    }
                    else
                    {
                        noteHolders.Add(comp, comp);
                    }
                }
            }
        }