/// <summary> /// Sort the index of SequenceAlignmentMap by QName. /// Fill the index (sorted by QName) into a list, when the list size reaches /// the maximum limit, write the list to file and clear the list. /// </summary> private IList <string> SortByReadNames() { IList <string> files = new List <string>(); var sortedList = new System.Collections.Generic.SortedList <object, string>(); for (int index = 0; index < sequenceAlignMap.QuerySequences.Count; index++) { SAMAlignedSequence alignedSeq = sequenceAlignMap.QuerySequences[index]; string indices = string.Empty; if (!sortedList.TryGetValue(alignedSeq.QName, out indices)) { sortedList.Add(alignedSeq.QName, index.ToString(CultureInfo.InvariantCulture)); } else { indices = string.Format(CultureInfo.InvariantCulture, "{0},{1}", indices, index.ToString(CultureInfo.InvariantCulture)); sortedList[alignedSeq.QName] = indices; } if (sortedList.Count >= SortedListMaxCount) { if (files == null) { files = new List <string>(); } files.Add(WriteToFile(sortedList)); sortedList.Clear(); } } if (sortedList.Count > 0) { files.Add(WriteToFile(sortedList)); sortedList.Clear(); } return(files); }
public void Close() { adler32 = 0; header_size = 0; filetime = 0; foreach (System.Collections.Generic.KeyValuePair <string, Kom2SubFile> KeyValue in subfiles) { KeyValue.Value.Close(); } subfiles.Clear(); ecb = null; komtype = EKomType.notkom; }
public void Clear() { items.Clear(); }
/// <summary> /// Clears the collection, i.e. removes all entries. /// </summary> public void Clear() { _list.Clear(); }
/// <summary> /// Sort the index of SequenceAlignmentMap by QName. /// Fill the index (sorted by QName) into a list, when the list size reaches /// the maximum limit, write the list to file and clear the list. /// </summary> private IList<string> SortByReadNames() { IList<string> files = new List<string>(); var sortedList = new System.Collections.Generic.SortedList<object,string>(); for (int index = 0; index < sequenceAlignMap.QuerySequences.Count; index++) { SAMAlignedSequence alignedSeq = sequenceAlignMap.QuerySequences[index]; string indices = string.Empty; if (!sortedList.TryGetValue(alignedSeq.QName, out indices)) { sortedList.Add(alignedSeq.QName, index.ToString(CultureInfo.InvariantCulture)); } else { indices = string.Format(CultureInfo.InvariantCulture, "{0},{1}", indices, index.ToString(CultureInfo.InvariantCulture)); sortedList[alignedSeq.QName] = indices; } if (sortedList.Count >= SortedListMaxCount) { if (files == null) { files = new List<string>(); } files.Add(WriteToFile(sortedList)); sortedList.Clear(); } } if (sortedList.Count > 0) { files.Add(WriteToFile(sortedList)); sortedList.Clear(); } return files; }
private ITypedElement GetResourceNavigator(out EvaluationContext evalContext) { string parseErrors2; var inputNavDSTU2 = FhirPathProcessor.GetResourceNavigatorDSTU2(textboxInputXML.Text, out parseErrors2); string parseErrors3; var inputNavSTU3 = FhirPathProcessor.GetResourceNavigatorSTU3(textboxInputXML.Text, out parseErrors3); string parseErrors4; var inputNavR4 = FhirPathProcessor.GetResourceNavigatorR4(textboxInputXML.Text, out parseErrors4); if (!string.IsNullOrEmpty(parseErrors2) || !string.IsNullOrEmpty(parseErrors3) || !string.IsNullOrEmpty(parseErrors4)) { ResetResults(); AppendResults(String.Join("\r\n--------------------\r\n", parseErrors2, parseErrors3, parseErrors4), true); } if (inputNavR4 != null || inputNavSTU3 != null || inputNavDSTU2 != null) { ISourceNode node; if (textboxInputXML.Text.StartsWith("{")) { node = Hl7.Fhir.Serialization.FhirJsonNode.Parse(textboxInputXML.Text); } else { node = Hl7.Fhir.Serialization.FhirXmlNode.Parse(textboxInputXML.Text); } _locations.Clear(); int lastPos = 0; IPositionInfo lastNode = null; AddLocations(node, ref lastNode, ref lastPos, textboxInputXML.Text.ToCharArray()); string t = _locations.LastOrDefault(c => c.Key < textboxInputXML.SelectionStart).Value; System.Diagnostics.Trace.WriteLine($"Focused: {t}"); } if (inputNavR4 != null) { btnR4.Visibility = Visibility.Visible; } else { btnR4.Visibility = Visibility.Collapsed; } if (inputNavSTU3 != null) { btnSTU3.Visibility = Visibility.Visible; } else { btnSTU3.Visibility = Visibility.Collapsed; } if (inputNavDSTU2 != null) { btnDSTU2.Visibility = Visibility.Visible; } else { btnDSTU2.Visibility = Visibility.Collapsed; } if (inputNavR4 != null) { evalContext = new fp4.FhirEvaluationContext(inputNavR4); return(inputNavR4); } if (inputNavSTU3 != null) { evalContext = new fp3.FhirEvaluationContext(inputNavSTU3); return(inputNavSTU3); } evalContext = new fp2.FhirEvaluationContext(inputNavDSTU2); return(inputNavDSTU2); }