Cleanup

Cleanup

--- BismNormalizer/TabularCompare/TabularMetadata/Comparison.cs
+++ BismNormalizer/TabularCompare/TabularMetadata/Comparison.cs
@@ -82,40 +82,6 @@
                     ComparisonObject comparisonObjectConnection = new ComparisonObject(ComparisonObjectType.Connection, ComparisonObjectStatus.MissingInTarget, connectionSource, null, MergeAction.Create);
                     _comparisonObjects.Add(comparisonObjectConnection);
                     _comparisonObjectCount += 1;
-
-                    #region Tables for Connection that is Missing in Target (to be created in target)
-
-                    foreach (Table tblSource in _sourceTabularModel.Tables.FilterByConnection(connectionSource.TomConnection))
-                    {
-                        ComparisonObject comparisonObjectTable = new ComparisonObject(ComparisonObjectType.Table, ComparisonObjectStatus.MissingInTarget, tblSource, null, MergeAction.Create);
-                        comparisonObjectConnection.ChildComparisonObjects.Add(comparisonObjectTable);
-                        _comparisonObjectCount += 1;
-
-                        #region Relationships for Table that is Missing in Target
-
-                        foreach (Relationship relSource in tblSource.Relationships)
-                        {
-                            ComparisonObject comparisonObjectRelation = new ComparisonObject(ComparisonObjectType.Relationship, ComparisonObjectStatus.MissingInTarget, relSource, null, MergeAction.Create);
-                            comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectRelation);
-                            _comparisonObjectCount += 1;
-                        }
-
-                        #endregion
-
-                        #region Measures / KPIs for Table that is Missing in Target
-
-                        foreach (Measure measureSource in tblSource.Measures.FilterByTableName(tblSource.Name))
-                        {
-                            ComparisonObjectType comparisonObjectType = measureSource.IsKpi ? ComparisonObjectType.Kpi : ComparisonObjectType.Measure;
-                            ComparisonObject comparisonObjectMeasure = new ComparisonObject(comparisonObjectType, ComparisonObjectStatus.MissingInTarget, measureSource, null, MergeAction.Create);
-                            comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectMeasure);
-                            _comparisonObjectCount += 1;
-                        }
-
-                        #endregion
-                    }
-
-                    #endregion
                 }
                 else
                 {
@@ -137,26 +103,6 @@
                         _comparisonObjects.Add(comparisonObjectConnection);
                         _comparisonObjectCount += 1;
                     }
-
-                    #region Tables where source/target connections exist
-
-                    foreach (Table tblSource in _sourceTabularModel.Tables.FilterByConnection(connectionSource.TomConnection))
-                    {
-                        // check if source is not in target
-                        TableCollection targetTablesForComparison = _targetTabularModel.Tables.FilterByConnection(connectionTarget.TomConnection);
-
-                        CompareSourceTableToTargetTables(comparisonObjectConnection.ChildComparisonObjects, tblSource, targetTablesForComparison);
-                    }
-
-                    foreach (Table tblTarget in _targetTabularModel.Tables.FilterByConnection(connectionTarget.TomConnection))
-                    {
-                        // check if target is not in source
-                        if (!_sourceTabularModel.Tables.FilterByConnection(connectionSource.TomConnection).ContainsName(tblTarget.Name))
-                        {
-                            CaptureTargetTableMissingInSource(comparisonObjectConnection.ChildComparisonObjects, tblTarget);
-                        }
-                    }
-                    #endregion
                 }
             }

@@ -168,36 +114,196 @@
                     ComparisonObject comparisonObjectConnection = new ComparisonObject(ComparisonObjectType.Connection, ComparisonObjectStatus.MissingInSource, null, connectionTarget, MergeAction.Delete);
                     _comparisonObjects.Add(comparisonObjectConnection);
                     _comparisonObjectCount += 1;
-
-                    #region Tables for Connection that is Missing in Source
-
-                    foreach (Table tableTarget in _targetTabularModel.Tables.FilterByConnection(connectionTarget.TomConnection))
-                    {
-                        CaptureTargetTableMissingInSource(comparisonObjectConnection.ChildComparisonObjects, tableTarget);
+                }
+            }
+
+            #endregion
+
+            #region Tables
+
+            foreach (Table tblSource in _sourceTabularModel.Tables)
+            {
+                // check if source is not in target
+                TableCollection targetTablesForComparison = _targetTabularModel.Tables;
+
+                if (!targetTablesForComparison.ContainsName(tblSource.Name))
+                {
+                    ComparisonObject comparisonObjectTable = new ComparisonObject(ComparisonObjectType.Table, ComparisonObjectStatus.MissingInTarget, tblSource, null, MergeAction.Create);
+                    _comparisonObjects.Add(comparisonObjectTable);
+                    _comparisonObjectCount += 1;
+
+                    #region Relationships for table Missing in Target
+
+                    // all relationships in source are not in target (the target table doesn't even exist)
+                    foreach (Relationship relSource in tblSource.Relationships)
+                    {
+                        ComparisonObject comparisonObjectRelation = new ComparisonObject(ComparisonObjectType.Relationship, ComparisonObjectStatus.MissingInTarget, relSource, null, MergeAction.Create);
+                        comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectRelation);
+                        _comparisonObjectCount += 1;
                     }

                     #endregion
-                }
-            }
-
-            #endregion
-
-            #region Calculated tables (don't have a connection)
-
-            foreach (Table tblSource in _sourceTabularModel.Tables.WithoutConnection(_sourceTabularModel.TomDatabase.Model))
-            {
-                // check if source is not in target
-                TableCollection targetTablesForComparison = _targetTabularModel.Tables.WithoutConnection(_targetTabularModel.TomDatabase.Model);
-
-                CompareSourceTableToTargetTables(_comparisonObjects, tblSource, targetTablesForComparison);
-            }
-
-            foreach (Table tblTarget in _targetTabularModel.Tables.WithoutConnection(_targetTabularModel.TomDatabase.Model))
+
+                    #region Measures / KPIs for Table that is Missing in Target
+
+                    foreach (Measure measureSource in tblSource.Measures.FilterByTableName(tblSource.Name))
+                    {
+                        ComparisonObjectType comparisonObjectType = measureSource.IsKpi ? ComparisonObjectType.Kpi : ComparisonObjectType.Measure;
+                        ComparisonObject comparisonObjectMeasure = new ComparisonObject(comparisonObjectType, ComparisonObjectStatus.MissingInTarget, measureSource, null, MergeAction.Create);
+                        comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectMeasure);
+                        _comparisonObjectCount += 1;
+                    }
+
+                    #endregion
+                }
+                else
+                {
+                    //table name is in source and target
+
+                    Table tblTarget = _targetTabularModel.Tables.FindByName(tblSource.Name);
+                    ComparisonObject comparisonObjectTable;
+
+                    if (tblSource.ObjectDefinition == tblTarget.ObjectDefinition)
+                    {
+                        comparisonObjectTable = new ComparisonObject(ComparisonObjectType.Table, ComparisonObjectStatus.SameDefinition, tblSource, tblTarget, MergeAction.Skip);
+                        _comparisonObjects.Add(comparisonObjectTable);
+                        _comparisonObjectCount += 1;
+                    }
+                    else
+                    {
+                        comparisonObjectTable = new ComparisonObject(ComparisonObjectType.Table, ComparisonObjectStatus.DifferentDefinitions, tblSource, tblTarget, MergeAction.Update);
+                        _comparisonObjects.Add(comparisonObjectTable);
+                        _comparisonObjectCount += 1;
+                    }
+
+                    #region Relationships source/target tables exist
+
+                    foreach (Relationship relSource in tblSource.Relationships)
+                    {
+                        // check if source is not in target
+                        if (!tblTarget.Relationships.ContainsName(relSource.Name)) //Using Name, not InternalName in case internal name is different
+                        {
+                            ComparisonObject comparisonObjectRelation = new ComparisonObject(ComparisonObjectType.Relationship, ComparisonObjectStatus.MissingInTarget, relSource, null, MergeAction.Create);
+                            comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectRelation);
+                            _comparisonObjectCount += 1;
+                        }
+                        else
+                        {
+                            //relationship is in source and target
+
+                            Relationship relTarget = tblTarget.Relationships.FindByName(relSource.Name);
+                            ComparisonObject comparisonObjectRelationship;
+
+                            if (relSource.ObjectDefinition == relTarget.ObjectDefinition)
+                            {
+                                comparisonObjectRelationship = new ComparisonObject(ComparisonObjectType.Relationship, ComparisonObjectStatus.SameDefinition, relSource, relTarget, MergeAction.Skip);
+                                comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectRelationship);
+                                _comparisonObjectCount += 1;
+                            }
+                            else
+                            {
+                                comparisonObjectRelationship = new ComparisonObject(ComparisonObjectType.Relationship, ComparisonObjectStatus.DifferentDefinitions, relSource, relTarget, MergeAction.Update);
+                                comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectRelationship);
+                                _comparisonObjectCount += 1;
+                            }
+                        }
+                    }
+
+                    // see if relationships in target table that don't exist in source table
+                    foreach (Relationship relTarget in tblTarget.Relationships)
+                    {
+                        // check if source is not in target
+                        if (!tblSource.Relationships.ContainsName(relTarget.Name)) //Using Name, not InternalName in case internal name is different
+                        {
+                            ComparisonObject comparisonObjectRelation = new ComparisonObject(ComparisonObjectType.Relationship, ComparisonObjectStatus.MissingInSource, null, relTarget, MergeAction.Delete);
+                            comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectRelation);
+                            _comparisonObjectCount += 1;
+                        }
+                    }
+
+                    #endregion
+
+                    #region Measures / KPIs (table in source and target)
+
+                    // see if matching measure in source and target
+                    foreach (Measure measureSource in tblSource.Measures.FilterByTableName(tblSource.Name))
+                    {
+                        ComparisonObjectType comparisonObjectType = measureSource.IsKpi ? ComparisonObjectType.Kpi : ComparisonObjectType.Measure;
+
+                        if (tblTarget.Measures.FilterByTableName(tblTarget.Name).ContainsName(measureSource.Name))
+                        {
+                            //Measure in source and target, so check definition
+                            Measure measureTarget = tblTarget.Measures.FilterByTableName(tblTarget.Name).FindByName(measureSource.Name);
+                            if (measureSource.ObjectDefinition == measureTarget.ObjectDefinition)
+                            {
+                                //Measure has same definition
+                                ComparisonObject comparisonObjectMeasure = new ComparisonObject(comparisonObjectType, ComparisonObjectStatus.SameDefinition, measureSource, measureTarget, MergeAction.Skip);
+                                comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectMeasure);
+                                _comparisonObjectCount += 1;
+                            }
+                            else
+                            {
+                                //Measure has different definition
+                                ComparisonObject comparisonObjectMeasure = new ComparisonObject(comparisonObjectType, ComparisonObjectStatus.DifferentDefinitions, measureSource, measureTarget, MergeAction.Update);
+                                comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectMeasure);
+                                _comparisonObjectCount += 1;
+                            }
+                        }
+                        else
+                        {
+                            ComparisonObject comparisonObjectMeasure = new ComparisonObject(comparisonObjectType, ComparisonObjectStatus.MissingInTarget, measureSource, null, MergeAction.Create);
+                            comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectMeasure);
+                            _comparisonObjectCount += 1;
+                        }
+                    }
+                    //now check if target contains measures Missing in Source
+                    foreach (Measure measureTarget in tblTarget.Measures.FilterByTableName(tblTarget.Name))
+                    {
+                        ComparisonObjectType comparisonObjectType = measureTarget.IsKpi ? ComparisonObjectType.Kpi : ComparisonObjectType.Measure;
+                        if (!tblSource.Measures.FilterByTableName(tblSource.Name).ContainsName(measureTarget.Name))
+                        {
+                            ComparisonObject comparisonObjectMeasure = new ComparisonObject(comparisonObjectType, ComparisonObjectStatus.MissingInSource, null, measureTarget, MergeAction.Delete);
+                            comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectMeasure);
+                            _comparisonObjectCount += 1;
+                        }
+                    }
+
+                    #endregion
+                }
+            }
+
+            foreach (Table tblTarget in _targetTabularModel.Tables)
             {
                 // check if target is not in source
-                if (!_sourceTabularModel.Tables.WithoutConnection(_sourceTabularModel.TomDatabase.Model).ContainsName(tblTarget.Name))
-                {
-                    CaptureTargetTableMissingInSource(_comparisonObjects, tblTarget);
+                if (!_sourceTabularModel.Tables.ContainsName(tblTarget.Name))
+                {
+                    ComparisonObject comparisonObjectTable = new ComparisonObject(ComparisonObjectType.Table, ComparisonObjectStatus.MissingInSource, null, tblTarget, MergeAction.Delete);
+                    _comparisonObjects.Add(comparisonObjectTable);
+                    _comparisonObjectCount += 1;
+
+                    #region Relationships for table Missing in Source
+
+                    // all relationships in target are not in source (the source table doesn't even exist)
+                    foreach (Relationship relTarget in tblTarget.Relationships)
+                    {
+                        ComparisonObject comparisonObjectRelation = new ComparisonObject(ComparisonObjectType.Relationship, ComparisonObjectStatus.MissingInSource, null, relTarget, MergeAction.Delete);
+                        comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectRelation);
+                        _comparisonObjectCount += 1;
+                    }
+
+                    #endregion
+
+                    #region Measures for Table that is Missing in Source
+
+                    foreach (Measure measureTarget in tblTarget.Measures.FilterByTableName(tblTarget.Name))
+                    {
+                        ComparisonObjectType comparisonObjectType = measureTarget.IsKpi ? ComparisonObjectType.Kpi : ComparisonObjectType.Measure;
+                        ComparisonObject comparisonObjectMeasure = new ComparisonObject(ComparisonObjectType.Measure, ComparisonObjectStatus.MissingInSource, null, measureTarget, MergeAction.Delete);
+                        comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectMeasure);
+                        _comparisonObjectCount += 1;
+                    }
+
+                    #endregion
                 }
             }

