Пример #1
0
        public UpdateConfigConflictViewModelBase(ConflictRuleViewModel viewModel)
        {
            m_conflictRuleViewModel = viewModel;

            m_configuration        = m_conflictRuleViewModel.AppViewModel.Config;
            m_session              = m_configuration.SessionGroup.Sessions.Session.First(x => m_conflictRuleViewModel.RTConflict.ScopeId.Equals(new Guid(x.SessionUniqueId)));
            m_customSettings       = new SerializableCustomSettings(m_session);
            m_cachedCustomSettings = m_customSettings.Serialize();

            m_properties = m_conflictRuleViewModel.MigrationConflict.ConflictDetailsProperties;

            string str;

            HasProperties = !m_properties.TryGetValue(ConflictDetailsProperties.DefaultConflictDetailsKey, out str);
        }
Пример #2
0
        public void SetConflictRuleViewModel(ConflictRuleViewModel viewModel)
        {
            m_conflictRuleViewModel = viewModel;

            Configuration config  = m_conflictRuleViewModel.AppViewModel.Config;
            Session       session = config.SessionGroup.Sessions.Session.First(x => m_conflictRuleViewModel.RTConflict.ScopeId.Equals(new Guid(x.SessionUniqueId)));

            m_customSettings = new SerializableCustomSettings(session);
            customSettingsView.DataContext = m_customSettings;
            m_oldCustomSettings            = m_customSettings.Serialize();

            Debug.Assert(session.Filters.FilterPair.Count() == 1, string.Format("More than one filter pair exists for session {0}", session.FriendlyName));
            FilterPair filterPair = session.Filters.FilterPair.First();

            m_filterItem = filterPair.FilterItem.FirstOrDefault(x => m_conflictRuleViewModel.SourceId.Equals(new Guid(x.MigrationSourceUniqueId)));
            Debug.Assert(m_filterItem != null, string.Format("FilterItem could not be found for migration source {0}", m_conflictRuleViewModel.SourceId));
            newValueTextBox.Text = m_filterItem.FilterString;
        }