本文整理汇总了C#中ISequence.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# ISequence.ToArray方法的具体用法?C# ISequence.ToArray怎么用?C# ISequence.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISequence
的用法示例。
在下文中一共展示了ISequence.ToArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Sequence
/// <summary>
/// Initializes a new instance of the Sequence class with passed new Sequence. Creates a copy of the sequence.
/// </summary>
/// <param name="newSequence">The New sequence for which the copy has to be made.</param>
public Sequence(ISequence newSequence)
{
if (newSequence == null)
{
throw new ArgumentNullException("newSequence");
}
this.ID = newSequence.ID;
this.Alphabet = newSequence.Alphabet;
this.Count = newSequence.Count;
this._metadata = new Dictionary<string, object>(newSequence.Metadata);
Sequence realSequence = newSequence as Sequence;
if (realSequence != null)
{
this._sequenceData = new byte[newSequence.Count];
Helper.Copy(realSequence._sequenceData, this._sequenceData, realSequence._sequenceData.GetLongLength());
}
else
{
this._sequenceData = newSequence.ToArray();
}
}
示例2: FixedSequenceGroup
/// <summary> </summary>
/// <param name="sequences">sequences the list of sequences to be tracked under this sequence group</param>
public FixedSequenceGroup(ISequence[] sequences)
{
_sequences = sequences.ToArray();
}
示例3: GetByteArrayFromSequence
/// <summary>
/// Retrieve or copy the sequence array
/// </summary>
/// <param name="sequence"></param>
/// <returns></returns>
private static byte[] GetByteArrayFromSequence(ISequence sequence)
{
var realSequence = sequence as Sequence;
return realSequence != null
// Very fast grab internal array
? realSequence.GetInternalArray()
// Much slower copy
: sequence.ToArray();
}