@@ -424,189 +530,6 @@
             _lastSourceSchemaUpdate = _sourceTabularModel.TomDatabase.LastSchemaUpdate;
             _lastTargetSchemaUpdate = _targetTabularModel.TomDatabase.LastSchemaUpdate;
         }
-
-        #region Private methods for comparison
-
-        private void CompareSourceTableToTargetTables(List<Core.ComparisonObject> comparisonObjects, Table tblSource, TableCollection targetTables)
-        {
-            if (!targetTables.ContainsName(tblSource.Name))
-            {
-                ComparisonObject comparisonObjectTable = new ComparisonObject(ComparisonObjectType.Table, ComparisonObjectStatus.MissingInTarget, tblSource, null, MergeAction.Create);
-                comparisonObjects.Add(comparisonObjectTable);
-                _comparisonObjectCount += 1;
-
-                #region Relationships for table Missing in Target
-
-                // all relationships in source are not in target (the target table doesn't even exist)
-                foreach (Relationship relSource in tblSource.Relationships)
-                {
-                    ComparisonObject comparisonObjectRelation = new ComparisonObject(ComparisonObjectType.Relationship, ComparisonObjectStatus.MissingInTarget, relSource, null, MergeAction.Create);
-                    comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectRelation);
-                    _comparisonObjectCount += 1;
-                }
-
-                #endregion
-
-                #region Measures / KPIs for Table that is Missing in Target
-
-                foreach (Measure measureSource in tblSource.Measures.FilterByTableName(tblSource.Name))
-                {
-                    ComparisonObjectType comparisonObjectType = measureSource.IsKpi ? ComparisonObjectType.Kpi : ComparisonObjectType.Measure;
-                    ComparisonObject comparisonObjectMeasure = new ComparisonObject(comparisonObjectType, ComparisonObjectStatus.MissingInTarget, measureSource, null, MergeAction.Create);
-                    comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectMeasure);
-                    _comparisonObjectCount += 1;
-                }
-
-                #endregion
-            }
-            else
-            {
-                //table name is in source and target
-
-                Table tblTarget = _targetTabularModel.Tables.FindByName(tblSource.Name);
-                ComparisonObject comparisonObjectTable;
-
-                if (tblSource.ObjectDefinition == tblTarget.ObjectDefinition)
-                {
-                    comparisonObjectTable = new ComparisonObject(ComparisonObjectType.Table, ComparisonObjectStatus.SameDefinition, tblSource, tblTarget, MergeAction.Skip);
-                    comparisonObjects.Add(comparisonObjectTable);
-                    _comparisonObjectCount += 1;
-                }
-                else
-                {
-                    comparisonObjectTable = new ComparisonObject(ComparisonObjectType.Table, ComparisonObjectStatus.DifferentDefinitions, tblSource, tblTarget, MergeAction.Update);
-                    comparisonObjects.Add(comparisonObjectTable);
-                    _comparisonObjectCount += 1;
-                }
-
-                #region Relationships source/target tables exist
-
-                foreach (Relationship relSource in tblSource.Relationships)
-                {
-                    // check if source is not in target
-                    if (!tblTarget.Relationships.ContainsName(relSource.Name)) //Using Name, not InternalName in case internal name is different
-                    {
-                        ComparisonObject comparisonObjectRelation = new ComparisonObject(ComparisonObjectType.Relationship, ComparisonObjectStatus.MissingInTarget, relSource, null, MergeAction.Create);
-                        comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectRelation);
-                        _comparisonObjectCount += 1;
-                    }
-                    else
-                    {
-                        //relationship is in source and target
-
-                        Relationship relTarget = tblTarget.Relationships.FindByName(relSource.Name);
-                        ComparisonObject comparisonObjectRelationship;
-
-                        if (relSource.ObjectDefinition == relTarget.ObjectDefinition)
-                        {
-                            comparisonObjectRelationship = new ComparisonObject(ComparisonObjectType.Relationship, ComparisonObjectStatus.SameDefinition, relSource, relTarget, MergeAction.Skip);
-                            comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectRelationship);
-                            _comparisonObjectCount += 1;
-                        }
-                        else
-                        {
-                            comparisonObjectRelationship = new ComparisonObject(ComparisonObjectType.Relationship, ComparisonObjectStatus.DifferentDefinitions, relSource, relTarget, MergeAction.Update);
-                            comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectRelationship);
-                            _comparisonObjectCount += 1;
-                        }
-                    }
-                }
-
-                // see if relationships in target table that don't exist in source table
-                foreach (Relationship relTarget in tblTarget.Relationships)
-                {
-                    // check if source is not in target
-                    if (!tblSource.Relationships.ContainsName(relTarget.Name)) //Using Name, not InternalName in case internal name is different
-                    {
-                        ComparisonObject comparisonObjectRelation = new ComparisonObject(ComparisonObjectType.Relationship, ComparisonObjectStatus.MissingInSource, null, relTarget, MergeAction.Delete);
-                        comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectRelation);
-                        _comparisonObjectCount += 1;
-                    }
-                }
-
-                #endregion
-
-                #region Measures / KPIs (table in source and target)
-
-                // see if matching measure in source and target
-                foreach (Measure measureSource in tblSource.Measures.FilterByTableName(tblSource.Name))
-                {
-                    ComparisonObjectType comparisonObjectType = measureSource.IsKpi ? ComparisonObjectType.Kpi : ComparisonObjectType.Measure;
-
-                    if (tblTarget.Measures.FilterByTableName(tblTarget.Name).ContainsName(measureSource.Name))
-                    {
-                        //Measure in source and target, so check definition
-                        Measure measureTarget = tblTarget.Measures.FilterByTableName(tblTarget.Name).FindByName(measureSource.Name);
-                        if (measureSource.ObjectDefinition == measureTarget.ObjectDefinition)
-                        {
-                            //Measure has same definition
-                            ComparisonObject comparisonObjectMeasure = new ComparisonObject(comparisonObjectType, ComparisonObjectStatus.SameDefinition, measureSource, measureTarget, MergeAction.Skip);
-                            comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectMeasure);
-                            _comparisonObjectCount += 1;
-                        }
-                        else
-                        {
-                            //Measure has different definition
-                            ComparisonObject comparisonObjectMeasure = new ComparisonObject(comparisonObjectType, ComparisonObjectStatus.DifferentDefinitions, measureSource, measureTarget, MergeAction.Update);
-                            comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectMeasure);
-                            _comparisonObjectCount += 1;
-                        }
-                    }
-                    else
-                    {
-                        ComparisonObject comparisonObjectMeasure = new ComparisonObject(comparisonObjectType, ComparisonObjectStatus.MissingInTarget, measureSource, null, MergeAction.Create);
-                        comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectMeasure);
-                        _comparisonObjectCount += 1;
-                    }
-                }
-                //now check if target contains measures Missing in Source
-                foreach (Measure measureTarget in tblTarget.Measures.FilterByTableName(tblTarget.Name))
-                {
-                    ComparisonObjectType comparisonObjectType = measureTarget.IsKpi ? ComparisonObjectType.Kpi : ComparisonObjectType.Measure;
-                    if (!tblSource.Measures.FilterByTableName(tblSource.Name).ContainsName(measureTarget.Name))
-                    {
-                        ComparisonObject comparisonObjectMeasure = new ComparisonObject(comparisonObjectType, ComparisonObjectStatus.MissingInSource, null, measureTarget, MergeAction.Delete);
-                        comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectMeasure);
-                        _comparisonObjectCount += 1;
-                    }
-                }
-
-                #endregion
-            }
-        }
-
-        private void CaptureTargetTableMissingInSource(List<Core.ComparisonObject> comparisonObjects, Table tblTarget)
-        {
-            ComparisonObject comparisonObjectTable = new ComparisonObject(ComparisonObjectType.Table, ComparisonObjectStatus.MissingInSource, null, tblTarget, MergeAction.Delete);
-            comparisonObjects.Add(comparisonObjectTable);
-            _comparisonObjectCount += 1;
-
-            #region Relationships for table Missing in Source
-
-            // all relationships in target are not in source (the source table doesn't even exist)
-            foreach (Relationship relTarget in tblTarget.Relationships)
-            {
-                ComparisonObject comparisonObjectRelation = new ComparisonObject(ComparisonObjectType.Relationship, ComparisonObjectStatus.MissingInSource, null, relTarget, MergeAction.Delete);
-                comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectRelation);
-                _comparisonObjectCount += 1;
-            }
-
-            #endregion
-
-            #region Measures for Table that is Missing in Source
-
-            foreach (Measure measureTarget in tblTarget.Measures.FilterByTableName(tblTarget.Name))
-            {
-                ComparisonObjectType comparisonObjectType = measureTarget.IsKpi ? ComparisonObjectType.Kpi : ComparisonObjectType.Measure;
-                ComparisonObject comparisonObjectMeasure = new ComparisonObject(ComparisonObjectType.Measure, ComparisonObjectStatus.MissingInSource, null, measureTarget, MergeAction.Delete);
-                comparisonObjectTable.ChildComparisonObjects.Add(comparisonObjectMeasure);
-                _comparisonObjectCount += 1;
-            }
-
-            #endregion
-        }
-
-        #endregion

         /// <summary>
         /// Validate selection of actions to perform on target tabular model. Warnings and informational messages are provided by invoking ShowStatusMessageCallBack.
