Ejemplo n.º 1
0
        private void rightFilterStringButton_Click(object sender, RoutedEventArgs e)
        {
            FilterPairViewModel filterPair = (sender as FrameworkElement).DataContext as FilterPairViewModel;

            Debug.Assert(filterPair.RightFilterStringExtension != null);
            if (filterPair.RightFilterStringExtension != null && filterPair.RightMigrationSource != null)
            {
                filterPair.RightFilterStringExtension.Command(filterPair.RightFilterItem, filterPair.RightMigrationSource);
            }
        }
Ejemplo n.º 2
0
        public void AddFilterPair(SerializableSession serializableSession)
        {
            Session session = serializableSession.Model;

            FilterItem leftItem = new FilterItem();

            leftItem.MigrationSourceUniqueId = session.LeftMigrationSourceUniqueId;
            FilterItem rightItem = new FilterItem();

            rightItem.MigrationSourceUniqueId = session.RightMigrationSourceUniqueId;

            string leftSourceIdentifier  = MigrationSources.First(x => string.Equals(x.InternalUniqueId, session.LeftMigrationSourceUniqueId, StringComparison.OrdinalIgnoreCase)).SourceIdentifier;
            string rightSourceIdentifier = MigrationSources.First(x => string.Equals(x.InternalUniqueId, session.RightMigrationSourceUniqueId, StringComparison.OrdinalIgnoreCase)).SourceIdentifier;

            switch (session.SessionType)
            {
            case SessionTypeEnum.VersionControl:
                FilterPairViewModel existingFilterPair = serializableSession.DefaultFilterPair;
                if (existingFilterPair != null)
                {
                    leftItem.FilterString  = existingFilterPair.LeftFilterStringExtension.VCFilterStringPrefix + leftSourceIdentifier;
                    rightItem.FilterString = existingFilterPair.RightFilterStringExtension.VCFilterStringPrefix + rightSourceIdentifier;
                }
                else
                {
                    leftItem.FilterString  = string.Empty;
                    rightItem.FilterString = string.Empty;
                }
                break;

            case SessionTypeEnum.WorkItemTracking:
                leftItem.FilterString  = string.Empty;
                rightItem.FilterString = string.Empty;
                break;
            }

            FilterPair newFilterPair = new FilterPair();

            newFilterPair.FilterItem.Add(leftItem);
            newFilterPair.FilterItem.Add(rightItem);

            session.Filters.FilterPair.Add(newFilterPair);

            RefreshFilterStrings();
        }
Ejemplo n.º 3
0
        private void deleteFilterButton_Click(object sender, RoutedEventArgs e)
        {
            FilterPairViewModel filterPair = (sender as FrameworkElement).DataContext as FilterPairViewModel;

            m_configuration.RemoveFilterPair(filterPair.FilterPair);
        }