Exemplo n.º 1
0
        public object Convert(object seqObject, Type targetType, object parameter, CultureInfo culture)
        {
            iDnaSequence seq = seqObject as iDnaSequence;

            if (seq == null)
            {
                return(null);
            }

            return(seq.Min(i => i.Index) + "-" + seq.Max(i => i.Index));
        }
        private void SequenceNewRegionWindow_Loaded(object sender, RoutedEventArgs e)
        {
            iDnaSequence sequence = iDnaSequence.Instance;

            if (sequence == null)
            {
                return;
            }

            _newRegion       = new iDnaRegionIndex(sequence, "New region");
            this.DataContext = _newRegion;
        }
        private void buttonOk_Click(object sender, RoutedEventArgs e)
        {
            iDnaSequence sequence = iDnaSequence.Instance;

            if (sequence == null || _newRegion == null)
            {
                return;
            }

            if (!sequence.AddRegion(_newRegion))
            {
                MessageBox.Show("Sorry! could not add the defined region. Please check if its coordinates do not already exist",
                                "Add region", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            this.Close();
        }
Exemplo n.º 4
0
        private void buttonGotoPage_Click(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            if (button == null || button.DataContext == null)
            {
                return;
            }

            iDnaSequence seq = button.DataContext as iDnaSequence;

            if (seq == null || seq.Count <= 0)
            {
                return;
            }

            iDnaNode node = seq[0];

            iDnaSequence.Instance.GoToNodePage(node);
        }
Exemplo n.º 5
0
        private void buttonEditInfo_Click(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            if (button == null || button.DataContext == null)
            {
                return;
            }

            iDnaSequence seq = button.DataContext as iDnaSequence;

            if (seq == null || seq.Count <= 0)
            {
                return;
            }

            SequenceInfoWindow seqWnd = new SequenceInfoWindow()
            {
                DataContext = seq
            };

            seqWnd.Owner = Application.Current.MainWindow;
            seqWnd.ShowDialog();
        }