@@ -660,15 +583,15 @@
             // do deletions first to minimize chance of conflict
             foreach (ComparisonObject comparisonObject in _comparisonObjects)
             {
-                DeleteConnections(comparisonObject);
-            }
-            foreach (ComparisonObject comparisonObject in _comparisonObjects)
-            {
-                CreateConnections(comparisonObject);
-            }
-            foreach (ComparisonObject comparisonObject in _comparisonObjects)
-            {
-                UpdateConnections(comparisonObject);
+                DeleteConnection(comparisonObject);
+            }
+            foreach (ComparisonObject comparisonObject in _comparisonObjects)
+            {
+                CreateConnection(comparisonObject);
+            }
+            foreach (ComparisonObject comparisonObject in _comparisonObjects)
+            {
+                UpdateConnection(comparisonObject);
             }

             #endregion
@@ -677,17 +600,17 @@

             foreach (ComparisonObject comparisonObject in _comparisonObjects)
             {
-                DeleteExpressions(comparisonObject);
-            }
-
-            foreach (ComparisonObject comparisonObject in _comparisonObjects)
-            {
-                CreateExpressions(comparisonObject);
-            }
-
-            foreach (ComparisonObject comparisonObject in _comparisonObjects)
-            {
-                UpdateExpressions(comparisonObject);
+                DeleteExpression(comparisonObject);
+            }
+
+            foreach (ComparisonObject comparisonObject in _comparisonObjects)
+            {
+                CreateExpression(comparisonObject);
+            }
+
+            foreach (ComparisonObject comparisonObject in _comparisonObjects)
+            {
+                UpdateExpression(comparisonObject);
             }

             #endregion
@@ -697,15 +620,15 @@
             // do deletions first to minimize chance of conflict
             foreach (ComparisonObject comparisonObject in _comparisonObjects)
             {
-                DeleteTables(comparisonObject);
-            }
-            foreach (ComparisonObject comparisonObject in _comparisonObjects)
-            {
-                CreateTables(comparisonObject);
-            }
-            foreach (ComparisonObject comparisonObject in _comparisonObjects)
-            {
-                UpdateTables(comparisonObject);
+                DeleteTable(comparisonObject);
+            }
+            foreach (ComparisonObject comparisonObject in _comparisonObjects)
+            {
+                CreateTable(comparisonObject);
+            }
+            foreach (ComparisonObject comparisonObject in _comparisonObjects)
+            {
+                UpdateTable(comparisonObject);
             }

             #endregion
@@ -714,17 +637,26 @@

             foreach (ComparisonObject comparisonObject in _comparisonObjects)
             {
-                DeleteRelationships(comparisonObject);
-            }
-
-            foreach (ComparisonObject comparisonObject in _comparisonObjects)
-            {
-                CreateRelationships(comparisonObject, "");
-            }
-
-            foreach (ComparisonObject comparisonObject in _comparisonObjects)
-            {
-                UpdateRelationships(comparisonObject, "");
+                foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
+                {
+                    DeleteRelationship(comparisonObject);
+                }
+            }
+
+            foreach (ComparisonObject comparisonObject in _comparisonObjects)
+            {
+                foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
+                {
+                    CreateRelationship(comparisonObject, "");
+                }
+            }
+
+            foreach (ComparisonObject comparisonObject in _comparisonObjects)
+            {
+                foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
+                {
+                    UpdateRelationship(comparisonObject, "");
+                }
             }

             _targetTabularModel.ValidateRelationships();
@@ -735,17 +667,26 @@

             foreach (ComparisonObject comparisonObject in _comparisonObjects)
             {
-                DeleteMeasures(comparisonObject);
-            }
-
-            foreach (ComparisonObject comparisonObject in _comparisonObjects)
-            {
-                CreateMeasures(comparisonObject, "");
-            }
-
-            foreach (ComparisonObject comparisonObject in _comparisonObjects)
-            {
-                UpdateMeasures(comparisonObject, "");
+                foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
+                {
+                    DeleteMeasure(comparisonObject);
+                }
+            }
+
+            foreach (ComparisonObject comparisonObject in _comparisonObjects)
+            {
+                foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
+                {
+                    CreateMeasure(comparisonObject, "");
+                }
+            }
+
+            foreach (ComparisonObject comparisonObject in _comparisonObjects)
+            {
+                foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
+                {
+                    UpdateMeasure(comparisonObject, "");
+                }
             }

             #endregion
@@ -878,12 +819,24 @@

         //Connections

-        private void DeleteConnections(ComparisonObject comparisonObject)
+        private void DeleteConnection(ComparisonObject comparisonObject)
         {
             if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Connection && comparisonObject.MergeAction == MergeAction.Delete)
             {
                 //Check any objects in target that depend on the connection are also going to be deleted
-                string warningObjectList = CheckToDependencies(comparisonObject, MDependencyObjectType.Connection, "");
+                string warningObjectList = CheckToDependenciesInTarget(comparisonObject, MDependencyObjectType.Connection, "");
+
+                //For old non-M partitions, check if any such tables have reference to this connection
+                foreach (Table table in _targetTabularModel.Tables)
+                {
+                    foreach (Partition partition in table.TomTable.Partitions)
+                    {
+                        if (partition.SourceType == PartitionSourceType.Query && table.ConnectionName == comparisonObject.TargetObjectName)
+                        {
+                            warningObjectList += $"Table {table.Name}/Partition {partition.Name}, ";
+                        }
+                    }
+                }

                 if (warningObjectList == "")
                 {
@@ -892,12 +845,12 @@
                 }
                 else
                 {
-                    OnValidationMessage(new ValidationMessageEventArgs($"Unable to delete connection {comparisonObject.TargetObjectName} because the following objects depend on it, and (considering changes) are not being deleted {warningObjectList.Substring(0, warningObjectList.Length - 2)}.", ValidationMessageType.Connection, ValidationMessageStatus.Warning));
-                }
-            }
-        }
-
-        private void CreateConnections(ComparisonObject comparisonObject)
+                    OnValidationMessage(new ValidationMessageEventArgs($"Unable to delete connection {comparisonObject.TargetObjectName} because the following object(s) depend on it, and (considering changes) are not being deleted {warningObjectList.Substring(0, warningObjectList.Length - 2)}.", ValidationMessageType.Connection, ValidationMessageStatus.Warning));
+                }
+            }
+        }
+
+        private void CreateConnection(ComparisonObject comparisonObject)
         {
             if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Connection && comparisonObject.MergeAction == MergeAction.Create)
             {
@@ -906,7 +859,7 @@
             }
         }

