Ejemplo n.º 1
0
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (!Routines.ValidateConverterInput(values))
            {
                return(null);
            }

            string sequence = (string)values[0];

            int[] alignedPositions = (int[])values[1];
            int   alignmentLength  = (int)values[2];

            string alignedSequence = Alignment.ToAlignedSequence(sequence, alignedPositions, alignmentLength);

            return(alignedSequence);
        }
Ejemplo n.º 2
0
        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            if (!Routines.ValidateConverterInput(value))
            {
                return(null);
            }

            string alignedSequence = (string)value;

            int[] alignedPositions;

            string sequence = Alignment.ToSequence(alignedSequence, out alignedPositions);

            object[] returnArray = new object[3];

            returnArray[0] = sequence;
            returnArray[1] = alignedPositions;
            returnArray[2] = alignedSequence.Length;

            return(returnArray);
        }