public bool TryResolveConflict(RTConflict conflict, Guid resolutionActionGuid, string applicableScope, Dictionary <string, string> dataFields) { TraceManager.TraceInformation("ConflictResolver: TryResolveConflict {0} with action: {1} and scope: {2} ", conflict.ConflictType.FriendlyName, resolutionActionGuid, applicableScope); IEnumerable <ConflictResolutionResult> resolutionResults = new List <ConflictResolutionResult>(); return(m_conflictResolver.TryResolveConflict(conflict, resolutionActionGuid, applicableScope, dataFields, out resolutionResults)); }
// Resolves the given conflict with the provided resolution action GUID and scope public bool TryResolveConflict(RTConflict conflict, Guid resolutionActionGuid, string applicableScope, out IEnumerable <ConflictResolutionResult> resolutionResults) { ConflictRuleViewModel conflictModel = new ConflictRuleViewModel(conflict, m_model); conflictModel.SelectedResolutionAction = conflictModel.ResolutionActions.Where(x => x.ReferenceName.Equals(resolutionActionGuid)).Single(); conflictModel.Scope = applicableScope; resolutionResults = conflictModel.Save(); return(resolutionResults.Where(x => !x.Resolved).Count() == 0); }
// Resolves the given conflict with the provided resolution action and scope public bool TryResolveConflict(RTConflict conflict, ResolutionAction resolutionAction, string applicableScope, out IEnumerable <ConflictResolutionResult> resolutionResults) { ConflictRuleViewModel conflictModel = new ConflictRuleViewModel(conflict, m_model); conflictModel.SelectedResolutionAction = resolutionAction; conflictModel.Scope = applicableScope; resolutionResults = conflictModel.Save(); return(resolutionResults.Where(x => !x.Resolved).Count() == 0); }
// Resolves the given conflict with the provided resolution action GUID ,scope and data fields public bool TryResolveConflict(RTConflict conflict, Guid resolutionActionGuid, string applicableScope, Dictionary <string, string> dataFields, out IEnumerable <ConflictResolutionResult> resolutionResults) { ConflictRuleViewModel conflictModel = new ConflictRuleViewModel(conflict, m_model); conflictModel.SelectedResolutionAction = conflictModel.ResolutionActions.Where(x => x.ReferenceName.Equals(resolutionActionGuid)).Single(); conflictModel.Scope = applicableScope; foreach (ObservableDataField dataField in conflictModel.ObservableDataFields) { dataField.FieldValue = dataFields[dataField.FieldName]; } resolutionResults = conflictModel.Save(); return(resolutionResults.Where(x => !x.Resolved).Count() == 0); }
public ConflictRuleViewModel(RTConflict conflict, ApplicationViewModel appViewModel) : base(appViewModel) { m_conflict = conflict; base.Scope = m_conflict.ScopeHint; int migrationSourceId = (int)m_conflict.SourceSideMigrationSourceReference.EntityKey.EntityKeyValues.First().Value; if (!s_migrationSourceTable.ContainsKey(migrationSourceId)) { lock (s_migrationSourceTable) { if (!s_migrationSourceTable.ContainsKey(migrationSourceId)) { m_conflict.SourceSideMigrationSourceReference.Load(); s_migrationSourceTable.Add(migrationSourceId, m_conflict.SourceSideMigrationSource); } } } m_rtMigrationSource = s_migrationSourceTable[migrationSourceId]; int conflictTypeId = (int)m_conflict.ConflictTypeReference.EntityKey.EntityKeyValues.First().Value; if (!s_conflictTypeTable.ContainsKey(conflictTypeId)) { lock (s_conflictTypeTable) { if (!s_conflictTypeTable.ContainsKey(conflictTypeId)) { m_conflict.ConflictTypeReference.Load(); s_conflictTypeTable.Add(conflictTypeId, m_conflict.ConflictType); } } } SetConflictManager(m_conflict.ScopeId, m_rtMigrationSource.UniqueId, s_conflictTypeTable[conflictTypeId].ReferenceName); }
public ConflictViewModel(RTConflict conflict) { m_conflict = conflict; m_host = RuntimeManager.GetInstance(); }