-        private void UpdateConnections(ComparisonObject comparisonObject)
+        private void UpdateConnection(ComparisonObject comparisonObject)
         {
             if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Connection && comparisonObject.MergeAction == MergeAction.Update)
             {
@@ -917,17 +870,17 @@

         //Expressions

-        private void DeleteExpressions(ComparisonObject comparisonObject)
+        private void DeleteExpression(ComparisonObject comparisonObject)
         {
             if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Expression && comparisonObject.MergeAction == MergeAction.Delete)
             {
                 //Check any objects in target that depend on the connection are also going to be deleted
-                string warningObjectList = CheckToDependencies(comparisonObject, MDependencyObjectType.Expression, "");
+                string warningObjectList = CheckToDependenciesInTarget(comparisonObject, MDependencyObjectType.Expression, "");

                 if (warningObjectList == "")
                 {
                     _targetTabularModel.DeleteExpression(comparisonObject.TargetObjectName);
-                    OnValidationMessage(new ValidationMessageEventArgs($"Delete Expresssion [{comparisonObject.TargetObjectName}].", ValidationMessageType.Expression, ValidationMessageStatus.Informational));
+                    OnValidationMessage(new ValidationMessageEventArgs($"Delete Expression [{comparisonObject.TargetObjectName}].", ValidationMessageType.Expression, ValidationMessageStatus.Informational));
                 }
                 else
                 {
@@ -936,31 +889,31 @@
             }
         }

-        private void CreateExpressions(ComparisonObject comparisonObject)
+        private void CreateExpression(ComparisonObject comparisonObject)
         {
             if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Expression && comparisonObject.MergeAction == MergeAction.Create)
             {
                 //Check any objects in source that this expression depends on are also going to be created if not already in target
-                string warningObjectList = CheckFromDependencies(comparisonObject, MDependencyObjectType.Expression, "");
+                string warningObjectList = CheckFromDependenciesInSource(comparisonObject, MDependencyObjectType.Expression, "");

                 if (warningObjectList == "")
                 {
                     _targetTabularModel.CreateExpression(_sourceTabularModel.Expressions.FindByName(comparisonObject.SourceObjectName).TomExpression);
-                    OnValidationMessage(new ValidationMessageEventArgs($"Create Expresssion [{comparisonObject.SourceObjectName}].", ValidationMessageType.Expression, ValidationMessageStatus.Informational));
+                    OnValidationMessage(new ValidationMessageEventArgs($"Create Expression [{comparisonObject.SourceObjectName}].", ValidationMessageType.Expression, ValidationMessageStatus.Informational));
                 }
                 else
                 {
-                    OnValidationMessage(new ValidationMessageEventArgs($"Unable to create expression {comparisonObject.SourceObjectName} because it depends on the following objects, which (considering changes) are missing and not being created {warningObjectList.Substring(0, warningObjectList.Length - 2)}.", ValidationMessageType.Expression, ValidationMessageStatus.Warning));
-                }
-            }
-        }
-
-        private void UpdateExpressions(ComparisonObject comparisonObject)
+                    OnValidationMessage(new ValidationMessageEventArgs($"Unable to create expression {comparisonObject.SourceObjectName} because it depends on the following objects, which (considering changes) are missing from target {warningObjectList.Substring(0, warningObjectList.Length - 2)}.", ValidationMessageType.Expression, ValidationMessageStatus.Warning));
+                }
+            }
+        }
+
+        private void UpdateExpression(ComparisonObject comparisonObject)
         {
             if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Expression && comparisonObject.MergeAction == MergeAction.Update)
             {
                 //Check any objects in source that this expression depends on are also going to be created if not already in target
-                string warningObjectList = CheckFromDependencies(comparisonObject, MDependencyObjectType.Expression, "");
+                string warningObjectList = CheckFromDependenciesInSource(comparisonObject, MDependencyObjectType.Expression, "");

                 if (warningObjectList == "")
                 {
@@ -969,14 +922,75 @@
                 }
                 else
                 {
-                    OnValidationMessage(new ValidationMessageEventArgs($"Unable to update expression {comparisonObject.TargetObjectName} because version from the source depends on the following objects, which (considering changes) are missing and not being created {warningObjectList.Substring(0, warningObjectList.Length - 2)}.", ValidationMessageType.Expression, ValidationMessageStatus.Warning));
+                    OnValidationMessage(new ValidationMessageEventArgs($"Unable to update expression {comparisonObject.TargetObjectName} because version from the source depends on the following objects, which (considering changes) are missing from target {warningObjectList.Substring(0, warningObjectList.Length - 2)}.", ValidationMessageType.Expression, ValidationMessageStatus.Warning));
+                }
+            }
+        }
+
+        //Tables
+
+        private void DeleteTable(ComparisonObject comparisonObject)
+        {
+            if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Table && comparisonObject.MergeAction == MergeAction.Delete)
+            {
+                _targetTabularModel.DeleteTable(comparisonObject.TargetObjectName);
+                OnValidationMessage(new ValidationMessageEventArgs($"Delete Table '{comparisonObject.TargetObjectName}'.", ValidationMessageType.Table, ValidationMessageStatus.Informational));
+            }
+        }
+
+        private void CreateTable(ComparisonObject comparisonObject)
+        {
+            if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Table && comparisonObject.MergeAction == MergeAction.Create)
+            {
+                Table sourceTable = _sourceTabularModel.Tables.FindByName(comparisonObject.SourceObjectName);
+                string warningObjectList = "";
+
+                foreach (Partition partition in sourceTable.TomTable.Partitions)
+                {
+                    //Check any objects in source that this partition depends on are also going to be created if not already in target
+                    warningObjectList = CheckFromDependenciesInSource(comparisonObject, MDependencyObjectType.Partition, "");
+                }
+
+                if (warningObjectList == "")
+                {
+                    _targetTabularModel.CreateTable(sourceTable);
+                    OnValidationMessage(new ValidationMessageEventArgs($"Create Table '{comparisonObject.SourceObjectName}'.", ValidationMessageType.Table, ValidationMessageStatus.Informational));
+                }
+                else
+                {
+                    OnValidationMessage(new ValidationMessageEventArgs($"Unable to create table {comparisonObject.SourceObjectName} because it depends on the following objects, which (considering changes) are missing from target {warningObjectList.Substring(0, warningObjectList.Length - 2)}.", ValidationMessageType.Table, ValidationMessageStatus.Warning));
+                }
+            }
+        }
+
+        private void UpdateTable(ComparisonObject comparisonObject)
+        {
+            if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Table && comparisonObject.MergeAction == MergeAction.Update)
+            {
+                Table sourceTable = _sourceTabularModel.Tables.FindByName(comparisonObject.SourceObjectName);
+                string warningObjectList = "";
+
+                foreach (Partition partition in sourceTable.TomTable.Partitions)
+                {
+                    //Check any objects in source that this partition depends on are also going to be created if not already in target
+                    warningObjectList = CheckFromDependenciesInSource(comparisonObject, MDependencyObjectType.Partition, "");
+                }
+
+                if (warningObjectList == "")
+                {
+                    _targetTabularModel.UpdateTable(sourceTable, _targetTabularModel.Tables.FindByName(comparisonObject.TargetObjectName));
+                    OnValidationMessage(new ValidationMessageEventArgs($"Update Table '{comparisonObject.TargetObjectName}'.", ValidationMessageType.Table, ValidationMessageStatus.Informational));
+                }
+                else
+                {
+                    OnValidationMessage(new ValidationMessageEventArgs($"Unable to update table {comparisonObject.TargetObjectName} because version from the source depends on the following objects, which (considering changes) are missing from target {warningObjectList.Substring(0, warningObjectList.Length - 2)}.", ValidationMessageType.Table, ValidationMessageStatus.Warning));
                 }
             }
         }

         //M Dependency checking

-        private string CheckToDependencies(ComparisonObject comparisonObject, MDependencyObjectType referencedObjectType, string warningObjectList)
+        private string CheckToDependenciesInTarget(ComparisonObject comparisonObject, MDependencyObjectType referencedObjectType, string warningObjectList)
         {
             //For deletion.
             //Check any objects in target that depend on this object are also going to be deleted.
@@ -984,54 +998,38 @@
             MDependencyCollection targetToDepdendencies = _targetTabularModel.MDependencies.DependenciesReferenceTo(referencedObjectType, comparisonObject.TargetObjectName);
             foreach (MDependency targetToDependency in targetToDepdendencies)
             {
-                switch (targetToDependency.ObjectType)
-                {
-                    case MDependencyObjectType.Expression:
-                        foreach (ComparisonObject comparisonObjectCheck in _comparisonObjects)
-                        {
-                            if (comparisonObjectCheck.ComparisonObjectType == ComparisonObjectType.Expression &&
-                                comparisonObjectCheck.TargetObjectName == targetToDependency.ObjectName &&
-                                comparisonObjectCheck.Status == ComparisonObjectStatus.MissingInSource &&
-                                comparisonObjectCheck.MergeAction == MergeAction.Skip)
+                foreach (ComparisonObject comparisonObjectToCheck in _comparisonObjects)
+                {
+                    switch (targetToDependency.ObjectType)
+                    {
+                        case MDependencyObjectType.Expression:
+                            if (comparisonObjectToCheck.ComparisonObjectType == ComparisonObjectType.Expression &&
+                                comparisonObjectToCheck.TargetObjectName == targetToDependency.ObjectName &&
+                                comparisonObjectToCheck.Status == ComparisonObjectStatus.MissingInSource &&
+                                comparisonObjectToCheck.MergeAction == MergeAction.Skip)
                             {
-                                warningObjectList += $"Expression {comparisonObjectCheck.TargetObjectName}, ";
+                                warningObjectList += $"Expression {comparisonObjectToCheck.TargetObjectName}, ";
                             }
-                        }
-                        break;
-                    case MDependencyObjectType.Partition:
-                        foreach (ComparisonObject comparisonObjectToCheck in _comparisonObjects)
-                        {
-                            warningObjectList = CheckPartitionToDependencies(comparisonObjectToCheck, targetToDependency, warningObjectList);
-                        }
-                        break;
-                    default:
-                        break;
+                            break;
+                        case MDependencyObjectType.Partition:
+                            if (comparisonObjectToCheck.ComparisonObjectType == ComparisonObjectType.Table &&
+                                comparisonObjectToCheck.TargetObjectName == targetToDependency.TableName &&
+                                comparisonObjectToCheck.Status == ComparisonObjectStatus.MissingInSource &&
+                                comparisonObjectToCheck.MergeAction == MergeAction.Skip)
+                            {
+                                warningObjectList += $"Table {comparisonObjectToCheck.TargetObjectName}/Partition {targetToDependency.ObjectName}, ";
+                            }
+                            break;
+                        default:
+                            break;
+                    }
                 }
             }

             return warningObjectList;
         }

-        private string CheckPartitionToDependencies(ComparisonObject comparisonObjectCheck, MDependency targetToDependency, string warningObjectList)
-        {
-            if (comparisonObjectCheck.ComparisonObjectType == ComparisonObjectType.Table &&
-                comparisonObjectCheck.TargetObjectName == targetToDependency.TableName &&
-                comparisonObjectCheck.Status == ComparisonObjectStatus.MissingInTarget &&
-                comparisonObjectCheck.MergeAction == MergeAction.Skip)
-            {
-                warningObjectList += $"Table {comparisonObjectCheck.TargetObjectName}/Partition {targetToDependency.ObjectName}, ";
-            }
-
-            foreach (ComparisonObject comparisonChildObjectCheck in comparisonObjectCheck.ChildComparisonObjects)
-            {
-                //Need a recursive call to cover tables extra level deep under connections
-                warningObjectList = CheckPartitionToDependencies(comparisonChildObjectCheck, targetToDependency, warningObjectList);
-            }
-
-            return warningObjectList;
-        }
-
-        private string CheckFromDependencies(ComparisonObject comparisonObject, MDependencyObjectType objectType, string warningObjectList)
+        private string CheckFromDependenciesInSource(ComparisonObject comparisonObject, MDependencyObjectType objectType, string warningObjectList)
         {
             //For creation and updates.
             //Check any objects in source that this object depends on are also going to be created if not already in target.
@@ -1039,110 +1037,43 @@
             MDependencyCollection sourceFromDepdendencies = _sourceTabularModel.MDependencies.DependenciesReferenceFrom(objectType, comparisonObject.SourceObjectName);
             foreach (MDependency sourceFromDependency in sourceFromDepdendencies)
             {
-                switch (sourceFromDependency.ReferencedObjectType)
-                {
-                    case MDependencyObjectType.Expression:
-                        if (!_targetTabularModel.Expressions.ContainsName(sourceFromDependency.ReferencedObjectName))
-                        {
-                            foreach (ComparisonObject comparisonObjectToCheck in _comparisonObjects)
+                foreach (ComparisonObject comparisonObjectToCheck in _comparisonObjects)
+                {
+                    switch (sourceFromDependency.ReferencedObjectType)
+                    {
+                        case MDependencyObjectType.Expression:
+                            if (!_targetTabularModel.Expressions.ContainsName(sourceFromDependency.ReferencedObjectName) &&
+                                comparisonObjectToCheck.ComparisonObjectType == ComparisonObjectType.Expression &&
+                                comparisonObjectToCheck.SourceObjectName == sourceFromDependency.ReferencedObjectName &&
+                                comparisonObjectToCheck.Status == ComparisonObjectStatus.MissingInTarget &&
+                                comparisonObjectToCheck.MergeAction == MergeAction.Skip)
                             {
-                                if (comparisonObjectToCheck.ComparisonObjectType == ComparisonObjectType.Expression &&
-                                    comparisonObjectToCheck.SourceObjectName == sourceFromDependency.ReferencedObjectName &&
-                                    comparisonObjectToCheck.Status == ComparisonObjectStatus.MissingInTarget &&
-                                    comparisonObjectToCheck.MergeAction == MergeAction.Skip)
-                                {
-                                    warningObjectList += $"Expression {comparisonObjectToCheck.SourceObjectName}, ";
-                                }
+                                warningObjectList += $"Expression {comparisonObjectToCheck.SourceObjectName}, ";
                             }
-                        }
-                        break;
-                    case MDependencyObjectType.Connection:
-                        if (!_targetTabularModel.Connections.ContainsName(sourceFromDependency.ReferencedObjectName))
-                        {
-                            foreach (ComparisonObject comparisonObjectToCheck in _comparisonObjects)
+                            break;
+                        case MDependencyObjectType.Connection:
+                            if (!_targetTabularModel.Connections.ContainsName(sourceFromDependency.ReferencedObjectName) &&
+                                comparisonObjectToCheck.ComparisonObjectType == ComparisonObjectType.Connection &&
+                                comparisonObjectToCheck.SourceObjectName == sourceFromDependency.ReferencedObjectName &&
+                                comparisonObjectToCheck.Status == ComparisonObjectStatus.MissingInTarget &&
+                                comparisonObjectToCheck.MergeAction == MergeAction.Skip)
                             {
-                                if (comparisonObjectToCheck.ComparisonObjectType == ComparisonObjectType.Connection &&
-                                    comparisonObjectToCheck.SourceObjectName == sourceFromDependency.ReferencedObjectName &&
-                                    comparisonObjectToCheck.Status == ComparisonObjectStatus.MissingInTarget &&
-                                    comparisonObjectToCheck.MergeAction == MergeAction.Skip)
-                                {
-                                    warningObjectList += $"Connection {comparisonObjectToCheck.SourceObjectName}, ";
-                                }
+                                warningObjectList += $"Connection {comparisonObjectToCheck.SourceObjectName}, ";
                             }
-                        }
-                        break;
-                    default:
-                        break;
+                            break;
+                        default:
+                            break;
+                    }
                 }
             }

             return warningObjectList;
         }

-        //Tables
-
-        private void DeleteTables(ComparisonObject comparisonObject)
-        {
-            foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
-            {
-                //tables with a connection will be extra level deep
-                DeleteTables(childComparisonObject);
-            }
-
-            if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Table && comparisonObject.MergeAction == MergeAction.Delete)
-            {
-                _targetTabularModel.DeleteTable(comparisonObject.TargetObjectName);
-                OnValidationMessage(new ValidationMessageEventArgs($"Delete Table '{comparisonObject.TargetObjectName}'.", ValidationMessageType.Table, ValidationMessageStatus.Informational));
-            }
-        }
-
-        private void CreateTables(ComparisonObject comparisonObject)
-        {
-            foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
-            {
-                //tables with a connection will be extra level deep
-                CreateTables(childComparisonObject);
-            }
-
-            if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Table && comparisonObject.MergeAction == MergeAction.Create)
-            {
-                Table tableTarget = _targetTabularModel.Tables.FindByName(comparisonObject.SourceObjectName);
-                if (tableTarget == null)
-                {
-                    _targetTabularModel.CreateTable(_sourceTabularModel.Tables.FindByName(comparisonObject.SourceObjectName));
-                    OnValidationMessage(new ValidationMessageEventArgs($"Create Table '{comparisonObject.SourceObjectName}'.", ValidationMessageType.Table, ValidationMessageStatus.Informational));
-                }
-                else
-                {
-                    OnValidationMessage(new ValidationMessageEventArgs($"Unable to create Table {comparisonObject.SourceObjectName} because another table with the same name (under a connection) already exists in target model.", ValidationMessageType.Table, ValidationMessageStatus.Warning));
-                }
-            }
-        }
-
-        private void UpdateTables(ComparisonObject comparisonObject)
-        {
-            foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
-            {
-                //tables with a connection will be extra level deep
-                UpdateTables(childComparisonObject);
-            }
-
-            if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Table && comparisonObject.MergeAction == MergeAction.Update)
-            {
-                _targetTabularModel.UpdateTable(_sourceTabularModel.Tables.FindByName(comparisonObject.SourceObjectName), _targetTabularModel.Tables.FindByName(comparisonObject.TargetObjectName));
-                OnValidationMessage(new ValidationMessageEventArgs($"Update Table '{comparisonObject.TargetObjectName}'.", ValidationMessageType.Table, ValidationMessageStatus.Informational));
-            }
-        }
-
         //Relationships

-        private void DeleteRelationships(ComparisonObject comparisonObject)
-        {
-            foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
-            {
-                DeleteRelationships(childComparisonObject);
-            }
-
+        private void DeleteRelationship(ComparisonObject comparisonObject)
+        {
             if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Relationship && comparisonObject.MergeAction == MergeAction.Delete)
             {
                 foreach (Table tableTarget in _targetTabularModel.Tables)
@@ -1161,13 +1092,8 @@
             }
         }

-        private void CreateRelationships(ComparisonObject comparisonObject, string tableName)
-        {
-            foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
-            {
-                CreateRelationships(childComparisonObject, comparisonObject.SourceObjectName);
-            }
-
+        private void CreateRelationship(ComparisonObject comparisonObject, string tableName)
+        {
             if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Relationship && comparisonObject.MergeAction == MergeAction.Create)
             {
                 Table tableSource = _sourceTabularModel.Tables.FindByName(tableName);
@@ -1187,13 +1113,8 @@
             }
         }

-        private void UpdateRelationships(ComparisonObject comparisonObject, string tableName)
-        {
-            foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
-            {
-                UpdateRelationships(childComparisonObject, comparisonObject.SourceObjectName);
-            }
-
+        private void UpdateRelationship(ComparisonObject comparisonObject, string tableName)
+        {
             if (comparisonObject.ComparisonObjectType == ComparisonObjectType.Relationship && comparisonObject.MergeAction == MergeAction.Update)
             {
                 Table tableSource = _sourceTabularModel.Tables.FindByName(tableName);
@@ -1215,15 +1136,10 @@

         //Measures / KPIs

-        private void DeleteMeasures(ComparisonObject comparisonObject)
-        {
-            foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
-            {
-                DeleteMeasures(childComparisonObject);
-            }
-
-            if ((comparisonObject.ComparisonObjectType == ComparisonObjectType.Measure || comparisonObject.ComparisonObjectType == ComparisonObjectType.Kpi) &&
-                 comparisonObject.MergeAction == MergeAction.Delete)
+        private void DeleteMeasure(ComparisonObject comparisonObject)
+        {
+            if ((comparisonObject.ComparisonObjectType == ComparisonObjectType.Measure || comparisonObject.ComparisonObjectType == ComparisonObjectType.Kpi) &&
+                    comparisonObject.MergeAction == MergeAction.Delete)
             {
                 foreach (Table tableTarget in _targetTabularModel.Tables)
                 {
@@ -1241,15 +1157,10 @@
             }
         }

-        private void CreateMeasures(ComparisonObject comparisonObject, string tableName)
-        {
-            foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
-            {
-                CreateMeasures(childComparisonObject, comparisonObject.SourceObjectName);
-            }
-
-            if ((comparisonObject.ComparisonObjectType == ComparisonObjectType.Measure || comparisonObject.ComparisonObjectType == ComparisonObjectType.Kpi) &&
-                 comparisonObject.MergeAction == MergeAction.Create)
+        private void CreateMeasure(ComparisonObject comparisonObject, string tableName)
+        {
+            if ((comparisonObject.ComparisonObjectType == ComparisonObjectType.Measure || comparisonObject.ComparisonObjectType == ComparisonObjectType.Kpi) &&
+                    comparisonObject.MergeAction == MergeAction.Create)
             {
                 foreach (Table tableInTarget in _targetTabularModel.Tables)
                 {
@@ -1272,15 +1183,10 @@
             }
         }

-        private void UpdateMeasures(ComparisonObject comparisonObject, string tableName)
-        {
-            foreach (ComparisonObject childComparisonObject in comparisonObject.ChildComparisonObjects)
-            {
-                UpdateMeasures(childComparisonObject, comparisonObject.SourceObjectName);
-            }
-
+        private void UpdateMeasure(ComparisonObject comparisonObject, string tableName)
+        {
             if ((comparisonObject.ComparisonObjectType == ComparisonObjectType.Measure || comparisonObject.ComparisonObjectType == ComparisonObjectType.Kpi) &&
-                 comparisonObject.MergeAction == MergeAction.Update)
+                    comparisonObject.MergeAction == MergeAction.Update)
             {
                 Table tableSource = _sourceTabularModel.Tables.FindByName(tableName);
                 Table tableTarget = _targetTabularModel.Tables.FindByName(tableName);


tweak email sender headers

tweak email sender headers

--- CMSBaseClasses/EmailSender.cs
+++ CMSBaseClasses/EmailSender.cs
@@ -11,6 +11,10 @@
 	public class EmailSender {

 		public Dictionary<string, string> ContentPlaceholders { get; set; }
+
+		private string CurrentDLLVersion {
+			get { return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); }
+		}

 		public string Recepient { get; set; }
 		public Control WebControl { get; set; }
@@ -47,11 +51,16 @@
 			}

 			MailMessage mailMessage = null;
+
 			if (!string.IsNullOrEmpty(Body)) {
 				mailMessage = mailDefinition.CreateMailMessage(Recepient, ContentPlaceholders, Body, WebControl);
 			} else {
 				mailMessage = mailDefinition.CreateMailMessage(Recepient, ContentPlaceholders, WebControl);
 			}
+
+			mailMessage.Priority = MailPriority.Normal;
+			mailMessage.Headers.Add("X-Application", "CarrotCake CMS " + CurrentDLLVersion);
+			mailMessage.Headers.Add("X-Originating-IP", HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString());

 			SmtpClient client = new SmtpClient();
 			if (!string.IsNullOrEmpty(SmtpPassword)) {


DCE support whitelisting proxy members

DCE support whitelisting proxy members

--- Compiler/Analyzers/DeadCodeAnalyzer/DeadCodeInfoProvider.cs
+++ Compiler/Analyzers/DeadCodeAnalyzer/DeadCodeInfoProvider.cs
@@ -39,26 +39,35 @@

         internal TypeInfoProvider TypeInfoProvider { get; set; }

-        public bool IsUsed(MemberReference member) {
+        public bool IsUsed(MemberReference member)
+        {
+            bool? retValue = null;
             var typeReference = member as TypeReference;
             if (typeReference != null)
             {
                 var defenition = typeReference.Resolve();
-                return types.Contains(defenition);
+                retValue= types.Contains(defenition);
             }

             var methodReference = member as MethodReference;
             if (methodReference != null) {
                 var defenition = methodReference.Resolve();
-                return methods.Contains(defenition);
+                retValue= methods.Contains(defenition);
             }

             var fieldReference = member as FieldReference;
             if (fieldReference != null) {
                 var defenition = fieldReference.Resolve();
-                return fields.Contains(defenition);
-            }
-
+                retValue= fields.Contains(defenition);
+            }
+            if (retValue.HasValue)
+            {
+                if (!retValue.Value)
+                {
+                    return IsMemberWhiteListed(member);
+                }
+                return true;
+            }
             throw new ArgumentException("Unexpected member reference type");
         }


Just goofing with syntax ideas for how to configure BusServices

Former-commit-id: efcb164c6d381955e2d933da1e59085b280e9c7c

--- Containers/MassTransit.WindsorIntegration/BuilderExample.cs
+++ Containers/MassTransit.WindsorIntegration/BuilderExample.cs
@@ -50,6 +50,22 @@
 					x.SetConcurrentConsumerLimit(20);
 					x.SendErrorsTo("msmq://localhost/mt_client_errors");

+					// create a shim between the main ServiceBus and the child service bus that is really constrained
+					// to provide simple control interface to the services on the bus
+//
+//					x.SetControlBus(c => c.ReceiveFrom("msmq://localhost/mt_client_control"));
+//
+//					x.ConfigureServices(services =>
+//						{
+//							SubscriptionClientConfigurator.New(y =>
+//								{
+//									y.SetSubscriptionServiceEndpoint("");
+//
+//								});
+//						});
+//
+
+
 					x.ConfigureService<SubscriptionClientConfigurator>(y => y.SetEndpoint("msmq://localhost/mt_pubsub"));
 					//x.ConfigureService<HealthClientConfigurator>(y => y.SetEndpoint("msmq://localhost/mt_pubsub"));


fix variantize (#9348)

fix variantize (#9348)

--- Content.Server/Administration/Commands/VariantizeCommand.cs
+++ Content.Server/Administration/Commands/VariantizeCommand.cs
@@ -26,7 +26,7 @@
         var entMan = IoCManager.Resolve<IEntityManager>();
         var random = IoCManager.Resolve<IRobustRandom>();

-        if (EntityUid.TryParse(args[0], out var euid))
+        if (!EntityUid.TryParse(args[0], out var euid))
         {
             shell.WriteError($"Failed to parse euid '{args[0]}'.");
             return;


Add examine message for minds whose player disconnected or ghosted.

--- Content.Server/GameObjects/Components/Mobs/MindComponent.cs
+++ Content.Server/GameObjects/Components/Mobs/MindComponent.cs
@@ -1,7 +1,10 @@
 using Content.Server.GameObjects.Components.Observer;
+using Content.Server.GameObjects.EntitySystems;
 using Content.Server.Mobs;
+using Content.Server.Players;
 using Robust.Shared.GameObjects;
 using Robust.Shared.Interfaces.GameObjects;
+using Robust.Shared.Utility;
 using Robust.Shared.ViewVariables;

 namespace Content.Server.GameObjects.Components.Mobs
@@ -10,7 +13,7 @@
     ///     Stores a <see cref="Server.Mobs.Mind"/> on a mob.
     /// </summary>
     [RegisterComponent]
-    public class MindComponent : Component
+    public class MindComponent : Component, IExamine
     {
         /// <inheritdoc />
         public override string Name => "Mind";
@@ -74,5 +77,14 @@
                 }
             }
         }
+
+        public void Examine(FormattedMessage message)
+        {
+            // TODO: Use gendered pronouns depending on the entity
+            if(!HasMind)
+                message.AddMarkup($"[color=red]They are totally catatonic. The stresses of life in deep-space must have been too much for them. Any recovery is unlikely.[/color]");
+            else if(Mind.Session == null)
+                message.AddMarkup("[color=yellow]They have a blank, absent-minded stare and appears completely unresponsive to anything. They may snap out of it soon.[/color]");
+        }
     }
 }


Improved logging for new turn

Improved logging for new turn

--- CS3450.TooRisky/model/Game.cs
+++ CS3450.TooRisky/model/Game.cs
@@ -231,8 +231,9 @@
                     return;
                 }
             }
-            GameLog.AddEvent(Players[CurrentPlayerNumber].Name + " has begun their turn");
             Players[CurrentPlayerNumber].SetReinforcments();
+            GameLog.AddEvent(Players[CurrentPlayerNumber].Name + " has begun their turn with " +
+                Players[CurrentPlayerNumber].UnitsToPlace.ToString() + " reinforcements");
         }
     }
 }


added request digest

added request digest

--- Core/OfficeDevPnP.Core/Utilities/Webhooks/WebhookUtility.cs
+++ Core/OfficeDevPnP.Core/Utilities/Webhooks/WebhookUtility.cs
@@ -82,6 +82,7 @@
                     string requestUrl = identifierUrl + "/" + SubscriptionsUrlPart;

                     HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, requestUrl);
+                    request.Headers.Add("X-RequestDigest", await context.GetRequestDigest());
                     request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                     if (!string.IsNullOrEmpty(accessToken))
                     {
@@ -177,6 +178,7 @@
                     string requestUrl = string.Format("{0}/{1}('{2}')", identifierUrl, SubscriptionsUrlPart, subscriptionId);

                     HttpRequestMessage request = new HttpRequestMessage(new HttpMethod("PATCH"), requestUrl);
+                    request.Headers.Add("X-RequestDigest", await context.GetRequestDigest());
                     request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                     if (!string.IsNullOrEmpty(accessToken))
                     {
@@ -237,7 +239,10 @@
                     string requestUrl = string.Format("{0}/{1}('{2}')", identifierUrl, SubscriptionsUrlPart, subscriptionId);

                     HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Delete, requestUrl);
+                    request.Headers.Add("X-RequestDigest", await context.GetRequestDigest());
                     request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
+
+
                     if (!string.IsNullOrEmpty(accessToken))
                     {
                         request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);


(GH-27) Corrected issue with uploading to Dsym

--- src/Cake.HockeyApp/Internal/HockeyAppClient.cs
+++ src/Cake.HockeyApp/Internal/HockeyAppClient.cs
@@ -101,14 +101,14 @@

             if (symbolFile != null)
             {
-                var isSupportedSymbols = file.FullPath.EndsWith(".dsym.zip")
-                                         || file.FullPath.EndsWith("mapping.txt");
+                var isSupportedSymbols = symbolFile.FullPath.EndsWith(".dsym.zip")
+                || symbolFile.FullPath.EndsWith("mapping.txt");

                 if (!isSupportedSymbols)
                 {
                     throw new ArgumentException(
                         "Symbols file needs to be of the following type: *.dsym.zip for iOS / OS X, or mapping.txt file for Android.",
-                        nameof(file));
+                        nameof(symbolFile));
                 }
             }


Use TestCases in TermTests

Use TestCases in TermTests

--- KenticoInspector.Core.Tests/TermTests.cs
+++ KenticoInspector.Core.Tests/TermTests.cs
@@ -1,5 +1,10 @@
 using System;
+using System.Collections.Generic;
+using System.Dynamic;
+
 using KenticoInspector.Core.Models;
+using KenticoInspector.Core.Tokens;
+
 using NUnit.Framework;

 namespace KenticoInspector.Core.Tests
@@ -9,133 +14,65 @@
     {
         public TermTests()
         {
+            TokenProcessor.RegisterTokens(typeof(Term).Assembly);
         }

         [Test]
-        public void ShouldResolveWithInt()
+        [TestCase("<int32token> results", "5 results", 5)]
+        [TestCase("<int32token|5:Many> results", "Many results", 5)]
+        [TestCase("<int32token|One|Many> results", "One results", 1)]
+        [TestCase("<int32token|One|Many> results", "Many results", 5)]
+        [TestCase("<stringtoken|value:Correct> results", "Correct results", "value")]
+        [TestCase("<stringtoken|value:wrong|defaultvalue:Correct> result", "Correct result", "defaultvalue")]
+        [TestCase("<stringtoken|value:wrong|defaultvalue:Really correct> result", "Really correct result", "defaultvalue")]
+        [TestCase("Is <stringtoken|value:not >true", "Is true", "defaultvalue")]
+        [TestCase("<stringtoken1> and <stringtoken2|nothing:nothing wrong|something wrong>", "No results and nothing wrong", "No results", "nothing")]
+        public void ShouldResolve(string term, string result, params object[] tokenValues)
         {
             TestValidResult(
-                "<intToken> results",
-                new { intToken = 5 },
-                "5 results"
-                );
+                term,
+                AsDynamic(tokenValues),
+                result
+            );
         }

         [Test]
-        public void ShouldResolveWithIntSingleCase()
+        public void ShouldResolveWithVersion() => ShouldResolve("The version is <versiontoken|12.0.4:supported>", "The version is supported", new Version(12, 0, 4));
+
+        [Test]
+        [TestCase("This is wrong: <>", typeof(ArgumentException), "value")]
+        [TestCase("This is <stringtoken|a failure|a success>", typeof(FormatException), "value")]
+        [TestCase("This is <stringtoken|string:failure:wrong|a success>", typeof(FormatException), "value")]
+        public void ShouldNotResolve(string term, Type exceptionType, params object[] tokenValues)
         {
-            TestValidResult(
-                "<intToken|5:Many> results",
-                new { intToken = 5 },
-                "Many results"
-                );
+            TestInvalidThrows(
+                term,
+                exceptionType,
+                AsDynamic(tokenValues)
+            );
         }

-        [Test]
-        public void ShouldResolveWithIntPluralizationSingle()
+        private static dynamic AsDynamic(object[] tokenValues)
         {
-            TestValidResult(
-                "<intToken|One|Many> results",
-                new { intToken = 1 },
-                "One results"
-                );
-        }
+            var expandoObject = new ExpandoObject();

-        [Test]
-        public void ShouldResolveWithIntPluralizationPlural()
-        {
-            TestValidResult(
-                "<intToken|One|Many> results",
-                new { intToken = 5 },
-                "Many results"
-                );
-        }
+            var dictionary = (IDictionary<string, object>)expandoObject;

-        [Test]
-        public void ShouldResolveWithStringSingleCase()
-        {
-            TestValidResult(
-                "<stringToken|value:Correct> result",
-                new { stringToken = "value" },
-                "Correct result"
-                );
-        }
+            var i = 1;

-        [Test]
-        public void ShouldResolveWithStringSingleCaseDefault()
-        {
-            TestValidResult(
-                "<stringToken|value:wrong|defaultvalue:Correct> result",
-                new { stringToken = "defaultvalue" },
-                "Correct result"
-                );
-        }
+            foreach (var tokenValue in tokenValues)
+            {
+                var key = $"{tokenValue.GetType().Name}token".ToLower();

-        [Test]
-        public void ShouldResolveWithStringSingleCaseDefaultWithSpaces()
-        {
-            TestValidResult(
-                "<stringToken|value:wrong|defaultvalue:Really correct> result",
-                new { stringToken = "defaultvalue" },
-                "Really correct result"
-                );
-        }
+                if (tokenValues.Length > 1)
+                {
+                    key += i++;
+                }

-        [Test]
-        public void ShouldResolveWithStringSingleCaseNoDefault()
-        {
-            TestValidResult(
-                "Is <stringToken|value:not >true",
-                new { stringToken = "defaultvalue" },
-                "Is true"
-                );
-        }
+                dictionary.Add(key, tokenValue);
+            }

-        [Test]
-        public void ShouldResolveWithMultipleStringsWithSpaces()
-        {
-            TestValidResult(
-                "<stringToken> and <stringToken2|nothing:nothing wrong|something wrong>",
-                new { stringToken = "No results", stringToken2 = "nothing" },
-                "No results and nothing wrong"
-                );
-        }
-
-        [Test]
-        public void ShouldResolveWithVersion()
-        {
-            TestValidResult(
-                "The version is <version|12.0.4:supported>",
-                new { version = new Version(12, 0, 4) },
-                "The version is supported"
-                );
-        }
-
-        [Test]
-        public void ShouldNotResolveInvalidToken()
-        {
-            TestInvalidThrows<ArgumentException>(
-                "This is wrong: <>",
-                new { stringToken = "value" }
-                );
-        }
-
-        [Test]
-        public void ShouldNotResolveInvalidImpliedCase()
-        {
-            TestInvalidThrows<FormatException>(
-                "This is <notInt|a failure|a success>",
-                new { notInt = "string" }
-                );
-        }
-
-        [Test]
-        public void ShouldNotResolveInvalidCase()
-        {
-            TestInvalidThrows<FormatException>(
-                "This is <stringToken|string:failure:wrong|a success>",
-                new { stringToken = "value" }
-                );
+            return expandoObject;
         }

         public void TestValidResult(Term term, object tokenValues, string result)
@@ -144,13 +81,13 @@
             var resolvedTerm = term.With(tokenValues);

             // Assert
-            Assert.That(resolvedTerm, Is.EqualTo(result));
+            Assert.That(resolvedTerm.ToString(), Is.EqualTo(result));
         }

-        public void TestInvalidThrows<TException>(Term term, object tokenValues) where TException : Exception
+        public void TestInvalidThrows(Term term, Type exceptionType, object tokenValues)
         {
             // Assert
-            Assert.That(() => term.With(tokenValues), Throws.TypeOf<TException>());
+            Assert.That(() => term.With(tokenValues).ToString(), Throws.TypeOf(exceptionType));
         }
     }
 }


comment

comment

--- King.Azure.Imaging/ImageApiController.cs
+++ King.Azure.Imaging/ImageApiController.cs
@@ -117,9 +117,6 @@
         /// <summary>
         /// Resize Image on the fly
         /// </summary>
-        /// <remarks>
-        /// Format and Cache are not wired in yet, soon
-        /// </remarks>
         /// <returns>Image (Resized)</returns>
         [HttpGet]
         public virtual async Task<HttpResponseMessage> Resize(string file, int width, int height = 0, string format = Naming.DefaultExtension, int quality = Imaging.DefaultImageQuality, bool cache = true)


Added AddContext overload with Hashtable as parameter to ClParser class.

--- Cassowary/Parsing/ClParser.cs
+++ Cassowary/Parsing/ClParser.cs
@@ -46,6 +46,11 @@
 			_context.Add(v.Name, v);
 	}

+	public void AddContext(Hashtable context)
+	{
+		_context = new Hashtable(context);
+	}
+
   public string Rule
   {
     get { return _rule; }


Expose LargeTextureStore

Expose LargeTextureStore

--- osu.Game/OsuGameBase.cs
+++ osu.Game/OsuGameBase.cs
@@ -110,9 +110,9 @@

             dependencies.Cache(contextFactory = new DatabaseContextFactory(Host.Storage));

-            var largeStore = new LargeTextureStore(new TextureLoaderStore(new NamespacedResourceStore<byte[]>(Resources, @"Textures")));
-            largeStore.AddStore(new TextureLoaderStore(new OnlineStore()));
-            dependencies.Cache(largeStore);
+            LargeTextureStore = new LargeTextureStore(new TextureLoaderStore(new NamespacedResourceStore<byte[]>(Resources, @"Textures")));
+            LargeTextureStore.AddStore(new TextureLoaderStore(new OnlineStore()));
+            dependencies.Cache(LargeTextureStore);

             dependencies.CacheAs(this);
             dependencies.Cache(LocalConfig);
@@ -243,6 +243,8 @@

         private readonly List<ICanAcceptFiles> fileImporters = new List<ICanAcceptFiles>();

+        protected LargeTextureStore LargeTextureStore;
+
         public void Import(params string[] paths)
         {
             var extension = Path.GetExtension(paths.First())?.ToLowerInvariant();


ChoreographyManager: schneller stoppen

ChoreographyManager: schneller stoppen

--- KugelmatikLibrary/ChoreographyManager.cs
+++ KugelmatikLibrary/ChoreographyManager.cs
@@ -116,48 +116,62 @@
                 throw new InvalidOperationException("Already canceled");

             cancellationToken.Cancel();
-            task.Wait();
+            task.Wait(TimeSpan.FromSeconds(2));
         }

         private void Run()
         {
-            Choreography.Tick(Kugelmatik, TimeSpan.Zero);
-            Kugelmatik.SendData(true);
+            try
+            {
+                Choreography.Tick(Kugelmatik, TimeSpan.Zero);
+                Kugelmatik.SendData(true);

-            // warten bis alle Pakete bestätigt wurden
-            while (Kugelmatik.AnyPacketsAcknowledgePending)
+                Stopwatch timeoutPending = new Stopwatch();
+                timeoutPending.Start();
+
+                // warten bis alle Pakete bestätigt wurden
+                while (Kugelmatik.AnyPacketsAcknowledgePending)
+                {
+                    Task.Delay(TimeSpan.FromMilliseconds(250), cancellationToken.Token).Wait();
+                    Kugelmatik.ResendPendingPackets();
+
+                    // schauen ob wir stoppen sollen oder wir zu lange auf die Pakete gewartet haben
+                    if (cancellationToken.IsCancellationRequested || timeoutPending.Elapsed > TimeSpan.FromSeconds(3))
+                        return;
+                }
+
+                Task.Delay(TimeSpan.FromSeconds(5), cancellationToken.Token).Wait(); // warten bis alle Kugeln auf Anfang sind
+
+                // Zeit messen
+                Stopwatch time = new Stopwatch(); // gesammte Zeit
+                time.Start();
+                Stopwatch frame = new Stopwatch(); // Zeit zwischen zwei Frames
+                frame.Start();
+
+                while (!cancellationToken.IsCancellationRequested)
+                {
+                    TimeSpan timeStamp = time.Elapsed;
+
+                    // Daten setzen und zu den Clustern senden
+                    Choreography.Tick(Kugelmatik, timeStamp);
+                    Kugelmatik.SendData();
+
+                    // alle 2 Sekunden Ping senden
+                    if ((int)timeStamp.TotalSeconds % 2 == 0)
+                        Kugelmatik.SendPing();
+
+                    // berechnen wie lange der Thread schlafen soll um die TargetFPS zu erreichen
+                    int sleepTime = (int)(1000f / Math.Max(1, TargetFPS)) - (int)frame.ElapsedMilliseconds;
+                    if (sleepTime > 0)
+                        Thread.Sleep(sleepTime);
+
+                    FPS = (int)Math.Ceiling(1000f / frame.ElapsedMilliseconds);
+                    frame.Restart();
+                }
+            }
+            catch(Exception e)
             {
-                Thread.Sleep(500);
-                Kugelmatik.ResendPendingPackets();
-            }
-
-            Thread.Sleep(5000); // warten bis alle Kugeln auf Anfang sind
-
-            // Zeit messen
-            Stopwatch time = new Stopwatch(); // gesammte Zeit
-            time.Start();
-            Stopwatch frame = new Stopwatch(); // Zeit zwischen zwei Frames
-            frame.Start();
-
-            while (!cancellationToken.IsCancellationRequested)
-            {
-                TimeSpan timeStamp = time.Elapsed;
-
-                // Daten setzen und zu den Clustern senden
-                Choreography.Tick(Kugelmatik, timeStamp);
-                Kugelmatik.SendData();
-
-                // alle 2 Sekunden Ping senden
-                if ((int)timeStamp.TotalSeconds % 2 == 0)
-                    Kugelmatik.SendPing();
-
-                // berechnen wie lange der Thread schlafen soll um die TargetFPS zu erreichen
-                int sleepTime = (int)(1000f / TargetFPS) - (int)frame.ElapsedMilliseconds;
-                if (sleepTime > 0)
-                    Thread.Sleep(sleepTime);
-
-                FPS = (int)Math.Ceiling(1000f / frame.ElapsedMilliseconds);
-                frame.Restart();
+                Log.Error(e);
             }
         }
     }


Fix slashes in Microsoft Graph URLs.

Fix slashes in Microsoft Graph URLs.

This fixes an issue introduced in revision f9022fec ("Avoid referencing
virtual members in constructor").

This addresses issue #3460.

--- Duplicati/Library/Backend/OneDrive/MicrosoftGraphBackend.cs
+++ Duplicati/Library/Backend/OneDrive/MicrosoftGraphBackend.cs
@@ -124,7 +124,7 @@

             // Extract out the path to the backup root folder from the given URI.  Since this can be an expensive operation,
             // we will cache the value using a lazy initializer.
-            this.rootPathFromURL = new Lazy<string>(() => this.GetRootPathFromUrl(url));
+            this.rootPathFromURL = new Lazy<string>(() => MicrosoftGraphBackend.NormalizeSlashes(this.GetRootPathFromUrl(url)));
         }

         public abstract string ProtocolKey { get; }


Force yyyy-MM-dd HH:mm example (2010-01-30 16:55) as standard datetime format

--- src/CoreBrowser/Views/CoreBrowser/Index.cshtml
+++ src/CoreBrowser/Views/CoreBrowser/Index.cshtml
@@ -41,7 +41,7 @@

 				@dir.Name
-				@dir.LastWriteTime.ToString()
+				@dir.LastWriteTime.ToString("yyyy-MM-dd HH:mm")

@@ -60,7 +60,7 @@
 						@file.NameWithoutExtension
 					}

-				@file.LastWriteTime.ToString()
+				@file.LastWriteTime.ToString("yyyy-MM-dd HH:mm")
 				@file.Extension.ToLower()
 				@file.Size.ToPrettySize(1)


retrieve filesetData to get IsFullBackup state

--- Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs
+++ Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs
@@ -214,12 +214,14 @@
                                     hashes_pr_block = blocksize / m_options.BlockhashSize;
                                 }

-
                                 // Create timestamped operations based on the file timestamp
                                 var filesetid = restoredb.CreateFileset(volumeIds[entry.Name], parsed.Time, tr);
-
-                                // all re-created filesets set as full backups since we don't know the original state
-                                restoredb.UpdateFilesetAndMarkAsFullBackup(filesetid);
+
+                                // retrieve fileset data from dlist
+                                var filesetData = VolumeReaderBase.GetFilesetData(parsed.CompressionModule, tmpfile, m_options);
+
+                                // update fileset using filesetData
+                                restoredb.UpdateFullBackupStateInFileset(filesetid, filesetData.IsFullBackup);

                                 using(var filelistreader = new FilesetVolumeReader(parsed.CompressionModule, tmpfile, m_options))
                                     foreach(var fe in filelistreader.Files.Where(x => Library.Utility.FilterExpression.Matches(filter, x.Path)))


Always return s_content != null ? new MemoryStream(_content) : null if it can't retrieve from disk (via GetBlobStore).

--- src/Couchbase.Lite.Shared/API/Document/Blob.cs
+++ src/Couchbase.Lite.Shared/API/Document/Blob.cs
@@ -135,13 +135,10 @@
                 if(_db != null) {
                     C4BlobStore* blobStore;
                     C4BlobKey key;
-                    if(!GetBlobStore(&blobStore, &key)) {
-                        return null;
-                    }
-
-                    return new BlobReadStream(blobStore, key);
-                }
-
+                    if(GetBlobStore(&blobStore, &key)) {
+                        return new BlobReadStream(blobStore, key);
+                    }
+                }
                 return _content != null ? new MemoryStream(_content) : null;
             }
         }


SYM-126 : Passing stream type to bot services (#40)

--- src/SymphonyOSS.RestApiClient/Factories/MessageFactory.cs
+++ src/SymphonyOSS.RestApiClient/Factories/MessageFactory.cs
@@ -49,7 +49,7 @@
         {
             var attachments = v4Message.Attachments?.Select(x => new Attachment(x.Id, x.Name, x.Size)).ToList();

-            return new Message(v4Message.MessageId, Epoch.AddMilliseconds(v4Message.Timestamp.Value), "type", v4Message.Stream.StreamId, v4Message.Message, v4Message.User.UserId.Value, attachments, v4Message.Data);
+            return new Message(v4Message.MessageId, Epoch.AddMilliseconds(v4Message.Timestamp.Value), v4Message.Stream.StreamType.ToString(), v4Message.Stream.StreamId, v4Message.Message, v4Message.User.UserId.Value, attachments, v4Message.Data);
         }
     }
 }


Moving window speech dependent field in directive The serialized data of this field will be lost when switching between platforms and re-serializing this class.

--- Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs
+++ Assets/HoloToolkit/Input/Scripts/Voice/SpeechInputSource.cs
@@ -39,13 +39,14 @@
         [Tooltip("Whether the recognizer should be activated on start.")]
         public RecognizerStartBehavior RecognizerStart;

-        [Tooltip("The confidence level for the keyword recognizer.")]
-        public ConfidenceLevel RecognitionConfidenceLevel;
-
         [Tooltip("The keywords to be recognized and optional keyboard shortcuts.")]
         public KeywordAndKeyCode[] Keywords;

 #if UNITY_WSA || UNITY_STANDALONE_WIN
+        [Tooltip("The confidence level for the keyword recognizer.")]
+        //The serialized data of this field will be lost when switching between platforms and re-serializing this class.
+        public ConfidenceLevel RecognitionConfidenceLevel;
+
         private KeywordRecognizer keywordRecognizer;


Match Microsoft defaults

Match Microsoft defaults

--- src/Cuemon.Core/Reflection/ActivatorOptions.cs
+++ src/Cuemon.Core/Reflection/ActivatorOptions.cs
@@ -32,7 +32,7 @@
         public ActivatorOptions()
         {
             Binder = Type.DefaultBinder;
-            Flags = BindingFlags.Instance | BindingFlags.Public;
+            Flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.CreateInstance;
         }

         /// <summary>


fixed missing private inspector options

fixed missing private inspector options

--- Assets/HoloToolkit/Utilities/Scripts/SphereBasedTagalong.cs
+++ Assets/HoloToolkit/Utilities/Scripts/SphereBasedTagalong.cs
@@ -20,6 +20,7 @@
         /// <summary>
         /// When moving, use unscaled time. This is useful for games that have a pause mechanism or otherwise adjust the game timescale.
         /// </summary>
+        [SerializeField]
         [Tooltip("When moving, use unscaled time. This is useful for games that have a pause mechanism or otherwise adjust the game timescale.")]
         private bool useUnscaledTime = true;

@@ -30,9 +31,11 @@
         [Tooltip("Used to initialize the initial position of the SphereBasedTagalong before being hidden on LateUpdate.")]
         private bool hideOnStart;

+        [SerializeField]
         [Tooltip("Display the sphere in red wireframe for debugging purposes.")]
         private bool debugDisplaySphere;

+        [SerializeField]
         [Tooltip("Display a small green cube where the target position is.")]
         private bool debugDisplayTargetPosition;

@@ -92,4 +95,4 @@
             Gizmos.color = oldColor;
         }
     }
-}+}


bumps version

bumps version

--- src/Umbraco.IdentityExtensions/Properties/AssemblyInfo.cs
+++ src/Umbraco.IdentityExtensions/Properties/AssemblyInfo.cs
@@ -23,5 +23,5 @@

 [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyFileVersion("1.0.0")]
-[assembly: AssemblyInformationalVersion("1.0.0-nightly0008")]
+[assembly: AssemblyInformationalVersion("1.0.0-nightly0009")]
 [assembly: AssemblyCopyright("Copyright © Umbraco 2015")]


cleaned up code.

cleaned up code.

--- Assets/QuickSheet/GDataPlugin/Editor/GoogleMachineEditor.cs
+++ Assets/QuickSheet/GDataPlugin/Editor/GoogleMachineEditor.cs
@@ -219,8 +219,6 @@
         AssetDatabase.SaveAssets();
     }

-
-
     /// <summary>
     /// Translate type of the member fields directly from google spreadsheet's header column.
     /// NOTE: This needs header column to be formatted with colon.  e.g. "Name : string"


added git ref link (#448)

added git ref link (#448)

Co-authored-by: Martin Hinshelwood nkdAgility.com <54669547a225ff20cba8b75a4adca540eef25858@nkdagility.com>

--- src/VstsSyncMigrator.Core/Execution/OMatics/RepoOMatic.cs
+++ src/VstsSyncMigrator.Core/Execution/OMatics/RepoOMatic.cs
@@ -275,7 +275,8 @@
             //vstfs:///Git/PullRequestId/
             //ToDo: check only for "git" ?
             if (link.ToLowerInvariant().Contains("git/commit")
-                || link.ToLowerInvariant().Contains("git/pullrequestid"))
+                || link.ToLowerInvariant().Contains("git/pullrequestid")
+                || link.ToLowerInvariant().Contains("git/ref"))
                 return RepistoryType.Git;

             //vstfs:///VersionControl/Changeset/{id}


button controll platform adding tweak

button controll platform adding tweak

--- Assets/Scripts/BlockTypes/ButtonPlatformControlleradding.cs
+++ Assets/Scripts/BlockTypes/ButtonPlatformControlleradding.cs
@@ -37,5 +37,6 @@
             yield return new WaitForEndOfFrame();
         }
 		objectToMove.transform.position = (startingPos + end);
+        enabled = false;
     }
 }


Fix error creating the metadatatable on MySql (#74)

--- src/Evolve/Dialect/MySQL/MySQLMetadataTable.cs
+++ src/Evolve/Dialect/MySQL/MySQLMetadataTable.cs
@@ -4,14 +4,14 @@

 namespace Evolve.Dialect.MySQL
 {
-    /// <summary>
-    ///     Constructor.
-    /// </summary>
-    /// <param name="schema"> Existing database schema name. </param>
-    /// <param name="tableName"> Metadata table name. </param>
-    /// <param name="database"> A database helper used to change and restore schema of the metadata table. </param>
     public class MySQLMetadataTable : MetadataTable
     {
+        /// <summary>
+        ///     Constructor.
+        /// </summary>
+        /// <param name="schema"> Existing database schema name. </param>
+        /// <param name="tableName"> Metadata table name. </param>
+        /// <param name="database"> A database helper used to change and restore schema of the metadata table. </param>
         public MySQLMetadataTable(string schema, string tableName, DatabaseHelper database)
             : base(schema, tableName, database)
         {
@@ -39,7 +39,7 @@
             string sql = $"CREATE TABLE `{Schema}`.`{TableName}` " +
              "( " +
                  "id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, " +
-                 "type TINYINT, " +
+                 "type TINYINT UNSIGNED, " +
                  "version VARCHAR(50), " +
                  "description VARCHAR(200) NOT NULL, " +
                  "name VARCHAR(300) NOT NULL, " +


#10 Db driver loading fails for .NET Core web projects

--- src/Evolve/Driver/CoreReflectionBasedDriver.cs
+++ src/Evolve/Driver/CoreReflectionBasedDriver.cs
@@ -113,7 +113,12 @@
             foreach (var dependency in lib.Dependencies)
             {
                 RuntimeLibrary depLib = GetRuntimeLibrary(dependency.Name);
-                if (depLib != null && IsLibraryNative(depLib) && !NativeDependencies.Contains(dependency.Name))
+                if (depLib == null)
+                {
+                    continue; // it's a "compileOnly" assembly
+                }
+
+                if (IsLibraryNative(depLib) && !NativeDependencies.Contains(dependency.Name))
                 {
                     NativeDependencies.Add(GetNativeLibraryPath(depLib));
                 }