You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(21) |
Sep
(25) |
Oct
(13) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(1) |
Oct
(1) |
Nov
(8) |
Dec
(3) |
2009 |
Jan
(5) |
Feb
(3) |
Mar
(10) |
Apr
(6) |
May
(3) |
Jun
(4) |
Jul
(1) |
Aug
(3) |
Sep
(5) |
Oct
(1) |
Nov
(2) |
Dec
(2) |
2010 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(3) |
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(4) |
Nov
(4) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(3) |
Dec
(2) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
(2) |
Dec
(5) |
2015 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mcu...@us...> - 2009-04-01 02:22:33
|
Revision: 1376 http://orm.svn.sourceforge.net/orm/?rev=1376&view=rev Author: mcurland Date: 2009-04-01 01:49:40 +0000 (Wed, 01 Apr 2009) Log Message: ----------- Automatically fix duplicate auto-generated constraint names on load. fixes #389 Also updated extension example to work with current model error fixup. Modified Paths: -------------- trunk/ExtensionExample/CustomExtensionError.cs trunk/ExtensionExample/ExtensionDomainModel.DeserializationFixupListeners.cs trunk/ORMModel/Framework/NamedElementDictionary.cs trunk/ORMModel/ObjectModel/Grouping.cs trunk/ORMModel/ObjectModel/ORMModel.cs Modified: trunk/ExtensionExample/CustomExtensionError.cs =================================================================== --- trunk/ExtensionExample/CustomExtensionError.cs 2009-03-31 19:25:05 UTC (rev 1375) +++ trunk/ExtensionExample/CustomExtensionError.cs 2009-04-01 01:49:40 UTC (rev 1376) @@ -158,7 +158,7 @@ private sealed class ObjectTypeNameFixupListener : DeserializationFixupListener<ObjectType> { public ObjectTypeNameFixupListener() - : base((int)ORMDeserializationFixupPhase.ValidateImplicitStoredElements) + : base((int)ExtensionExampleFixupPhase.ValidateMeaningfulNames) { } protected sealed override void ProcessElement(ObjectType element, Store store, INotifyElementAdded notifyAdded) Modified: trunk/ExtensionExample/ExtensionDomainModel.DeserializationFixupListeners.cs =================================================================== --- trunk/ExtensionExample/ExtensionDomainModel.DeserializationFixupListeners.cs 2009-03-31 19:25:05 UTC (rev 1375) +++ trunk/ExtensionExample/ExtensionDomainModel.DeserializationFixupListeners.cs 2009-04-01 01:49:40 UTC (rev 1376) @@ -6,18 +6,36 @@ namespace ORMSolutions.ORMArchitect.ExtensionExample { + /// <summary> + /// A custom fixup phase for the extension example + /// </summary> + public enum ExtensionExampleFixupPhase + { + /// <summary> + /// Validate meaningful names after the ORM model has completed its name validation. + /// This enables any names that require regeneration to be automatically generated + /// before we determine if the names are meaningful. + /// </summary> + ValidateMeaningfulNames = ORMDeserializationFixupPhase.ValidateElementNames + 1, + } public partial class ExtensionDomainModel : IDeserializationFixupListenerProvider { #region IDeserializationFixupListenerProvider Implementation /// <summary> /// Implements IDeserializationFixupListenerProvider.DeserializationFixupListenerCollection /// </summary> - protected static IEnumerable<IDeserializationFixupListener> DeserializationFixupListenerCollection + protected IEnumerable<IDeserializationFixupListener> DeserializationFixupListenerCollection { get { yield return new MyCustomExtensionElementFixupListener(); yield return ObjectTypeRequiresMeaningfulNameError.ObjectTypeNameErrorFixupListener; + // The errors in this model will be ignore by the ORM error validator because they are + // in the wrong domain model. Register our own handler to deal with these errors. + // Note that this could also be handled by explicitly add/removing validating errors + // from the task provider when we create them, but this general facility is easier to + // use because it does this for us. + yield return ModelError.GetFixupListener((int)ORMDeserializationFixupPhase.ValidateErrors, DomainModelInfo); } } IEnumerable<IDeserializationFixupListener> IDeserializationFixupListenerProvider.DeserializationFixupListenerCollection @@ -35,7 +53,7 @@ { get { - return null; + return typeof(ExtensionExampleFixupPhase); } } Type IDeserializationFixupListenerProvider.DeserializationFixupPhaseType Modified: trunk/ORMModel/Framework/NamedElementDictionary.cs =================================================================== --- trunk/ORMModel/Framework/NamedElementDictionary.cs 2009-03-31 19:25:05 UTC (rev 1375) +++ trunk/ORMModel/Framework/NamedElementDictionary.cs 2009-04-01 01:49:40 UTC (rev 1376) @@ -25,6 +25,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Globalization; +using System.Text.RegularExpressions; using Microsoft.VisualStudio.Modeling; namespace ORMSolutions.ORMArchitect.Framework @@ -584,6 +585,18 @@ return null; } /// <summary> + /// If a duplicate name is caught during load, then determine if the name + /// is an auto-generated name that should be regenerated instead of tracked + /// as a duplicate name error. The default implementation returns <see langword="false"/>. + /// </summary> + /// <param name="element">The element with the duplicate name</param> + /// <param name="elementName">The pre-fetched element name</param> + /// <returns>Return <see langword="true"/> to reset the name.</returns> + protected virtual bool ShouldResetDuplicateName(ModelElement element, string elementName) + { + return false; + } + /// <summary> /// Override to throw a custom exception when /// adding duplicate names is not allowed. /// </summary> @@ -627,6 +640,25 @@ } while(dic.ContainsKey(newKey)); return newKey; } + /// <summary> + /// Test if an <paramref name="elementName"/> is a decorated form of the root name pattern + /// for an <paramref name="element"/>. Provides a stock implementation for derived implementations + /// of the <see cref="ShouldResetDuplicateName"/> method. + /// </summary> + /// <param name="element">The element to retrieve the root name pattern for.</param> + /// <param name="elementName">The pre-fetched element name to compare to.</param> + /// <returns><see langword="true"/> if the name could have been generated from + /// the string returned from <see cref="GetRootNamePattern"/></returns> + protected bool IsDecoratedRootName(ModelElement element, string elementName) + { + string rootName = this.GetRootNamePattern(element); + return Regex.IsMatch( + elementName, + rootName.Contains("{0}") ? + @"\A" + string.Format(CultureInfo.InvariantCulture, rootName, @"\d+") + @"\z" : + @"\A" + rootName + @"\d+\z", + RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); + } #endregion // Unique name generation #region INamedElementDictionary Members void INamedElementDictionary.AddElement(ModelElement element, DuplicateNameAction duplicateAction, INotifyElementAdded notifyAdded) @@ -738,6 +770,10 @@ // to not throw an exception return; } + else if (notifyAdded != null && ShouldResetDuplicateName(element, elementName)) + { + AddElement(element, duplicateAction, "", notifyAdded); + } else { ModelElement singleElement = locateData.SingleElement; Modified: trunk/ORMModel/ObjectModel/Grouping.cs =================================================================== --- trunk/ORMModel/ObjectModel/Grouping.cs 2009-03-31 19:25:05 UTC (rev 1375) +++ trunk/ORMModel/ObjectModel/Grouping.cs 2009-04-01 01:49:40 UTC (rev 1376) @@ -1023,6 +1023,7 @@ } #endregion // GroupDuplicateNameError class #region GroupMembershipContradictionError class + [ModelErrorDisplayFilter(typeof(ElementGroupingErrorCategory))] partial class ElementGroupingMembershipContradictionError { /// <summary> @@ -1265,6 +1266,14 @@ return ResourceStrings.ElementGroupingDefaultNamePattern; } /// <summary> + /// Duplicate automatically generated group names should regenerate on load. + /// Caters for common merging scenario. + /// </summary> + protected override bool ShouldResetDuplicateName(ModelElement element, string elementName) + { + return IsDecoratedRootName(element, elementName); + } + /// <summary> /// Raise an exception with text specific to a name in a model /// </summary> /// <param name="element">Element we're attempting to name</param> Modified: trunk/ORMModel/ObjectModel/ORMModel.cs =================================================================== --- trunk/ORMModel/ObjectModel/ORMModel.cs 2009-03-31 19:25:05 UTC (rev 1375) +++ trunk/ORMModel/ObjectModel/ORMModel.cs 2009-04-01 01:49:40 UTC (rev 1376) @@ -1043,6 +1043,14 @@ return base.GetRootNamePattern(element); } /// <summary> + /// Duplicate automatically generated constraint names should regenerate on load. + /// Caters for common merging scenario. + /// </summary> + protected override bool ShouldResetDuplicateName(ModelElement element, string elementName) + { + return IsDecoratedRootName(element, elementName); + } + /// <summary> /// Raise an exception with text specific to a name in a model /// </summary> /// <param name="element">Element we're attempting to name</param> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-03-31 19:25:21
|
Revision: 1375 http://orm.svn.sourceforge.net/orm/?rev=1375&view=rev Author: mcurland Date: 2009-03-31 19:25:05 +0000 (Tue, 31 Mar 2009) Log Message: ----------- Name alias resolution choosing a less-refined name, depending on the alias entry order. refs #338 Also moved the 'Reverse Role Order' command to the top of the Orientation submenu, and gave the MoveRoleLeft/MoveRoleRight commands that display with a role selection the same dynamic 'Reverse Role Order' name instead of 'Swap Role Order' for a binary FactType. Modified Paths: -------------- trunk/ORMModel/ObjectModel/NameGenerator.cs trunk/ORMModel/ShapeModel/ORMDiagram.resx trunk/ORMModel/Shell/PackageResources/PkgCmd.vsct Modified: trunk/ORMModel/ObjectModel/NameGenerator.cs =================================================================== --- trunk/ORMModel/ObjectModel/NameGenerator.cs 2009-03-28 17:45:34 UTC (rev 1374) +++ trunk/ORMModel/ObjectModel/NameGenerator.cs 2009-03-31 19:25:05 UTC (rev 1375) @@ -398,32 +398,35 @@ /// <summary> /// Retrieve the best matching alias for the provided set of aliases /// </summary> + /// <remarks>If an exact type/usage match is not available, then this will + /// return the closest usage match over the closest type match. The closest + /// matches are determined by walking up the parent hierarchy of name generators.</remarks> /// <param name="aliases">A set of alias elements. The best match is returned.</param> /// <returns>A <see cref="NameAlias"/>, or <see langword="null"/> if none is available.</returns> public NameAlias FindMatchingAlias(IEnumerable<NameAlias> aliases) { - NameAlias bestMatch = null; + NameAlias bestUsageMatch = null; + NameAlias bestTypeMatch = null; Type usageType = NameUsageType; DomainClassInfo thisClassInfo = GetDomainClass(); - DomainClassInfo matchedClassInfo = null; - bool matchedUsageType = false; - int closestDistance = int.MaxValue; + int closestTypeDistance = int.MaxValue; + int closestUsageDistance = int.MaxValue; foreach (NameAlias alias in aliases) { DomainClassInfo testClassInfo = alias.NameConsumerDomainClass; Type testUsageType = alias.NameUsageType; if (testClassInfo == thisClassInfo) { - if (usageType == testUsageType) + if (usageType == testUsageType) // intentionally handles two null values { - bestMatch = alias; + bestUsageMatch = alias; break; } else if (usageType != null && testUsageType == null) { - matchedClassInfo = testClassInfo; - bestMatch = alias; - // Keep going to see if we get an exact usage match + closestTypeDistance = 0; // Matched self, can't get any closer + bestTypeMatch = alias; + // Keep going to see if we get a higher priority usage match } } else @@ -435,30 +438,21 @@ ++testDistance; if (iterateClassInfo == testClassInfo) { - if (testDistance <= closestDistance) + if (usageType == testUsageType) // intentionally handles two null values { - if (testClassInfo == matchedClassInfo) + if (testDistance < closestUsageDistance) { - if (!matchedUsageType) - { - bestMatch = alias; - matchedUsageType = usageType == testUsageType; - } + closestUsageDistance = testDistance; + bestUsageMatch = alias; } - else if (usageType == testUsageType) + } + else if (usageType != null && testUsageType == null) + { + if (testDistance < closestTypeDistance) { - closestDistance = testDistance; - matchedClassInfo = testClassInfo; - matchedUsageType = true; - bestMatch = alias; + closestTypeDistance = testDistance; + bestTypeMatch = alias; } - else if (usageType != null && testUsageType == null) - { - closestDistance = testDistance; - matchedClassInfo = testClassInfo; - matchedUsageType = false; - bestMatch = alias; - } } break; } @@ -466,7 +460,7 @@ } while (iterateClassInfo != null); } } - return bestMatch; + return bestUsageMatch ?? bestTypeMatch; } #endregion // GetGeneratorSettings } Modified: trunk/ORMModel/ShapeModel/ORMDiagram.resx =================================================================== --- trunk/ORMModel/ShapeModel/ORMDiagram.resx 2009-03-28 17:45:34 UTC (rev 1374) +++ trunk/ORMModel/ShapeModel/ORMDiagram.resx 2009-03-31 19:25:05 UTC (rev 1375) @@ -212,7 +212,7 @@ <comment xml:space="preserve">This text appears on the 'Select on Diagram' menu if there is more than one shape for the selected element on the current diagram.</comment> </data> <data name="Command.SwapRoleOrder.Text"> - <value xml:space="preserve">S&wap Role Order</value> + <value xml:space="preserve">Re&verse Role Order</value> <comment xml:space="preserve">This text appears on the move role left/right when the fact type is binary.</comment> </data> <data name="ConstraintDisplayPosition.Bottom" xml:space="preserve"> Modified: trunk/ORMModel/Shell/PackageResources/PkgCmd.vsct =================================================================== --- trunk/ORMModel/Shell/PackageResources/PkgCmd.vsct 2009-03-28 17:45:34 UTC (rev 1374) +++ trunk/ORMModel/Shell/PackageResources/PkgCmd.vsct 2009-03-31 19:25:05 UTC (rev 1375) @@ -207,13 +207,13 @@ <Parent guid="guidORMDesignerCommandSet" id="menuIdReportGeneratorList"/> </Group> - <Group guid="guidORMDesignerCommandSet" id="groupIdDisplayOrientation" priority="0x0010"> + <Group guid="guidORMDesignerCommandSet" id="groupIdDisplayReverseRoleOrder" priority="0x0010"> <Parent guid="guidORMDesignerCommandSet" id="menuIdDisplayOrientation"/> </Group> - <Group guid="guidORMDesignerCommandSet" id="groupIdDisplayConstraintPosition" priority="0x0020"> + <Group guid="guidORMDesignerCommandSet" id="groupIdDisplayOrientation" priority="0x0020"> <Parent guid="guidORMDesignerCommandSet" id="menuIdDisplayOrientation"/> </Group> - <Group guid="guidORMDesignerCommandSet" id="groupIdDisplayReverseRoleOrder" priority="0x0030"> + <Group guid="guidORMDesignerCommandSet" id="groupIdDisplayConstraintPosition" priority="0x0030"> <Parent guid="guidORMDesignerCommandSet" id="menuIdDisplayOrientation"/> </Group> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-03-28 17:45:45
|
Revision: 1374 http://orm.svn.sourceforge.net/orm/?rev=1374&view=rev Author: mcurland Date: 2009-03-28 17:45:34 +0000 (Sat, 28 Mar 2009) Log Message: ----------- References to separated subtype tables used 'identifier' instead of 'reference' name pattern. refs #338 Modified Paths: -------------- trunk/RelationalModel/OialDcilBridge/NameGeneration.cs trunk/RelationalModel/OialDcilBridge/OialDcilBridge.DeserializationFixupListeners.cs trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test1.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.WithIndependent.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.AfterReorder.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.OriginalOrder.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test4.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.FullyAbsorbed.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateObjectification.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateRemoteSupertype.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test6.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test7.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test8.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test9.Compare.orm Modified: trunk/RelationalModel/OialDcilBridge/NameGeneration.cs =================================================================== --- trunk/RelationalModel/OialDcilBridge/NameGeneration.cs 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/RelationalModel/OialDcilBridge/NameGeneration.cs 2009-03-28 17:45:34 UTC (rev 1374) @@ -781,7 +781,7 @@ // Don't add names for reverse path types lastStepConsumedNextNode = false; lastStepUsedExplicitRoleName = false; - treatNextIdentifierAsFirstStep = true; + treatNextIdentifierAsFirstStep = firstPass; if (nextLoopNode == null) { // Unusual, but can happen with a ValueType with its own table Modified: trunk/RelationalModel/OialDcilBridge/OialDcilBridge.DeserializationFixupListeners.cs =================================================================== --- trunk/RelationalModel/OialDcilBridge/OialDcilBridge.DeserializationFixupListeners.cs 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/RelationalModel/OialDcilBridge/OialDcilBridge.DeserializationFixupListeners.cs 2009-03-28 17:45:34 UTC (rev 1374) @@ -51,7 +51,7 @@ /// <summary> /// The algorithm version written to the file for the name generation algorithm /// </summary> - public const string CurrentNameAlgorithmVersion = "1.009"; + public const string CurrentNameAlgorithmVersion = "1.010"; #endregion // Algorithm Version Constants #region Fully populate from OIAL Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test1.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test1.Compare.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test1.Compare.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -11200,7 +11200,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_52A37F5B-1E80-4FCB-802E-AA9FA4315D0D" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_AFA60651-CCAD-47F2-B397-70E5855BF20B" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting id="_CD0EC594-EDEA-44FC-9593-1DE35929D199" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting id="_CD0EC594-EDEA-44FC-9593-1DE35929D199" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_1CA1A0E5-2553-4907-AC75-1850287F4A51" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.WithIndependent.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.WithIndependent.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.WithIndependent.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -285,7 +285,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_216FCBEF-24A6-4138-9F8D-255066420DD2" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_FE3D35D4-8BFA-4604-B769-6F8224F4CC89" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting id="_AB43283A-160B-4A51-9E75-F464582D1F72" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting id="_AB43283A-160B-4A51-9E75-F464582D1F72" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_3F310E69-550D-441F-9F8C-15CBA2CE8CEB" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -291,7 +291,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_1ECF9C7E-EC03-4118-9BF0-78AC98140751" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_4EE0E222-C3E6-4E2F-93BD-2832FD0CA530" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting id="_B469B281-6731-4214-9C2C-6CFDAC31C903" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting id="_B469B281-6731-4214-9C2C-6CFDAC31C903" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_DC73DBF4-111D-49C1-B301-B5F5B89FB4D8" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.AfterReorder.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.AfterReorder.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.AfterReorder.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -748,7 +748,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_93A125B5-363A-454B-A6FC-473B4987BBF7" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_B227B9F1-E66D-4885-9EBB-FA6C30E3AC66" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting id="_75FDA8E6-2EB8-493D-A6BF-CB382F439713" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting id="_75FDA8E6-2EB8-493D-A6BF-CB382F439713" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_0C507CBC-61D4-4B2D-ACE1-7BED6CF800A3" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.OriginalOrder.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.OriginalOrder.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.OriginalOrder.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -748,7 +748,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_4CA750F7-00B1-492A-9BC2-CF24B78D16D1" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_B227B9F1-E66D-4885-9EBB-FA6C30E3AC66" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting id="_2FD2BA8B-8F38-413C-A5ED-5C43A9F3ED0C" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting id="_2FD2BA8B-8F38-413C-A5ED-5C43A9F3ED0C" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_0C507CBC-61D4-4B2D-ACE1-7BED6CF800A3" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -748,7 +748,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_4F4B5F39-12A2-4488-9BA9-EEF2F2BB5E6D" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_21511FEB-5B88-4FBD-A74C-06B4A3C70480" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting id="_6E61D4EE-E269-4EB5-8CD2-5D643CA8F6AB" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting id="_6E61D4EE-E269-4EB5-8CD2-5D643CA8F6AB" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_318C6F91-A8B5-4657-8FF0-8BC95C2C83B5" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test4.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test4.Compare.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test4.Compare.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -382,7 +382,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_7C818355-A612-4252-B259-D23C1B8B80CB" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_479BA1D0-80FB-48DE-894E-50E9E8FC0F0B" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting id="_035C2A13-BCD7-4021-B939-C7B0714C8324" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting id="_035C2A13-BCD7-4021-B939-C7B0714C8324" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_C2350E6F-6523-49F4-A2E3-B021A5CE58E6" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.FullyAbsorbed.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.FullyAbsorbed.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.FullyAbsorbed.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -886,7 +886,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_953B9230-0B01-406E-B73F-E99E73B31F8D" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_B6DA4F58-8BCF-478E-82AE-C04CD0DD68C9" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting id="_0C331C48-4E21-4197-8186-4A3769048023" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting id="_0C331C48-4E21-4197-8186-4A3769048023" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_77081B66-EB8A-44C5-9D03-DF6573330E4B" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateObjectification.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateObjectification.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateObjectification.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -886,7 +886,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_077B1376-3174-4CAC-9C4A-B8245485F67E" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_C50661E8-E857-43F3-A1D2-9EF787A84EFE" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting id="_CC0244D5-F67A-4DE3-8E18-4B16640FB1F1" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting id="_CC0244D5-F67A-4DE3-8E18-4B16640FB1F1" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_BDE38DCE-8504-4AC9-9156-A927376B73B6" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateRemoteSupertype.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateRemoteSupertype.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateRemoteSupertype.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -925,7 +925,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_F689860F-F598-413B-B7D2-0DD7D4CACE41" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_B774300C-8F49-43EB-AB62-17534D8DBB42" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting id="_0F8EAA5B-2586-41D4-9523-EDE35695503A" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting id="_0F8EAA5B-2586-41D4-9523-EDE35695503A" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_EC000843-0D4E-43C1-80E8-527C74F04153" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -925,7 +925,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_F689860F-F598-413B-B7D2-0DD7D4CACE41" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_B774300C-8F49-43EB-AB62-17534D8DBB42" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting id="_0F8EAA5B-2586-41D4-9523-EDE35695503A" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting id="_0F8EAA5B-2586-41D4-9523-EDE35695503A" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_EC000843-0D4E-43C1-80E8-527C74F04153" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test6.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test6.Compare.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test6.Compare.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -328,7 +328,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_D7A0794A-6A4E-4F57-AABD-1EAA875ADCEC" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_82B2C906-24E6-4CF4-ADE5-30AEAE09EC10" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting id="_92EDE6BB-60EE-45AE-8D58-B58A04114F45" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting id="_92EDE6BB-60EE-45AE-8D58-B58A04114F45" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_52DB28BD-3E61-47BD-B0B9-32D2C6CA80B7" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test7.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test7.Compare.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test7.Compare.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -700,7 +700,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_65638CB4-2653-4514-A38D-9380F676A78C" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_AB78A179-3D57-4D6D-A2C8-A7FD52DCC729" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting CoreAlgorithmVersion="1.004" id="_E6A31A5A-A145-4F45-A0E9-47F04AA49D97" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting CoreAlgorithmVersion="1.004" id="_E6A31A5A-A145-4F45-A0E9-47F04AA49D97" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_A71D70CB-02A4-42A5-8CD4-DDBDE316A25B" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test8.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test8.Compare.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test8.Compare.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -208,7 +208,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_CA317692-2D5E-4094-9CC9-F7B049F0A505" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_9C9BECFF-37EA-4156-B4BF-55AD6ED21CD2" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting id="_7A16F888-F499-4270-94C6-894CF461C356" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting id="_7A16F888-F499-4270-94C6-894CF461C356" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_58CD2382-A0F9-4C22-806A-7FC12438339C" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test9.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test9.Compare.orm 2009-03-25 17:17:23 UTC (rev 1373) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test9.Compare.orm 2009-03-28 17:45:34 UTC (rev 1374) @@ -364,7 +364,7 @@ <ormtooial:AbstractionModelGenerationSetting id="_FA93223F-D82D-479F-A103-D8886756E8E2" AlgorithmVersion="1.005"> <ormtooial:AbstractionModel ref="_2F7377B5-BC91-4951-B9DC-8D6389C48738" /> </ormtooial:AbstractionModelGenerationSetting> - <oialtocdb:SchemaGenerationSetting id="_833EE616-E4B4-4F9E-9DBC-522A018D54FC" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.009"> + <oialtocdb:SchemaGenerationSetting id="_833EE616-E4B4-4F9E-9DBC-522A018D54FC" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.010"> <oialtocdb:Schema ref="_384966C8-3A43-4591-933B-A4D426CC424D" /> </oialtocdb:SchemaGenerationSetting> </orm:GenerationSettings> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-03-25 17:17:27
|
Revision: 1373 http://orm.svn.sourceforge.net/orm/?rev=1373&view=rev Author: mcurland Date: 2009-03-25 17:17:23 +0000 (Wed, 25 Mar 2009) Log Message: ----------- Relaxed a couple of schema definitions. RoleInstance definition order was too strict, and custom properties would not reload without a property in a group. refs #374 Modified Paths: -------------- trunk/CustomProperties/CustomProperties.xsd trunk/ORMModel/ObjectModel/ORM2Core.xsd Modified: trunk/CustomProperties/CustomProperties.xsd =================================================================== --- trunk/CustomProperties/CustomProperties.xsd 2009-03-20 23:38:59 UTC (rev 1372) +++ trunk/CustomProperties/CustomProperties.xsd 2009-03-25 17:17:23 UTC (rev 1373) @@ -31,7 +31,7 @@ </xs:annotation> <xs:complexType> <xs:sequence> - <xs:element ref="cp:CustomPropertyGroup" maxOccurs="unbounded" minOccurs="1"/> + <xs:element ref="cp:CustomPropertyGroup" maxOccurs="unbounded" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:key name="CustomPropertyGroupKey"> @@ -49,10 +49,10 @@ </xs:annotation> <xs:complexType> <xs:sequence> - <xs:element name="PropertyDefinitions"> + <xs:element name="PropertyDefinitions" minOccurs="0"> <xs:complexType> <xs:sequence> - <xs:element ref="cp:Definition" maxOccurs="unbounded" minOccurs="1"/> + <xs:element ref="cp:Definition" maxOccurs="unbounded" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> @@ -164,7 +164,7 @@ </xs:annotation> <xs:complexType> <xs:sequence> - <xs:element ref="cp:ORMType" maxOccurs="unbounded" minOccurs="1"/> + <xs:element ref="cp:ORMType" maxOccurs="unbounded" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:unique name="ORMTypeUniquessConstraint"> Modified: trunk/ORMModel/ObjectModel/ORM2Core.xsd =================================================================== --- trunk/ORMModel/ObjectModel/ORM2Core.xsd 2009-03-20 23:38:59 UTC (rev 1372) +++ trunk/ORMModel/ObjectModel/ORM2Core.xsd 2009-03-25 17:17:23 UTC (rev 1373) @@ -236,12 +236,12 @@ <xs:complexType name="ValueTypeInstanceRef"> <xs:attribute name="ref" type="xs:IDREF" use="required"/> </xs:complexType> - <xs:complexType name="ObjectTypeRoleInstances"> - <xs:sequence> - <xs:element name="EntityTypeRoleInstance" type="RoleInstance" minOccurs="0" maxOccurs="unbounded"/> - <xs:element name="ValueTypeRoleInstance" type="RoleInstance" minOccurs="0" maxOccurs="unbounded"/> - <xs:element name="FactTypeRoleInstance" type="RoleInstance" minOccurs="0" maxOccurs="unbounded"/> - </xs:sequence> + <xs:complexType name="RoleInstanceDefinitions"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="EntityTypeRoleInstance" type="RoleInstance"/> + <xs:element name="ValueTypeRoleInstance" type="RoleInstance"/> + <xs:element name="FactTypeRoleInstance" type="RoleInstance"/> + </xs:choice> </xs:complexType> <xs:complexType name="RoleInstance"> <xs:simpleContent> @@ -589,7 +589,7 @@ <xs:sequence> <xs:element name="RolePlayer" type="ObjectRef" minOccurs="0"/> <xs:element name="ValueRestriction" type="RoleValueRestriction" minOccurs="0"/> - <xs:element name="RoleInstances" type="ObjectTypeRoleInstances" minOccurs="0"/> + <xs:element name="RoleInstances" type="RoleInstanceDefinitions" minOccurs="0"/> </xs:sequence> <xs:attribute name="Name" type="xs:string" use="required"/> <xs:attribute name="id" type="xs:ID" use="required"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-03-20 23:39:12
|
Revision: 1372 http://orm.svn.sourceforge.net/orm/?rev=1372&view=rev Author: mcurland Date: 2009-03-20 23:38:59 +0000 (Fri, 20 Mar 2009) Log Message: ----------- Handle cyclic deep mapping scenario with collapsed tables across a unary objectification pattern. Also trigger absorption regeneration on mandatory and uniqueness changes on an objectified FactType by validating the associated binarized FactType, not the objectified FactType. refs #327 Modified Paths: -------------- trunk/Oial/ORMOialBridge/ModificationTracker.cs trunk/Oial/ORMOialBridge/OialModelIsForORMModel.cs Modified: trunk/Oial/ORMOialBridge/ModificationTracker.cs =================================================================== --- trunk/Oial/ORMOialBridge/ModificationTracker.cs 2009-03-18 00:22:10 UTC (rev 1371) +++ trunk/Oial/ORMOialBridge/ModificationTracker.cs 2009-03-20 23:38:59 UTC (rev 1372) @@ -43,7 +43,7 @@ { if (IsRelevantConstraint(constraint)) { - FactTypeConstraintPatternChanged(link.Role.FactType); + FactTypeConstraintPatternChanged(link.Role.BinarizedFactType); } switch (constraint.ConstraintType) { @@ -67,7 +67,7 @@ { if (IsRelevantConstraint(constraint)) { - FactTypeConstraintPatternChanged(link.Role.FactType); + FactTypeConstraintPatternChanged(link.Role.BinarizedFactType); } switch (constraint.ConstraintType) { @@ -116,9 +116,12 @@ SetConstraint constraint = (SetConstraint)e.ModelElement; if (IsRelevantConstraint(constraint.Constraint)) { - foreach (FactType factType in constraint.FactTypeCollection) + foreach (Role role in constraint.RoleCollection) { - FactTypeConstraintPatternChanged(factType); + // Note that constraint.FactTypeCollection does not resolve the + // BinarizedFactType. Notifying twice on one FactType is harmless + // due to delayed validation. + FactTypeConstraintPatternChanged(role.BinarizedFactType); } } } @@ -240,14 +243,14 @@ ObjectTypePlaysRole link = (ObjectTypePlaysRole)e.ElementLink; if (e.DomainRole.Id == ObjectTypePlaysRole.PlayedRoleDomainRoleId) { - SignificantFactTypeChange(((Role)e.OldRolePlayer).FactType); + SignificantFactTypeChange(((Role)e.OldRolePlayer).BinarizedFactType); } else { SignificantObjectTypeChange((ObjectType)e.OldRolePlayer); } SignificantObjectTypeChange(link.RolePlayer); - SignificantFactTypeChange(link.PlayedRole.FactType); + SignificantFactTypeChange(link.PlayedRole.BinarizedFactType); } #endregion // ORM modification rule methods #region Bridge deletion rule methods Modified: trunk/Oial/ORMOialBridge/OialModelIsForORMModel.cs =================================================================== --- trunk/Oial/ORMOialBridge/OialModelIsForORMModel.cs 2009-03-18 00:22:10 UTC (rev 1371) +++ trunk/Oial/ORMOialBridge/OialModelIsForORMModel.cs 2009-03-20 23:38:59 UTC (rev 1372) @@ -867,6 +867,7 @@ foreach (ConceptType conceptType in this.AbstractionModel.ConceptTypeCollection) { ObjectType objectType = ConceptTypeIsForObjectType.GetObjectType(conceptType); + bool? conceptTypeHasDeepMappingAway = null; // NOTE: We don't need the ShouldIgnoreObjectType filter here, because object // types that we want to ignore won't be in the OIAL model in the first place. @@ -884,7 +885,7 @@ { // The fact type has a mapping and that mapping is towards the role played by // this concept type, so we need to generate concept type children for it. - GenerateConceptTypeChildrenForFactTypeMapping(factTypeMappings, conceptType, factTypeMapping, factTypePath, true); + GenerateConceptTypeChildrenForFactTypeMapping(factTypeMappings, conceptType, ref conceptTypeHasDeepMappingAway, factTypeMapping, factTypePath, true); } } } @@ -900,6 +901,10 @@ /// <param name="parentConceptType"> /// The <see cref="ConceptType"/> into which <see cref="ConceptTypeChild">concept type children</see> should be generated. /// </param> + /// <param name="parentConceptTypeHasDeepAway"> + /// Test if the parent concept type has a deep mapping away from it. Handles some cyclic cases by making a potential assimilation + /// into a reference. Delay calculated because this is not always needed. + /// </param> /// <param name="factTypeMapping"> /// The <see cref="FactTypeMapping"/> for which <see cref="ConceptTypeChild">concept type children</see> should be generated. /// </param> @@ -909,7 +914,7 @@ /// <param name="isMandatorySoFar"> /// Indicates whether every step in <paramref name="factTypePath"/> is mandatory for the parent concept type (towards object type). /// </param> - private static void GenerateConceptTypeChildrenForFactTypeMapping(FactTypeMappingDictionary factTypeMappings, ConceptType parentConceptType, FactTypeMapping factTypeMapping, List<FactType> factTypePath, bool isMandatorySoFar) + private static void GenerateConceptTypeChildrenForFactTypeMapping(FactTypeMappingDictionary factTypeMappings, ConceptType parentConceptType, ref bool? parentConceptTypeHasDeepAway, FactTypeMapping factTypeMapping, List<FactType> factTypePath, bool isMandatorySoFar) { // Push the current fact type onto the path. factTypePath.Add(factTypeMapping.FactType); @@ -1080,8 +1085,46 @@ // UNDONE: Would we ever want to use a depth other than shallow here? Probably not, but it might be worth looking in to. preferredIdentifierFactTypeMapping = new FactTypeMapping(preferredIdentifierFactType, preferredIdentifierFactTypeMapping.TowardsRole, preferredIdentifierFactTypeMapping.FromRole, MappingDepth.Shallow); } + else if (preferredIdentifierFactTypeMapping.MappingDepth == MappingDepth.Deep) + { + // Handle cyclic deep mapping scenario with collapsed entities. + // The primary scenario here is: + // 1) B is a subtype of A and identified by A's identifier + // 2) A and B participate in an objectified 1-1 FactType + // 3) The uniqueness constraint on the A role is the preferred identifier + // 4) The A role is mandatory + // In this case, without this code, you get an assimilation mapping B into A + // and mapping A into B. We fix this case by forwarding a shallow mapping, + // which generates a reference instad of an assimilation. + if (!parentConceptTypeHasDeepAway.HasValue) + { + ObjectType objectType = ConceptTypeIsForObjectType.GetObjectType(parentConceptType); + foreach (Role role in ConceptTypeIsForObjectType.GetObjectType(parentConceptType).PlayedRoleCollection) + { + FactType factType; + FactTypeMapping testMapping; + if (null != (factType = role.BinarizedFactType) && + factTypeMappings.TryGetValue(factType, out testMapping) && + testMapping.MappingDepth == MappingDepth.Deep && + testMapping.FromObjectType == objectType) + { + preferredIdentifierFactTypeMapping = new FactTypeMapping(preferredIdentifierFactType, preferredIdentifierFactTypeMapping.FromRole, preferredIdentifierFactTypeMapping.TowardsRole, MappingDepth.Shallow); + parentConceptTypeHasDeepAway = true; + break; + } + } + if (!parentConceptTypeHasDeepAway.HasValue) + { + parentConceptTypeHasDeepAway = false; + } + } + else if (parentConceptTypeHasDeepAway.Value) + { + preferredIdentifierFactTypeMapping = new FactTypeMapping(preferredIdentifierFactType, preferredIdentifierFactTypeMapping.FromRole, preferredIdentifierFactTypeMapping.TowardsRole, MappingDepth.Shallow); + } + } - GenerateConceptTypeChildrenForFactTypeMapping(factTypeMappings, parentConceptType, preferredIdentifierFactTypeMapping, factTypePath, isMandatory); + GenerateConceptTypeChildrenForFactTypeMapping(factTypeMappings, parentConceptType, ref parentConceptTypeHasDeepAway, preferredIdentifierFactTypeMapping, factTypePath, isMandatory); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-03-18 00:22:18
|
Revision: 1371 http://orm.svn.sourceforge.net/orm/?rev=1371&view=rev Author: mcurland Date: 2009-03-18 00:22:10 +0000 (Wed, 18 Mar 2009) Log Message: ----------- NORMA schema catalogs (installed in Xml\Schemas in the Visual Studio directories) are pointing to the old install directory. Missed case from [1365], the symptom is that opening an .orm file as .xml fails to find schemas for the contained elements. refs #388 Modified Paths: -------------- trunk/Setup/NORMASchemaCatalog.VS2005.xml trunk/Setup/NORMASchemaCatalog.VS2008.xml Modified: trunk/Setup/NORMASchemaCatalog.VS2005.xml =================================================================== --- trunk/Setup/NORMASchemaCatalog.VS2005.xml 2009-03-14 00:36:34 UTC (rev 1370) +++ trunk/Setup/NORMASchemaCatalog.VS2005.xml 2009-03-18 00:22:10 UTC (rev 1371) @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <SchemaCatalog xmlns="http://schemas.microsoft.com/xsd/catalog"> - <Catalog href="%ProgramFiles%/Neumont/ORM Architect for Visual Studio 2005/Xml/Schemas/catalog.xml"/> + <Catalog href="%ProgramFiles%/ORM Solutions/ORM Architect for Visual Studio 2005/Xml/Schemas/catalog.xml"/> </SchemaCatalog> \ No newline at end of file Modified: trunk/Setup/NORMASchemaCatalog.VS2008.xml =================================================================== --- trunk/Setup/NORMASchemaCatalog.VS2008.xml 2009-03-14 00:36:34 UTC (rev 1370) +++ trunk/Setup/NORMASchemaCatalog.VS2008.xml 2009-03-18 00:22:10 UTC (rev 1371) @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <SchemaCatalog xmlns="http://schemas.microsoft.com/xsd/catalog"> - <Catalog href="%ProgramFiles%/Neumont/ORM Architect for Visual Studio 2008/Xml/Schemas/catalog.xml"/> + <Catalog href="%ProgramFiles%/ORM Solutions/ORM Architect for Visual Studio 2008/Xml/Schemas/catalog.xml"/> </SchemaCatalog> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-03-14 00:36:48
|
Revision: 1370 http://orm.svn.sourceforge.net/orm/?rev=1370&view=rev Author: mcurland Date: 2009-03-14 00:36:34 +0000 (Sat, 14 Mar 2009) Log Message: ----------- Updated readme file for Febrary 2009 release. refs #193 Modified Paths: -------------- trunk/Setup/Readme.htm Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2009-03-12 00:45:35 UTC (rev 1369) +++ trunk/Setup/Readme.htm 2009-03-14 00:36:34 UTC (rev 1370) @@ -3,7 +3,7 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> -<title>NORMA January 2009 CTP Readme</title> +<title>NORMA February 2009 CTP Readme</title> <style type="text/css"> .new {font-size:x-small; background-color:Gold; color:Blue; } li {padding-bottom: 3px;} @@ -12,9 +12,9 @@ <body> -<p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA January 2009 CTP Readme</a> </b></p> +<p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA February 2009 CTP Readme</a> </b></p> <p>This file supersedes the previous readme.txt and older readme.htm files. This readme has parallel indexing mechanisms: by topic, and by release date (starting with the October 2008 (2008-10) release, I won't be adding historical dates). The file will be extended for future product releases.<br/><br/> -The January 2009 drop is a bug-fix drop with no new major functionality relative to the December 2008 CTP release. +The February 2009 drop adds grouping support and a number of stability improvements in the tool. <br/><br/></p> <h2>Contents</h2> <ul> @@ -26,6 +26,7 @@ <li><a href="#SamplePopulation">Sample Population</a></li> <li><a href="#Notation">ORM Notation</a></li> <li><a href="#Notes and Definitions">Notes and Definitions</a></li> + <li><a href="#Groups">Groups</a></li> <li><a href="#Relational">Relational Extensions</a></li> <li><a href="#Database Import">Database Import</a></li> <li><a href="#Code Generation">Code Generation</a></li> @@ -39,8 +40,26 @@ <li><a href="#TOPIC DAILY">TOPIC DESCRIPTION</a> (Changeset ####)</li> </ul>--> <hr/> +<h2>February 2009 CTP Changes</h2> +<div>The February 2009 CTP drop includes all modifications through changeset 1370. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<ul> +<li><a href="#Element Grouping 2009-02">Element Grouping</a> </li> +<li>Other Changes: +<ol> +<li>The absorption algorithm has been changed to eliminate extreme memory consumption and the associated performance slowdowns in a number of common cases. Specifically, we will not absorb towards an implied mandatory constraint if considering that constraint results in a symmetric (meaning both roles are mandatory, or both roles are not mandatory) one-to-one FactType.</li> +<li>The toolbox issue where a ValueType drops as an EntityType has been fixed (hopefully once and for all).</li> +<li>Verbalization of spanning uniqueness constraints is now more specific.</li> +<li>The name of the <em>Informal Definition</em> tool window has been changed to <em>Informal Desription</em> to better reflect what it is.</li> +<li>The default verbalization color for Note and Description fields is now black instead of dark grey, which was difficult to see. The lack of color emphasizes the lack of formal semantics. Note that the verbalization colors can be changed using the <em>Environment/Fonts and Colors</em> page of the <em>Tools/Options</em> dialog. Choose the <em>ORM Verbalizer</em> value in the <em>Show settings for</em> dropdown to see the available color categories.</li> +<li>The number of tool window refreshes has been reduced. This should improve performance when the selection changes, and enables the Verbalization Browser hyperlinks to be clicked directly when an element is selected in the primary document window. Previously, clicking the hyperlink with a document window focused would first repopulate the tool windows, which would invalidate the hyperlink and force a second click.</li> +<li>A number of issues with exclusive or constraints were fixed (reloading the model displayed both halves of the constraint in the model browser; if multiple shapes were defined for the constraint then only the selected one would be visibly split while the others shapes just moved left; the constraint could not be dropped from the model browser).</li> +<li>Neumont University stopped funding this project in June 2008 (changeset number 1313 was the final Neumont-funded submission). We have no license (nor are we seeking a license) to continue use of their trademarked name. The official product name is now 'Natural Object-Role Modeling Architect', and the new backing company is ORM Solutions, LLC. Dll names, product installation directories, registry entries, and setup screens have been changed accordingly. We will migrate XML schema namespaces when schemas require a new version, but did not want to submit our users to an unnecessary file format upgrade by modifying the XML schema names.</li> +</ol> +</li> +</ul> +<hr/> <h2>January 2009 CTP Changes</h2> -<div>The Januar 2009 CTP drop includes all modifications through changeset 1356. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The January 2009 CTP drop includes all modifications through changeset 1356.</div> <ul> <li><a href="#FactEditor Inverse Readings 2009-01">Fact Editor inverse readings</a> </li> <li>Other Changes: @@ -242,6 +261,22 @@ The Notes and InformationDefinition semantics are now supported with a Model selection. The resulting information is verbalized and appears in the generated reports.</li> </ol> <a href="#The Top">Return to top</a> +<hr /> +<h3><a id="Groups">Groups</a></h3> +<ol> +<li><a id="Element Grouping 2009-02" class="new" title="February 2009 CTP: Element Grouping">2009-02</a> +The <em>Groups</em> menu and corresponding Model Browser node is a facility for applying arbitrary grouping across elements of a model. This can be used to track groups of elements within a model in any way the user chooses. However, the full power of groups will be more apparent in future tool releases that apply additional meaning to these groups of elements through the notion of <em>Group Types</em>. Note that there are no group types installed with the initial (February 2009) release, we've just added the facility. +<ul> +<li>A new group can be added via the context menu on the Groups node in the Model Browser, or by the <em>Groups/Include In/New Group</em> command. Groups can be renamed the same as any other element (via the Properties Window, or by pressing F2 to edit the name inline in the Model Browser).</li> +<li>Most elements can be dragged onto a Group node to add them to the group. Any element than cannot be dragged (for example, Role and Internal UniquessConstraint) can be included in a group using the Groups menu, or by dragging the individual elements from another branch of the model browser.</li> +<li>Elements can be deleted from a group using the Groups menu or by using 'Delete' with the linked element selection in the Model Browser.</li> +<li>Double-clicking a linked element in the Model Browser will navigate to the specified element. It is possible for a grouped element to have no corresponding primary node in the tree. These elements do not provide a link indicator on the icon.</li> +<li>[The remaining points are part of the grouping facility, but are not applicable until group types are added in future releases.] The <em>GroupTypes</em> property contains a checked list of Group Types, which can be added to the system by extension models. Multiple group types can be specified for one group. A group type can automatically add member elements to a group as well as blocking elements from inclusion in the group.</li> +<li>The <em>GroupTypeCompliance</em> property is used to determine how tightly the group types control constrain group membership. The default setting (<em>Not Excluded)</em> allows element inclusion as long as no group type explicitly excludes the element. The other two settings (<em>Approved by Some Type</em> and <em>Approved by All types</em>) require one or all associated group types to either formally recognize or automatically include the element. Any automatically included elements can be explicitly excluded by the user, and will appear greyed out with an 'x' on the icon. If an element is automatically included by one group type and excluded by another then an error state is display with a '?' on the group member icon and a validation error '!' on the group node icon.</li> +</ul> +</li> +</ol> +<a href="#The Top">Return to top</a> <hr/> <h3><a id="Relational">Relational Extensions</a></h3> <ol> @@ -294,6 +329,8 @@ <ol> <li>We have had cases where the Custom Properties extension does not work correctly on Vista. The 'PropertiesEditor' property is available on the model, but the custom properties do not appear on the target elements. This does not happen on all machines, but when it does, the workaround is to launch VS2008 as an administrator instead of as a normal user.</li> <li>The FactEditor has refused to load properly immediate after installation on Visual Studio 2008. Restarting Visual Studio fixed the problem.</li> +<li>Occasionally when closing Visual Studio, a message appears stating that a modal dialog is open, and VS must be forcibly terminated with the task manager.</li> +<li>Reloading a model can reveal duplicate name errors on generated names for UniquenessConstraint and ImpliedMandatoryConstraint. The UniquenessConstraint errors are easily fixed because they can be selected in the model browser (double click the error, delete the name to regenerate one of the names), but the implied mandatory constraints cannot be selected. The are two ways to fix these: open the .orm file with an xml editor (Open With in Visual Studio, notepad also works) and delete one of the offending name occurrences then reload in NORMA, or use the Store Viewer (a debug common on the context menu) to determine an Object Type associated with the offending constraint. In the Store Viewer, select and recursively expand the ORMStore/Partition/Links/ObjectTypeImpliesMandatoryConstraint node (recursive expansion is done with the * key on the number pad), then scan for the offending constraint name, note the ObjectType name above it, and close the dialog. Find that ObjectType in the model and toggle (twice) either the IsIndependent property on the ObjectType or the IsMandatory property on an optional attached role. The naming error will go away. My apologies for the hassle, I just haven't managed to reproduce the scenario that causes this problem, and the issue is not visible until the file is reloaded.</li> </ol> </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-03-12 00:45:39
|
Revision: 1369 http://orm.svn.sourceforge.net/orm/?rev=1369&view=rev Author: mcurland Date: 2009-03-12 00:45:35 +0000 (Thu, 12 Mar 2009) Log Message: ----------- Changed default color for verbalized notes to Black (anything other dark gray, per Terry's request). Note that this setting can be modified in the Environment/Fonts and Colors tab of the Tools/Options dialog. Choose 'Show settings for' and pick the 'ORM Verbalizer', then change the Notes setting. refs #211 Modified Paths: -------------- trunk/ORMModel/Shell/ORMFontsAndColors.cs Modified: trunk/ORMModel/Shell/ORMFontsAndColors.cs =================================================================== --- trunk/ORMModel/Shell/ORMFontsAndColors.cs 2009-03-12 00:01:10 UTC (rev 1368) +++ trunk/ORMModel/Shell/ORMFontsAndColors.cs 2009-03-12 00:45:35 UTC (rev 1369) @@ -347,7 +347,7 @@ ,new DefaultColorSetting( VerbalizerNotesItemColorName, ResourceStrings.FontsAndColorsVerbalizerNotesItemColorId, - (uint)COLORINDEX.CI_DARKGRAY | StandardPaletteBit, + (uint)COLORINDEX.CI_BLACK | StandardPaletteBit, (int)COLORINDEX.CI_SYSPLAINTEXT_BK | StandardPaletteBit, __FCITEMFLAGS.FCIF_ALLOWFGCHANGE | __FCITEMFLAGS.FCIF_ALLOWCUSTOMCOLORS | __FCITEMFLAGS.FCIF_ALLOWBOLDCHANGE, false) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-03-07 00:59:43
|
Revision: 1367 http://orm.svn.sourceforge.net/orm/?rev=1367&view=rev Author: mcurland Date: 2009-03-07 00:59:36 +0000 (Sat, 07 Mar 2009) Log Message: ----------- Fixed serialization generator bug where SupportedCustomSerializedOperations.LinkInfo is not generating if an Element has StandaloneLink and Container elements with no Link elements. refs #328 Modified Paths: -------------- trunk/ORMModel/Transforms/SerializationExtensions.xslt Modified: trunk/ORMModel/Transforms/SerializationExtensions.xslt =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-03-06 20:55:30
|
Revision: 1366 http://orm.svn.sourceforge.net/orm/?rev=1366&view=rev Author: mcurland Date: 2009-03-06 20:55:19 +0000 (Fri, 06 Mar 2009) Log Message: ----------- ORMSolutions.ORMArchitectContinuation of [1365]. Assembly names need to be changed in VS item templates (file new fails). refs #388 Modified Paths: -------------- trunk/ORMModel/Shell/ProjectItems/VS2005/General.zip trunk/ORMModel/Shell/ProjectItems/VS2008/General.zip trunk/Tools/DatabaseImport/ProjectItems/VS2005/CSharp.zip trunk/Tools/DatabaseImport/ProjectItems/VS2005/General.zip trunk/Tools/DatabaseImport/ProjectItems/VS2005/JSharp.zip trunk/Tools/DatabaseImport/ProjectItems/VS2005/VisualBasic.zip trunk/Tools/DatabaseImport/ProjectItems/VS2005/VisualC.zip trunk/Tools/DatabaseImport/ProjectItems/VS2005/Web/CSharp.zip trunk/Tools/DatabaseImport/ProjectItems/VS2005/Web/JSharp.zip trunk/Tools/DatabaseImport/ProjectItems/VS2005/Web/VisualBasic.zip trunk/Tools/DatabaseImport/ProjectItems/VS2008/CSharp.zip trunk/Tools/DatabaseImport/ProjectItems/VS2008/General.zip trunk/Tools/DatabaseImport/ProjectItems/VS2008/VisualBasic.zip trunk/Tools/DatabaseImport/ProjectItems/VS2008/VisualC.zip trunk/Tools/DatabaseImport/ProjectItems/VS2008/Web/CSharp.zip trunk/Tools/DatabaseImport/ProjectItems/VS2008/Web/VisualBasic.zip Modified: trunk/ORMModel/Shell/ProjectItems/VS2005/General.zip =================================================================== (Binary files differ) Modified: trunk/ORMModel/Shell/ProjectItems/VS2008/General.zip =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseImport/ProjectItems/VS2005/CSharp.zip =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseImport/ProjectItems/VS2005/General.zip =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseImport/ProjectItems/VS2005/JSharp.zip =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseImport/ProjectItems/VS2005/VisualBasic.zip =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseImport/ProjectItems/VS2005/VisualC.zip =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseImport/ProjectItems/VS2005/Web/CSharp.zip =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseImport/ProjectItems/VS2005/Web/JSharp.zip =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseImport/ProjectItems/VS2005/Web/VisualBasic.zip =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseImport/ProjectItems/VS2008/CSharp.zip =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseImport/ProjectItems/VS2008/General.zip =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseImport/ProjectItems/VS2008/VisualBasic.zip =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseImport/ProjectItems/VS2008/VisualC.zip =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseImport/ProjectItems/VS2008/Web/CSharp.zip =================================================================== (Binary files differ) Modified: trunk/Tools/DatabaseImport/ProjectItems/VS2008/Web/VisualBasic.zip =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-03-04 00:10:36
|
Revision: 1363 http://orm.svn.sourceforge.net/orm/?rev=1363&view=rev Author: mcurland Date: 2009-03-04 00:10:35 +0000 (Wed, 04 Mar 2009) Log Message: ----------- A couple of fixes for [1162]. refs #387 * Deleting one reference from the model browser lost track of remaining reference nodes * Population of the 'delete from group' did not correctly break out of the inner loop Modified Paths: -------------- trunk/ORMModel/Framework/Shell/DynamicSurveyTreeGrid/SurveyClasses.cs trunk/ORMModel/Shell/ORMDesignerCommandManager.cs Modified: trunk/ORMModel/Framework/Shell/DynamicSurveyTreeGrid/SurveyClasses.cs =================================================================== --- trunk/ORMModel/Framework/Shell/DynamicSurveyTreeGrid/SurveyClasses.cs 2009-02-27 21:44:05 UTC (rev 1362) +++ trunk/ORMModel/Framework/Shell/DynamicSurveyTreeGrid/SurveyClasses.cs 2009-03-04 00:10:35 UTC (rev 1363) @@ -602,6 +602,7 @@ myReferenceDictionary.TryGetValue(element, out headLinkNode)) { LinkedNode<SurveyNodeReference> linkNode = headLinkNode; + LinkedNode<SurveyNodeReference> startHeadLinkNode = headLinkNode; while (linkNode != null) { SurveyNodeReference link = linkNode.Value; @@ -628,6 +629,10 @@ } } } + else if (startHeadLinkNode != headLinkNode) + { + myReferenceDictionary[element] = headLinkNode; + } } } void INotifySurveyElementChanged.ElementReferenceDeleted(object element, object referenceReason, object contextElement) Modified: trunk/ORMModel/Shell/ORMDesignerCommandManager.cs =================================================================== --- trunk/ORMModel/Shell/ORMDesignerCommandManager.cs 2009-02-27 21:44:05 UTC (rev 1362) +++ trunk/ORMModel/Shell/ORMDesignerCommandManager.cs 2009-03-04 00:10:35 UTC (rev 1363) @@ -1460,14 +1460,23 @@ ElementGrouping grouping = groupings[i]; for (int j = 0; j < selectedElementCount; ++j) { + bool allowGroupDeletion; switch (grouping.GetMembershipType(normalizedElements[j])) { case GroupingMembershipType.Inclusion: case GroupingMembershipType.Contradiction: - cachedGroupings[allowedGroupingCount] = grouping; - ++allowedGroupingCount; + allowGroupDeletion = true; break; + default: + allowGroupDeletion = false; + break; } + if (allowGroupDeletion) + { + cachedGroupings[allowedGroupingCount] = grouping; + ++allowedGroupingCount; + break; + } } } if (allowedGroupingCount < groupingCount) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-02-19 05:44:58
|
Revision: 1360 http://orm.svn.sourceforge.net/orm/?rev=1360&view=rev Author: mcurland Date: 2009-02-19 05:44:54 +0000 (Thu, 19 Feb 2009) Log Message: ----------- Change UserData keys placed on the toolbox to be strings instead of simple objects. This should allow us to compare these keys across VS sessions and fix the lingering undraggable ValueType issue. refs #385 Also removed the PublicKeyToken for the wix extension assembly from the setup project. The token changes with different Wix versions. Modified Paths: -------------- trunk/ORMModel/ObjectModel/FactType.cs trunk/ORMModel/ObjectModel/ORMModel.cs trunk/Setup/Setup.wixproj Modified: trunk/ORMModel/ObjectModel/FactType.cs =================================================================== --- trunk/ORMModel/ObjectModel/FactType.cs 2009-02-10 03:54:56 UTC (rev 1359) +++ trunk/ORMModel/ObjectModel/FactType.cs 2009-02-19 05:44:54 UTC (rev 1360) @@ -420,7 +420,7 @@ DomainClassInfo classInfo = Store.DomainDataDirectory.FindDomainClass(rootElement.DomainClassId); if (classInfo.IsDerivedFrom(UniquenessConstraint.DomainClassId)) { - return elementGroupPrototype.UserData == ORMModel.InternalUniquenessConstraintUserDataKey; + return ORMModel.InternalUniquenessConstraintUserDataKey.Equals(elementGroupPrototype.UserData as string); } } return false; Modified: trunk/ORMModel/ObjectModel/ORMModel.cs =================================================================== --- trunk/ORMModel/ObjectModel/ORMModel.cs 2009-02-10 03:54:56 UTC (rev 1359) +++ trunk/ORMModel/ObjectModel/ORMModel.cs 2009-02-19 05:44:54 UTC (rev 1360) @@ -132,7 +132,7 @@ private void MergeRelateObjectType(ModelElement sourceElement, ElementGroup elementGroup) { ObjectType objectType = sourceElement as ObjectType; - if (elementGroup.UserData == ORMModel.ValueTypeUserDataKey) + if (ORMModel.ValueTypeUserDataKey.Equals(elementGroup.UserData as string)) { objectType.DataType = ((ORMModel)this).DefaultDataType; } @@ -150,7 +150,7 @@ } private bool CanMergeSetConstraint(ProtoElementBase rootElement, ElementGroupPrototype elementGroupPrototype) { - return elementGroupPrototype.UserData != ORMModel.InternalUniquenessConstraintUserDataKey; + return !ORMModel.InternalUniquenessConstraintUserDataKey.Equals(elementGroupPrototype.UserData as string); } #endregion // MergeContext functions } @@ -161,12 +161,12 @@ /// Used as the value for <see cref="ElementGroup.UserData"/> to indicate that the /// <see cref="ObjectType"/> should be a ValueType. /// </summary> - public static readonly object ValueTypeUserDataKey = new object(); + public const string ValueTypeUserDataKey = "CreateAsValueType"; /// <summary> /// Used as the value for <see cref="ElementGroup.UserData"/> to indicate that the /// <see cref="UniquenessConstraint"/> is internal. /// </summary> - public static readonly object InternalUniquenessConstraintUserDataKey = new object(); + public const string InternalUniquenessConstraintUserDataKey = "CreateAsInternalUniqueness"; #endregion // ElementGroup.UserData keys #region Entity- and ValueType specific collections /// <summary> Modified: trunk/Setup/Setup.wixproj =================================================================== --- trunk/Setup/Setup.wixproj 2009-02-10 03:54:56 UTC (rev 1359) +++ trunk/Setup/Setup.wixproj 2009-02-19 05:44:54 UTC (rev 1360) @@ -66,7 +66,7 @@ <Compile Include="UI\WelcomeDlg.wxs" /> </ItemGroup> <ItemGroup> - <WixExtension Include="WixVSExtension, Culture=neutral, PublicKeyToken=ce35f76fcda82bad"> + <WixExtension Include="WixVSExtension, Culture=neutral"> <Class>Microsoft.Tools.WindowsInstallerXml.Extensions.VSExtension</Class> <Private>False</Private> </WixExtension> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-02-10 03:55:00
|
Revision: 1359 http://orm.svn.sourceforge.net/orm/?rev=1359&view=rev Author: mcurland Date: 2009-02-10 03:54:56 +0000 (Tue, 10 Feb 2009) Log Message: ----------- Pass registry key to constructor of ORMCustomTool generators with type="class". refs #167 Modified Paths: -------------- trunk/ORMModel/Shell/ORMPackage.cs trunk/Setup/Readme.htm trunk/Tools/ORMCustomTool/ORMGenerators.cs Modified: trunk/ORMModel/Shell/ORMPackage.cs =================================================================== --- trunk/ORMModel/Shell/ORMPackage.cs 2009-02-10 03:50:59 UTC (rev 1358) +++ trunk/ORMModel/Shell/ORMPackage.cs 2009-02-10 03:54:56 UTC (rev 1359) @@ -429,14 +429,13 @@ if (hadRevisionsKey && hitCount != valueNames.Length) { refreshRequired = true; - for (int i = 0; i < valueNames.Length; --i) + for (int i = 0; i < valueNames.Length; ++i) { string removeValue = valueNames[i]; if (removeValue != null) { toolboxRevisionsKey.DeleteValue(removeValue, false); } - } } } Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2009-02-10 03:50:59 UTC (rev 1358) +++ trunk/Setup/Readme.htm 2009-02-10 03:54:56 UTC (rev 1359) @@ -5,7 +5,7 @@ <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> <title>NORMA January 2009 CTP Readme</title> <style type="text/css"> - .new {font-size:x-small; color:Gold; } + .new {font-size:x-small; background-color:Gold; color:Blue; } li {padding-bottom: 3px;} </style> </head> Modified: trunk/Tools/ORMCustomTool/ORMGenerators.cs =================================================================== --- trunk/Tools/ORMCustomTool/ORMGenerators.cs 2009-02-10 03:50:59 UTC (rev 1358) +++ trunk/Tools/ORMCustomTool/ORMGenerators.cs 2009-02-10 03:54:56 UTC (rev 1359) @@ -138,7 +138,7 @@ } assemblyName.CodeBase = codeBase; - return (IORMGenerator)Activator.CreateInstance(Assembly.Load(assemblyName).GetType(typeName, true, false)); + return (IORMGenerator)Activator.CreateInstance(Assembly.Load(assemblyName).GetType(typeName, true, false), generatorKey); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-02-06 20:18:21
|
Revision: 1357 http://orm.svn.sourceforge.net/orm/?rev=1357&view=rev Author: mcurland Date: 2009-02-06 20:18:17 +0000 (Fri, 06 Feb 2009) Log Message: ----------- Make 'occurs in population' snippets more specific for unary and spanning uniqueness constraints. fixes #384 Modified Paths: -------------- trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xsd trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs Modified: trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml 2009-02-05 20:37:06 UTC (rev 1356) +++ trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml 2009-02-06 20:18:17 UTC (rev 1357) @@ -63,8 +63,8 @@ <Snippet type="OneQuantifier" sign="negative"><![CDATA[<span class="quantifier">more than one</span> {0}]]></Snippet> - <Snippet type="OccursInPopulation" sign="positive"><![CDATA[{0} <span class="quantifier">occurs at most once in the population of</span> {1}]]></Snippet> - <Snippet type="OccursInPopulation" sign="negative"><![CDATA[{0} <span class="quantifier">occurs more than once in the population of</span> {1}]]></Snippet> + <Snippet type="OccursInPopulation" sign="positive"><![CDATA[<span class="quantifier">in each population of</span> {1}<span class="quantifier">, </span>{0} <span class="quantifier">occurs at most once</span>]]></Snippet> + <Snippet type="OccursInPopulation" sign="negative"><![CDATA[{0} <span class="quantifier">occurs more than once in the same population of</span> {1}]]></Snippet> <Snippet type="ModalPossibilityOperator" modality="alethic" sign="positive"><![CDATA[<span class="quantifier">it is possible that</span> {0}]]></Snippet> <Snippet type="ModalPossibilityOperator" modality="deontic" sign="positive"><![CDATA[<span class="quantifier">it is permitted that</span> {0}]]></Snippet> Modified: trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xsd =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xsd 2009-02-05 20:37:06 UTC (rev 1356) +++ trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xsd 2009-02-06 20:18:17 UTC (rev 1357) @@ -733,8 +733,8 @@ <xs:annotation> <xs:documentation> Description: Verbalizes that an object occurs at most once or more than once in a given population. - Format positive: {0} occurs at most once in the population of {1} - Format negative: {0} occurs more than once in the population of {1} + Format positive: in each population of {1}, {0} occurs at most once + Format negative: {0} occurs more than once in the same population of {1} </xs:documentation> </xs:annotation> </xs:enumeration> Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2009-02-05 20:37:06 UTC (rev 1356) +++ trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2009-02-06 20:18:17 UTC (rev 1357) @@ -484,7 +484,7 @@ @"<span class=""listSeparator"">, </span>", @"<span class=""objectTypeMissing"">Missing<sub>{0}</sub></span>", @"<a class=""objectType"" href=""elementid:{1}"">{0}<sub>{2}</sub></a>", - @"{0} <span class=""quantifier"">occurs at most once in the population of</span> {1}", + @"<span class=""quantifier"">in each population of</span> {1}<span class=""quantifier"">, </span>{0} <span class=""quantifier"">occurs at most once</span>", @"<span class=""quantifier"">at most one</span> {0}", @"{0}<span class=""listSeparator"">.</span>{1}", @"<span class=""quantifier"">who</span> {0}", @@ -675,7 +675,7 @@ @"<span class=""listSeparator"">, </span>", @"<span class=""objectTypeMissing"">Missing<sub>{0}</sub></span>", @"<a class=""objectType"" href=""elementid:{1}"">{0}<sub>{2}</sub></a>", - @"{0} <span class=""quantifier"">occurs at most once in the population of</span> {1}", + @"<span class=""quantifier"">in each population of</span> {1}<span class=""quantifier"">, </span>{0} <span class=""quantifier"">occurs at most once</span>", @"<span class=""quantifier"">at most one</span> {0}", @"{0}<span class=""listSeparator"">.</span>{1}", @"<span class=""quantifier"">who</span> {0}", @@ -866,7 +866,7 @@ @"<span class=""listSeparator"">, </span>", @"<span class=""objectTypeMissing"">Missing<sub>{0}</sub></span>", @"<a class=""objectType"" href=""elementid:{1}"">{0}<sub>{2}</sub></a>", - @"{0} <span class=""quantifier"">occurs more than once in the population of</span> {1}", + @"{0} <span class=""quantifier"">occurs more than once in the same population of</span> {1}", @"<span class=""quantifier"">more than one</span> {0}", @"{0}<span class=""listSeparator"">.</span>{1}", @"<span class=""quantifier"">who</span> {0}", @@ -1057,7 +1057,7 @@ @"<span class=""listSeparator"">, </span>", @"<span class=""objectTypeMissing"">Missing<sub>{0}</sub></span>", @"<a class=""objectType"" href=""elementid:{1}"">{0}<sub>{2}</sub></a>", - @"{0} <span class=""quantifier"">occurs more than once in the population of</span> {1}", + @"{0} <span class=""quantifier"">occurs more than once in the same population of</span> {1}", @"<span class=""quantifier"">more than one</span> {0}", @"{0}<span class=""listSeparator"">.</span>{1}", @"<span class=""quantifier"">who</span> {0}", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-01-23 23:22:09
|
Revision: 1353 http://orm.svn.sourceforge.net/orm/?rev=1353&view=rev Author: mcurland Date: 2009-01-23 21:57:35 +0000 (Fri, 23 Jan 2009) Log Message: ----------- Absorption of a FactType needs to be reconsidered by the absorption gateway when an objectification is added/deleted. Adding and removing roles on objectified FactTypes allowed invalid FactTypes through the gateway. This was manifested by an aborted transaction (null reference exception) or more subtle errors of not readding columns for a reduction from a ternary to a functional binary FactType. refs #327 Also did some minor reorder of debinarization of a unary to avoid creating an implied FactType structure that is destroyed almost immediately. refs #367 Modified Paths: -------------- trunk/ORMModel/ObjectModel/Objectification.cs trunk/ORMModel/ObjectModel/UnaryBinarization.cs trunk/ORMModel/Shell/ORMReadingEditor.cs trunk/ORMModel/Shell/ReadingEditor.cs trunk/Oial/ORMOialBridge/ORMElementGateway.cs trunk/Oial/ORMOialBridge/ORMOialBridge.AttachRules.cs trunk/Oial/ORMOialBridge/ORMOialBridge.AttachRules.xml Modified: trunk/ORMModel/ObjectModel/Objectification.cs =================================================================== --- trunk/ORMModel/ObjectModel/Objectification.cs 2009-01-15 21:59:26 UTC (rev 1352) +++ trunk/ORMModel/ObjectModel/Objectification.cs 2009-01-23 21:57:35 UTC (rev 1353) @@ -742,14 +742,16 @@ ObjectType rolePlayer = link.RolePlayer; FactType factType; Objectification objectification; - // Note if the roleplayer is removed, then the links all go away - // automatically. There is no additional work to do or checks to make. - if (rolePlayer.IsDeleted || rolePlayer.IsDeleting) + if (rolePlayer.IsImplicitBooleanValue) { - if (rolePlayer.IsImplicitBooleanValue && - null != (factType = role.FactType) && + // The standard code to debinarize a FactType detaches the role first + // so that we can distinguish here whether we need to rebuild an implied + // FactType for the role. If the role is deleting before the implied value, + // then assume the implied value will be deleted right after this call as well. + if (null != (factType = role.FactType) && null != (objectification = factType.Objectification)) { + bool removeRolePlayer = role.IsDeleting && !(rolePlayer.IsDeleted || rolePlayer.IsDeleting); foreach (RoleBase otherRoleBase in factType.RoleCollection) { // Find the old unary role and modify its implied FactType @@ -757,7 +759,7 @@ FactType impliedFactType; Role otherRole; if (otherRoleBase != role && - !role.IsDeleting && + !otherRoleBase.IsDeleting && null != (objectifiedUnaryRole = (otherRole = otherRoleBase.Role).ObjectifiedUnaryRole) && !objectifiedUnaryRole.IsDeleting && null != (impliedFactType = objectifiedUnaryRole.FactType)) @@ -775,6 +777,8 @@ } ObjectType nestingType = objectification.NestingType; CreateImpliedFactTypeForRole(model, nestingType, otherRole, objectification, false); + // Note that even if this role is not currently being deleted it will be soon. There + // is no reason to keep these. Anything we create here will simply be deleted if (!role.IsDeleting && role.Proxy == null) { CreateImpliedFactTypeForRole(model, nestingType, role, objectification, false); @@ -782,9 +786,14 @@ break; } } + if (removeRolePlayer) + { + rolePlayer.Delete(); + } } } - else if (null != (factType = role.FactType)) + else if (!(rolePlayer.IsDeleted || rolePlayer.IsDeleting) && + null != (factType = role.FactType)) { SubtypeMetaRole subtypeRole; ObjectifiedUnaryRole objectifiedUnaryRole; Modified: trunk/ORMModel/ObjectModel/UnaryBinarization.cs =================================================================== --- trunk/ORMModel/ObjectModel/UnaryBinarization.cs 2009-01-15 21:59:26 UTC (rev 1352) +++ trunk/ORMModel/ObjectModel/UnaryBinarization.cs 2009-01-23 21:57:35 UTC (rev 1353) @@ -237,12 +237,23 @@ ruleManager.DisableRule(typeof(ObjectTypePlaysRoleDeletedRuleClass)); ruleDisabled = true; } - implicitBooleanValueType.Delete(); if (deleteImplicitBooleanRole) { + // We delete the role first so that rules do not + // try to recreate and implied fact type for this rule + // if it is part of an objectified FactType. implicitBooleanRole.Delete(); --roleCount; + if (!implicitBooleanValueType.IsDeleted) + { + // The Objectification.RolePlayerDeletingRule rule will delet this automatically + implicitBooleanValueType.Delete(); + } } + else + { + implicitBooleanValueType.Delete(); + } } finally { @@ -319,7 +330,7 @@ contextInfo.Remove(ORMModel.AllowDuplicateNamesKey); } } - if (!ValidateConstraints(unaryRole, implicitBooleanRole) || !ValidateImplictBooleanValueType(implicitBooleanRole.RolePlayer)) + if (!ValidateConstraints(unaryRole, implicitBooleanRole) || !ValidateImplicitBooleanValueType(implicitBooleanRole.RolePlayer)) { LinkedElementCollection<RoleBase> roles = factType.RoleCollection; DebinarizeUnary(roles, false, notifyAdded); @@ -416,7 +427,7 @@ /// Checks that only one role is played by the value type, that it has a boolean data type, and that /// if it has a value constraint, that value constraint is alethic and only allows the value 'true'. /// </summary> - private static bool ValidateImplictBooleanValueType(ObjectType implicitBooleanValueType) + private static bool ValidateImplicitBooleanValueType(ObjectType implicitBooleanValueType) { if (!implicitBooleanValueType.IsValueType || !implicitBooleanValueType.IsImplicitBooleanValue || implicitBooleanValueType.IsIndependent || implicitBooleanValueType.PlayedRoleCollection.Count != 1 || !(implicitBooleanValueType.DataType is TrueOrFalseLogicalDataType)) Modified: trunk/ORMModel/Shell/ORMReadingEditor.cs =================================================================== --- trunk/ORMModel/Shell/ORMReadingEditor.cs 2009-01-15 21:59:26 UTC (rev 1352) +++ trunk/ORMModel/Shell/ORMReadingEditor.cs 2009-01-23 21:57:35 UTC (rev 1353) @@ -193,9 +193,9 @@ FactType secondaryFact = null; if (selectedObjects != null) { - foreach (object o in selectedObjects) + foreach (object element in selectedObjects) { - FactType testFact = ORMEditorUtility.ResolveContextFactType(o); + FactType testFact = ORMEditorUtility.ResolveContextFactType(element); // Handle selection of multiple elements as long as // they all resolve to the same fact if (theFact == null) @@ -203,10 +203,17 @@ theFact = testFact; Role testImpliedRole; RoleProxy proxy; - if (null != (testImpliedRole = o as Role) && - null != (proxy = testImpliedRole.Proxy)) + ObjectifiedUnaryRole objectifiedUnaryRole; + if (null != (testImpliedRole = element as Role)) { - secondaryFact = proxy.FactType; + if (null != (proxy = testImpliedRole.Proxy)) + { + secondaryFact = proxy.FactType; + } + else if (null != (objectifiedUnaryRole = testImpliedRole.ObjectifiedUnaryRole)) + { + secondaryFact = objectifiedUnaryRole.FactType; + } } } else if (testFact != theFact) Modified: trunk/ORMModel/Shell/ReadingEditor.cs =================================================================== --- trunk/ORMModel/Shell/ReadingEditor.cs 2009-01-15 21:59:26 UTC (rev 1352) +++ trunk/ORMModel/Shell/ReadingEditor.cs 2009-01-23 21:57:35 UTC (rev 1353) @@ -1101,13 +1101,16 @@ return; } ReadingOrderHasReading link = e.ModelElement as ReadingOrderHasReading; - ReadingOrder readingOrder = link.ReadingOrder; - FactType fact = readingOrder.FactType; - if (fact == myFact || fact == mySecondaryFact) + if (!link.IsDeleted) { - myMainBranch.ReadingAdded(link.Reading); + ReadingOrder readingOrder = link.ReadingOrder; + FactType fact = readingOrder.FactType; + if (fact == myFact || fact == mySecondaryFact) + { + myMainBranch.ReadingAdded(link.Reading); + } + this.UpdateMenuItems(); } - this.UpdateMenuItems(); } private void ReadingLinkRemovedEvent(object sender, ElementDeletedEventArgs e) { @@ -1403,15 +1406,21 @@ /// <param name="reading">the reading to add</param> public void ReadingAdded(Reading reading) { - ReadingOrder order = reading.ReadingOrder; - if (order.FactType == myFact) + ReadingOrder order; + FactType orderFactType; + if (!reading.IsDeleted && + null != (order = reading.ReadingOrder) && + null != (orderFactType = order.FactType)) { - this.OrderBranch.ReadingAdded(reading); + if (orderFactType == myFact) + { + this.OrderBranch.ReadingAdded(reading); + } + else + { + this.ImpliedBranch.ReadingAdded(reading); + } } - else - { - this.ImpliedBranch.ReadingAdded(reading); - } } /// <summary> /// Triggers the events notifying the tree that a Reading in the Readingbranch has been updated. @@ -1920,36 +1929,38 @@ public void ReadingAdded(Reading reading) { ReadingOrder order = reading.ReadingOrder; - int location = this.LocateCollectionItem(order); - - if (location < 0) + if (order != null) { - this.PopulateReadingOrderInfo(order); - if (OnBranchModification != null) - { - int newLoc = this.LocateCollectionItem(order); - OnBranchModification(this, BranchModificationEventArgs.InsertItems(this, newLoc - 1, 1)); - OnBranchModification(this, BranchModificationEventArgs.UpdateCellStyle(this, newLoc, (int)ColumnIndex.ReadingBranch, true)); //may not be needed due to callback on update - //redraw off and back on in the branch if it has no more than 1 reading - } - } + int location = this.LocateCollectionItem(order); - if (location >= 0) - { - myReadingOrderKeyedCollection[location].EnsureBranch().AddReading(reading); - if (OnBranchModification != null) + if (location < 0) { - OnBranchModification(this, BranchModificationEventArgs.UpdateCellStyle(this, location, (int)ColumnIndex.ReadingBranch, true)); - - int actualIndex = myFact.ReadingOrderCollection.IndexOf(order); - if (actualIndex != location) + this.PopulateReadingOrderInfo(order); + if (OnBranchModification != null) { - this.ReadingOrderLocationUpdate(order); + int newLoc = this.LocateCollectionItem(order); + OnBranchModification(this, BranchModificationEventArgs.InsertItems(this, newLoc - 1, 1)); + OnBranchModification(this, BranchModificationEventArgs.UpdateCellStyle(this, newLoc, (int)ColumnIndex.ReadingBranch, true)); //may not be needed due to callback on update + //redraw off and back on in the branch if it has no more than 1 reading } - else + } + else + { + myReadingOrderKeyedCollection[location].EnsureBranch().AddReading(reading); + if (OnBranchModification != null) { - OnBranchModification(this, BranchModificationEventArgs.Redraw(false)); - OnBranchModification(this, BranchModificationEventArgs.Redraw(true)); + OnBranchModification(this, BranchModificationEventArgs.UpdateCellStyle(this, location, (int)ColumnIndex.ReadingBranch, true)); + + int actualIndex = myFact.ReadingOrderCollection.IndexOf(order); + if (actualIndex != location) + { + this.ReadingOrderLocationUpdate(order); + } + else + { + OnBranchModification(this, BranchModificationEventArgs.Redraw(false)); + OnBranchModification(this, BranchModificationEventArgs.Redraw(true)); + } } } } Modified: trunk/Oial/ORMOialBridge/ORMElementGateway.cs =================================================================== --- trunk/Oial/ORMOialBridge/ORMElementGateway.cs 2009-01-15 21:59:26 UTC (rev 1352) +++ trunk/Oial/ORMOialBridge/ORMElementGateway.cs 2009-01-23 21:57:35 UTC (rev 1353) @@ -379,7 +379,10 @@ if (forceCreate || null == ExcludedORMModelElement.GetAbstractionModel(factType)) { - new ExcludedORMModelElement(factType, model); + if (null == factType.Objectification || factType.UnaryRole != null) + { + new ExcludedORMModelElement(factType, model); + } if (notifyExcluded != null) { notifyExcluded(factType); @@ -689,6 +692,63 @@ }); } #endregion // Preferred Identifier Tracking Rules + #region Objectification Tracking Rules + /// <summary> + /// AddRule: typeof(Neumont.Tools.ORM.ObjectModel.Objectification) + /// Objectification FactTypes are automatically excluded, so changing + /// the objectification state is the same as adding/removing a blocking + /// error. + /// </summary> + private static void ObjectificationAddedRule(ElementAddedEventArgs e) + { + ProcessFactTypeForObjectificationAdded(((Objectification)e.ModelElement).NestedFactType); + } + private static void ProcessFactTypeForObjectificationAdded(FactType factType) + { + if (factType.UnaryRole == null) + { + ExcludedORMModelElement excludedLink = ExcludedORMModelElement.GetLinkToAbstractionModel(factType); + if (excludedLink != null) + { + // We don't keep the exclusion link on objectified FactTypes, but deleting + // it does not imply any additional processing because we were already not + // considering this FactType + excludedLink.Delete(); + } + else + { + FilterModifiedFactType(factType, false); // false because new implied FactTypes will get notifications on their own + } + } + } + private static void ProcessFactTypeForObjectificationDeleted(FactType factType) + { + if (!factType.IsDeleted && factType.UnaryRole == null) + { + FilterModifiedFactType(factType, false); // false because there are no implied facttypes without an objectification + } + } + /// <summary> + /// DeleteRule: typeof(Neumont.Tools.ORM.ObjectModel.Objectification) + /// </summary> + private static void ObjectificationDeletedRule(ElementDeletedEventArgs e) + { + ProcessFactTypeForObjectificationDeleted(((Objectification)e.ModelElement).NestedFactType); + } + /// <summary> + /// RolePlayerChangeRule: typeof(Neumont.Tools.ORM.ObjectModel.Objectification) + /// </summary> + private static void ObjectificationRolePlayerChangedRule(RolePlayerChangedEventArgs e) + { + Objectification link = (Objectification)e.ElementLink; + FactType factType; + if (e.DomainRole.Id == Objectification.NestedFactTypeDomainRoleId) + { + ProcessFactTypeForObjectificationDeleted((FactType)e.OldRolePlayer); + ProcessFactTypeForObjectificationAdded(link.NestedFactType); + } + } + #endregion // Objectification Tracking Rules #region RolePlayer tracking rules /// <summary> /// AddRule: typeof(Neumont.Tools.ORM.ObjectModel.ObjectTypePlaysRole) Modified: trunk/Oial/ORMOialBridge/ORMOialBridge.AttachRules.cs =================================================================== --- trunk/Oial/ORMOialBridge/ORMOialBridge.AttachRules.cs 2009-01-15 21:59:26 UTC (rev 1352) +++ trunk/Oial/ORMOialBridge/ORMOialBridge.AttachRules.cs 2009-01-23 21:57:35 UTC (rev 1353) @@ -44,6 +44,9 @@ typeof(AbstractionModelIsForORMModel).GetNestedType("ORMElementGateway", BindingFlags.Public | BindingFlags.NonPublic).GetNestedType("ObjectTypeAddedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(AbstractionModelIsForORMModel).GetNestedType("ORMElementGateway", BindingFlags.Public | BindingFlags.NonPublic).GetNestedType("ObjectTypeErrorAddedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(AbstractionModelIsForORMModel).GetNestedType("ORMElementGateway", BindingFlags.Public | BindingFlags.NonPublic).GetNestedType("ObjectTypeErrorDeletedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), + typeof(AbstractionModelIsForORMModel).GetNestedType("ORMElementGateway", BindingFlags.Public | BindingFlags.NonPublic).GetNestedType("ObjectificationAddedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), + typeof(AbstractionModelIsForORMModel).GetNestedType("ORMElementGateway", BindingFlags.Public | BindingFlags.NonPublic).GetNestedType("ObjectificationDeletedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), + typeof(AbstractionModelIsForORMModel).GetNestedType("ORMElementGateway", BindingFlags.Public | BindingFlags.NonPublic).GetNestedType("ObjectificationRolePlayerChangedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(AbstractionModelIsForORMModel).GetNestedType("ORMElementGateway", BindingFlags.Public | BindingFlags.NonPublic).GetNestedType("PreferredIdentifierAddedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(AbstractionModelIsForORMModel).GetNestedType("ORMElementGateway", BindingFlags.Public | BindingFlags.NonPublic).GetNestedType("RolePlayerAddedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(AbstractionModelIsForORMModel).GetNestedType("ORMElementGateway", BindingFlags.Public | BindingFlags.NonPublic).GetNestedType("RolePlayerDeletedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), @@ -96,7 +99,7 @@ { Microsoft.VisualStudio.Modeling.RuleManager ruleManager = store.RuleManager; Type[] disabledRuleTypes = ORMToORMAbstractionBridgeDomainModel.CustomDomainModelTypes; - for (int i = 0; i < 29; ++i) + for (int i = 0; i < 32; ++i) { ruleManager.EnableRule(disabledRuleTypes[i]); } @@ -389,6 +392,84 @@ Neumont.Tools.Modeling.Diagnostics.TraceUtility.TraceRuleEnd(e.ModelElement.Store, "Neumont.Tools.ORMToORMAbstractionBridge.AbstractionModelIsForORMModel.ORMElementGateway.ObjectTypeErrorDeletedRule"); } } + [Microsoft.VisualStudio.Modeling.RuleOn(typeof(Neumont.Tools.ORM.ObjectModel.Objectification), Priority=Neumont.Tools.Modeling.FrameworkDomainModel.InlineRulePriority)] + private sealed class ObjectificationAddedRuleClass : Microsoft.VisualStudio.Modeling.AddRule + { + [System.Diagnostics.DebuggerStepThrough()] + public ObjectificationAddedRuleClass() + { + base.IsEnabled = false; + } + /// <summary> + /// Provide the following method in class: + /// Neumont.Tools.ORMToORMAbstractionBridge.AbstractionModelIsForORMModel.ORMElementGateway + /// /// <summary> + /// /// AddRule: typeof(Neumont.Tools.ORM.ObjectModel.Objectification) + /// /// </summary> + /// private static void ObjectificationAddedRule(ElementAddedEventArgs e) + /// { + /// } + /// </summary> + [System.Diagnostics.DebuggerStepThrough()] + public override void ElementAdded(Microsoft.VisualStudio.Modeling.ElementAddedEventArgs e) + { + Neumont.Tools.Modeling.Diagnostics.TraceUtility.TraceRuleStart(e.ModelElement.Store, "Neumont.Tools.ORMToORMAbstractionBridge.AbstractionModelIsForORMModel.ORMElementGateway.ObjectificationAddedRule"); + ORMElementGateway.ObjectificationAddedRule(e); + Neumont.Tools.Modeling.Diagnostics.TraceUtility.TraceRuleEnd(e.ModelElement.Store, "Neumont.Tools.ORMToORMAbstractionBridge.AbstractionModelIsForORMModel.ORMElementGateway.ObjectificationAddedRule"); + } + } + [Microsoft.VisualStudio.Modeling.RuleOn(typeof(Neumont.Tools.ORM.ObjectModel.Objectification), Priority=Neumont.Tools.Modeling.FrameworkDomainModel.InlineRulePriority)] + private sealed class ObjectificationDeletedRuleClass : Microsoft.VisualStudio.Modeling.DeleteRule + { + [System.Diagnostics.DebuggerStepThrough()] + public ObjectificationDeletedRuleClass() + { + base.IsEnabled = false; + } + /// <summary> + /// Provide the following method in class: + /// Neumont.Tools.ORMToORMAbstractionBridge.AbstractionModelIsForORMModel.ORMElementGateway + /// /// <summary> + /// /// DeleteRule: typeof(Neumont.Tools.ORM.ObjectModel.Objectification) + /// /// </summary> + /// private static void ObjectificationDeletedRule(ElementDeletedEventArgs e) + /// { + /// } + /// </summary> + [System.Diagnostics.DebuggerStepThrough()] + public override void ElementDeleted(Microsoft.VisualStudio.Modeling.ElementDeletedEventArgs e) + { + Neumont.Tools.Modeling.Diagnostics.TraceUtility.TraceRuleStart(e.ModelElement.Store, "Neumont.Tools.ORMToORMAbstractionBridge.AbstractionModelIsForORMModel.ORMElementGateway.ObjectificationDeletedRule"); + ORMElementGateway.ObjectificationDeletedRule(e); + Neumont.Tools.Modeling.Diagnostics.TraceUtility.TraceRuleEnd(e.ModelElement.Store, "Neumont.Tools.ORMToORMAbstractionBridge.AbstractionModelIsForORMModel.ORMElementGateway.ObjectificationDeletedRule"); + } + } + [Microsoft.VisualStudio.Modeling.RuleOn(typeof(Neumont.Tools.ORM.ObjectModel.Objectification), Priority=Neumont.Tools.Modeling.FrameworkDomainModel.InlineRulePriority)] + private sealed class ObjectificationRolePlayerChangedRuleClass : Microsoft.VisualStudio.Modeling.RolePlayerChangeRule + { + [System.Diagnostics.DebuggerStepThrough()] + public ObjectificationRolePlayerChangedRuleClass() + { + base.IsEnabled = false; + } + /// <summary> + /// Provide the following method in class: + /// Neumont.Tools.ORMToORMAbstractionBridge.AbstractionModelIsForORMModel.ORMElementGateway + /// /// <summary> + /// /// RolePlayerChangeRule: typeof(Neumont.Tools.ORM.ObjectModel.Objectification) + /// /// </summary> + /// private static void ObjectificationRolePlayerChangedRule(RolePlayerChangedEventArgs e) + /// { + /// } + /// </summary> + [System.Diagnostics.DebuggerStepThrough()] + public override void RolePlayerChanged(Microsoft.VisualStudio.Modeling.RolePlayerChangedEventArgs e) + { + Neumont.Tools.Modeling.Diagnostics.TraceUtility.TraceRuleStart(e.ElementLink.Store, "Neumont.Tools.ORMToORMAbstractionBridge.AbstractionModelIsForORMModel.ORMElementGateway.ObjectificationRolePlayerChangedRule"); + ORMElementGateway.ObjectificationRolePlayerChangedRule(e); + Neumont.Tools.Modeling.Diagnostics.TraceUtility.TraceRuleEnd(e.ElementLink.Store, "Neumont.Tools.ORMToORMAbstractionBridge.AbstractionModelIsForORMModel.ORMElementGateway.ObjectificationRolePlayerChangedRule"); + } + } [Microsoft.VisualStudio.Modeling.RuleOn(typeof(Neumont.Tools.ORM.ObjectModel.EntityTypeHasPreferredIdentifier), Priority=Neumont.Tools.Modeling.FrameworkDomainModel.InlineRulePriority)] private sealed class PreferredIdentifierAddedRuleClass : Microsoft.VisualStudio.Modeling.AddRule { Modified: trunk/Oial/ORMOialBridge/ORMOialBridge.AttachRules.xml =================================================================== --- trunk/Oial/ORMOialBridge/ORMOialBridge.AttachRules.xml 2009-01-15 21:59:26 UTC (rev 1352) +++ trunk/Oial/ORMOialBridge/ORMOialBridge.AttachRules.xml 2009-01-23 21:57:35 UTC (rev 1353) @@ -55,6 +55,15 @@ <arg:RuleOn targetType="ObjectTypeHasPreferredIdentifierRequiresMandatoryError" targetTypeQualifier="Neumont.Tools.ORM.ObjectModel"/> <arg:RuleOn targetType="ValueTypeHasUnspecifiedDataTypeError" targetTypeQualifier="Neumont.Tools.ORM.ObjectModel"/> </arg:DeleteRule> + <arg:AddRule methodName="ObjectificationAddedRule"> + <arg:RuleOn targetType="Objectification" targetTypeQualifier="Neumont.Tools.ORM.ObjectModel"/> + </arg:AddRule> + <arg:DeleteRule methodName="ObjectificationDeletedRule"> + <arg:RuleOn targetType="Objectification" targetTypeQualifier="Neumont.Tools.ORM.ObjectModel"/> + </arg:DeleteRule> + <arg:RolePlayerChangeRule methodName="ObjectificationRolePlayerChangedRule"> + <arg:RuleOn targetType="Objectification" targetTypeQualifier="Neumont.Tools.ORM.ObjectModel"/> + </arg:RolePlayerChangeRule> <arg:AddRule methodName="PreferredIdentifierAddedRule"> <arg:RuleOn targetType="EntityTypeHasPreferredIdentifier" targetTypeQualifier="Neumont.Tools.ORM.ObjectModel"/> </arg:AddRule> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-01-23 23:22:02
|
Revision: 1354 http://orm.svn.sourceforge.net/orm/?rev=1354&view=rev Author: mcurland Date: 2009-01-23 22:08:21 +0000 (Fri, 23 Jan 2009) Log Message: ----------- Missed compiler warning in [1353] refs #327 Modified Paths: -------------- trunk/Oial/ORMOialBridge/ORMElementGateway.cs Modified: trunk/Oial/ORMOialBridge/ORMElementGateway.cs =================================================================== --- trunk/Oial/ORMOialBridge/ORMElementGateway.cs 2009-01-23 21:57:35 UTC (rev 1353) +++ trunk/Oial/ORMOialBridge/ORMElementGateway.cs 2009-01-23 22:08:21 UTC (rev 1354) @@ -741,7 +741,6 @@ private static void ObjectificationRolePlayerChangedRule(RolePlayerChangedEventArgs e) { Objectification link = (Objectification)e.ElementLink; - FactType factType; if (e.DomainRole.Id == Objectification.NestedFactTypeDomainRoleId) { ProcessFactTypeForObjectificationDeleted((FactType)e.OldRolePlayer); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-01-15 22:56:50
|
Revision: 1352 http://orm.svn.sourceforge.net/orm/?rev=1352&view=rev Author: mcurland Date: 2009-01-15 21:59:26 +0000 (Thu, 15 Jan 2009) Log Message: ----------- Restore objectified FactType name quotes inadvertently lost for some cases in [1328]. Apparently no one noticed they've been missing for the last two public drops. refs #375 Modified Paths: -------------- trunk/ORMModel/Resources/ResourceStringsGenerator.cs trunk/ORMModel/Resources/ResourceStringsGenerator.xml trunk/ORMModel/ShapeModel/FactTypeShape.cs trunk/ORMModel/ShapeModel/ORMDiagram.resx Modified: trunk/ORMModel/Resources/ResourceStringsGenerator.cs =================================================================== --- trunk/ORMModel/Resources/ResourceStringsGenerator.cs 2009-01-15 00:26:23 UTC (rev 1351) +++ trunk/ORMModel/Resources/ResourceStringsGenerator.cs 2009-01-15 21:59:26 UTC (rev 1352) @@ -2365,6 +2365,22 @@ return ResourceStrings.GetString(ResourceManagers.Diagram, "ObjectTypeShape.ReferenceModeFormatString"); } } + /// <summary>The string used to display an objectified type that is a derived subtype.</summary> + public static string ObjectifiedFactTypeNameShapeDerivedSubtypeFormatString + { + get + { + return ResourceStrings.GetString(ResourceManagers.Diagram, "ObjectifiedFactTypeNameShape.DerivedSubtypeFormatString"); + } + } + /// <summary>The string used to display an objectified type name for an independent object.</summary> + public static string ObjectifiedFactTypeNameShapeIndependentFormatString + { + get + { + return ResourceStrings.GetString(ResourceManagers.Diagram, "ObjectifiedFactTypeNameShape.IndependentFormatString"); + } + } /// <summary>The string used to display an objectified type name for an derived subtype with a reference mode.</summary> public static string ObjectifiedFactTypeNameShapeRefModeDerivedSubtypeFormatString { @@ -2389,6 +2405,14 @@ return ResourceStrings.GetString(ResourceManagers.Diagram, "ObjectifiedFactTypeNameShape.RefModeFormatString"); } } + /// <summary>The string used to display an objectified type name.</summary> + public static string ObjectifiedFactTypeNameShapeStandardFormatString + { + get + { + return ResourceStrings.GetString(ResourceManagers.Diagram, "ObjectifiedFactTypeNameShape.StandardFormatString"); + } + } /// <summary>The string used to divide multiple readings shown in a ReadingShape.</summary> public static string ReadingShapeReadingSeparator { Modified: trunk/ORMModel/Resources/ResourceStringsGenerator.xml =================================================================== --- trunk/ORMModel/Resources/ResourceStringsGenerator.xml 2009-01-15 00:26:23 UTC (rev 1351) +++ trunk/ORMModel/Resources/ResourceStringsGenerator.xml 2009-01-15 21:59:26 UTC (rev 1352) @@ -343,9 +343,12 @@ <ResourceString name="ObjectTypeShapeDerivedSubtypeFormatString" model="Diagram" resourceName="ObjectTypeShape.DerivedSubtypeFormatString"/> <ResourceString name="ObjectTypeShapeIndependentFormatString" model="Diagram" resourceName="ObjectTypeShape.IndependentFormatString"/> <ResourceString name="ObjectTypeShapeReferenceModeFormatString" model="Diagram" resourceName="ObjectTypeShape.ReferenceModeFormatString"/> + <ResourceString name="ObjectifiedFactTypeNameShapeDerivedSubtypeFormatString" model="Diagram" resourceName="ObjectifiedFactTypeNameShape.DerivedSubtypeFormatString"/> + <ResourceString name="ObjectifiedFactTypeNameShapeIndependentFormatString" model="Diagram" resourceName="ObjectifiedFactTypeNameShape.IndependentFormatString"/> <ResourceString name="ObjectifiedFactTypeNameShapeRefModeDerivedSubtypeFormatString" model="Diagram" resourceName="ObjectifiedFactTypeNameShape.RefModeDerivedSubtypeFormatString"/> <ResourceString name="ObjectifiedFactTypeNameShapeRefModeIndependentFormatString" model="Diagram" resourceName="ObjectifiedFactTypeNameShape.RefModeIndependentFormatString"/> <ResourceString name="ObjectifiedFactTypeNameShapeRefModeFormatString" model="Diagram" resourceName="ObjectifiedFactTypeNameShape.RefModeFormatString"/> + <ResourceString name="ObjectifiedFactTypeNameShapeStandardFormatString" model="Diagram" resourceName="ObjectifiedFactTypeNameShape.StandardFormatString"/> <ResourceString name="ReadingShapeReadingSeparator" model="Diagram" resourceName="ReadingShape.ReadingSeparator"/> <ResourceString name="ReadingShapeEllipsis" model="Diagram" resourceName="ReadingShape.Ellipsis"/> <ResourceString name="ReadingShapeAttachedRoleDisplay" model="Diagram" resourceName="ReadingShape.AttachedRoleDisplay"/> Modified: trunk/ORMModel/ShapeModel/FactTypeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/FactTypeShape.cs 2009-01-15 00:26:23 UTC (rev 1351) +++ trunk/ORMModel/ShapeModel/FactTypeShape.cs 2009-01-15 21:59:26 UTC (rev 1352) @@ -5698,12 +5698,16 @@ } else if (independent) { - formatString = ResourceStrings.ObjectTypeShapeIndependentFormatString; + formatString = ResourceStrings.ObjectifiedFactTypeNameShapeIndependentFormatString; } else if (derived) { - formatString = ResourceStrings.ObjectTypeShapeIndependentFormatString; + formatString = ResourceStrings.ObjectifiedFactTypeNameShapeDerivedSubtypeFormatString; } + else + { + formatString = ResourceStrings.ObjectifiedFactTypeNameShapeStandardFormatString; + } } return (formatString == null) ? baseText : string.Format(CultureInfo.InvariantCulture, formatString, baseText, refModeString); } Modified: trunk/ORMModel/ShapeModel/ORMDiagram.resx =================================================================== --- trunk/ORMModel/ShapeModel/ORMDiagram.resx 2009-01-15 00:26:23 UTC (rev 1351) +++ trunk/ORMModel/ShapeModel/ORMDiagram.resx 2009-01-15 21:59:26 UTC (rev 1352) @@ -563,6 +563,14 @@ <value xml:space="preserve">({0})</value> <comment xml:space="preserve">The string used to display a reference mode.</comment> </data> + <data name="ObjectifiedFactTypeNameShape.DerivedSubtypeFormatString"> + <value xml:space="preserve">"{0} *"</value> + <comment xml:space="preserve">The string used to display an objectified type that is a derived subtype.</comment> + </data> + <data name="ObjectifiedFactTypeNameShape.IndependentFormatString"> + <value xml:space="preserve">"{0} !"</value> + <comment xml:space="preserve">The string used to display an objectified type name for an independent object.</comment> + </data> <data name="ObjectifiedFactTypeNameShape.RefModeDerivedSubtypeFormatString"> <value xml:space="preserve">"{0} ({1})*"</value> <comment xml:space="preserve">The string used to display an objectified type name for an derived subtype with a reference mode.</comment> @@ -575,6 +583,10 @@ <value xml:space="preserve">"{0} ({1})"</value> <comment xml:space="preserve">The string used to display an objectified type name for an object with a reference mode.</comment> </data> + <data name="ObjectifiedFactTypeNameShape.StandardFormatString"> + <value xml:space="preserve">"{0}"</value> + <comment xml:space="preserve">The string used to display an objectified type name.</comment> + </data> <data name="ObjectifyFactType.TransactionName"> <value xml:space="preserve">Objectify Fact Type</value> <comment xml:space="preserve">The name given to the transaction used when objectifying a fact type.</comment> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-01-15 00:26:27
|
Revision: 1351 http://orm.svn.sourceforge.net/orm/?rev=1351&view=rev Author: mcurland Date: 2009-01-15 00:26:23 +0000 (Thu, 15 Jan 2009) Log Message: ----------- The diagram spy LinkLabel crashes if there are too many diagrams. Clear the Links collection if an error is encountered. This is a temporary fix. We'll have to do something more robust in the future. refs #376 Modified Paths: -------------- trunk/ORMModel/Shell/ORMDiagramSpy.cs Modified: trunk/ORMModel/Shell/ORMDiagramSpy.cs =================================================================== --- trunk/ORMModel/Shell/ORMDiagramSpy.cs 2009-01-08 22:48:55 UTC (rev 1350) +++ trunk/ORMModel/Shell/ORMDiagramSpy.cs 2009-01-15 00:26:23 UTC (rev 1351) @@ -607,6 +607,28 @@ #endregion // IProvideFrameVisibility Implementation #region ORMDiagramSpyToolWindow specific /// <summary> + /// MSBUG: Quick fix for a GDI+ bug that crashes the LinkLabel if there + /// are too many diagrams. + /// </summary> + private sealed class SafeLinkLabel : LinkLabel + { + protected override void OnPaint(PaintEventArgs e) + { + try + { + base.OnPaint(e); + } + catch (OverflowException) + { + // The SetMeasureableCharacterRanges API fails with an OverflowException + // if the is too much text in the LinkLabel. If I could turn UseCompatibleTextRendering + // off for this one control then this would work, but this is controlled + // at the application level. + Links.Clear(); + } + } + } + /// <summary> /// Loads the SurveyTreeControl from the current document /// </summary> protected void LoadWindow() @@ -618,7 +640,7 @@ ContainerControl container = new ContainerControl(); myDiagramView = diagramView = new ToolWindowDiagramView(this); diagramView.DiagramClientView.DiagramDisassociating += new EventHandler(DiagramDisassociatingEvent); - myWatermarkLabel = watermarkLabel = new LinkLabel(); + myWatermarkLabel = watermarkLabel = new SafeLinkLabel(); watermarkLabel.Dock = DockStyle.Fill; watermarkLabel.Site = diagramView.Site; watermarkLabel.TextAlign = ContentAlignment.MiddleCenter; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-01-08 22:49:00
|
Revision: 1350 http://orm.svn.sourceforge.net/orm/?rev=1350&view=rev Author: mcurland Date: 2009-01-08 22:48:55 +0000 (Thu, 08 Jan 2009) Log Message: ----------- Duplicate constraint names are blocking file load with a null reference exception. This fixes a bug introduced in [1343]. Most duplicate constraint names can be fixed by double-clicking on them and clearing the name, which will regenerate. However, duplicate names for some implied constraints cannot be selected and require an XML edit to fix (find the name on an element, delete the contents of the Name attribute (leave Name=""), save, and reload). Duplicate generated names will be automatically fixed in a future changeset. refs #383 Modified Paths: -------------- trunk/ORMModel/ObjectModel/ORMModel.cs trunk/ORMModel/ObjectModel/ORMModel.resx trunk/ORMModel/Resources/ResourceStringsGenerator.cs trunk/ORMModel/Resources/ResourceStringsGenerator.xml Modified: trunk/ORMModel/ObjectModel/ORMModel.cs =================================================================== --- trunk/ORMModel/ObjectModel/ORMModel.cs 2009-01-01 04:29:35 UTC (rev 1349) +++ trunk/ORMModel/ObjectModel/ORMModel.cs 2009-01-08 22:48:55 UTC (rev 1350) @@ -2055,6 +2055,7 @@ [ModelErrorDisplayFilter(typeof(NameErrorCategory))] public partial class ConstraintDuplicateNameError : DuplicateNameError, IHasIndirectModelErrorOwner { + #region Base overrides /// <summary> /// Get the duplicate elements represented by this DuplicateNameError /// </summary> @@ -2063,7 +2064,7 @@ { get { - return ConstraintCollection as IList<ModelElement>; + return ConstraintCollection; } } /// <summary> @@ -2085,6 +2086,7 @@ return ResourceStrings.ModelErrorModelHasDuplicateConstraintNames; } } + #endregion // Base overrides #region ConstraintCollection Implementation [NonSerialized] private CompositeCollection myCompositeList; @@ -2093,14 +2095,14 @@ /// single column external, multi column external, internal constraints, and value constraints /// </summary> /// <value></value> - public IList<ORMNamedElement> ConstraintCollection + public IList<ModelElement> ConstraintCollection { get { return myCompositeList ?? (myCompositeList = new CompositeCollection(this)); } } - private sealed class CompositeCollection : IList<ORMNamedElement> + private sealed class CompositeCollection : IList<ModelElement> { #region Member Variables private readonly LinkedElementCollection<SetComparisonConstraint> myList1; @@ -2115,8 +2117,8 @@ myList3 = error.ValueConstraintCollection; } #endregion // Constructors - #region IList<ORMNamedElement> Implementation - int IList<ORMNamedElement>.IndexOf(ORMNamedElement value) + #region IList<ModelElement> Implementation + int IList<ModelElement>.IndexOf(ModelElement value) { SetComparisonConstraint setComparisonConstraint; SetConstraint setConstraint; @@ -2135,7 +2137,7 @@ } return -1; } - ORMNamedElement IList<ORMNamedElement>.this[int index] + ModelElement IList<ModelElement>.this[int index] { get { @@ -2144,7 +2146,7 @@ { index -= list1Count; int list2Count = myList2.Count; - return (index >= list2Count) ? (ORMNamedElement)myList3[index - list2Count] : myList2[index]; + return (index >= list2Count) ? (ModelElement)myList3[index - list2Count] : myList2[index]; } return myList1[index]; } @@ -2153,17 +2155,17 @@ throw new NotSupportedException(); // Not supported for readonly list } } - void IList<ORMNamedElement>.Insert(int index, ORMNamedElement value) + void IList<ModelElement>.Insert(int index, ModelElement value) { throw new NotSupportedException(); // Not supported for readonly list } - void IList<ORMNamedElement>.RemoveAt(int index) + void IList<ModelElement>.RemoveAt(int index) { throw new NotSupportedException(); // Not supported for readonly list } - #endregion // IList<ORMNamedElement> Implementation - #region ICollection<ORMNamedElement> Implementation - void ICollection<ORMNamedElement>.CopyTo(ORMNamedElement[] array, int index) + #endregion // IList<ModelElement> Implementation + #region ICollection<ModelElement> Implementation + void ICollection<ModelElement>.CopyTo(ModelElement[] array, int index) { int baseIndex = index; int nextCount = myList1.Count; @@ -2184,14 +2186,14 @@ ((ICollection)myList3).CopyTo(array, baseIndex); } } - int ICollection<ORMNamedElement>.Count + int ICollection<ModelElement>.Count { get { return myList1.Count + myList2.Count + myList3.Count; } } - bool ICollection<ORMNamedElement>.Contains(ORMNamedElement value) + bool ICollection<ModelElement>.Contains(ModelElement value) { SetComparisonConstraint setComparisonConstraint; SetConstraint setConstraint; @@ -2210,47 +2212,47 @@ } return false; } - bool ICollection<ORMNamedElement>.IsReadOnly + bool ICollection<ModelElement>.IsReadOnly { get { return true; } } - void ICollection<ORMNamedElement>.Add(ORMNamedElement value) + void ICollection<ModelElement>.Add(ModelElement value) { throw new NotSupportedException(); // Not supported for readonly list } - void ICollection<ORMNamedElement>.Clear() + void ICollection<ModelElement>.Clear() { throw new NotSupportedException(); // Not supported for readonly list } - bool ICollection<ORMNamedElement>.Remove(ORMNamedElement value) + bool ICollection<ModelElement>.Remove(ModelElement value) { throw new NotSupportedException(); // Not supported for readonly list } - #endregion // ICollection<ORMNamedElement> Implementation - #region IEnumerable<ORMNamedElement> Implementation - IEnumerator<ORMNamedElement> IEnumerable<ORMNamedElement>.GetEnumerator() + #endregion // ICollection<ModelElement> Implementation + #region IEnumerable<ModelElement> Implementation + IEnumerator<ModelElement> IEnumerable<ModelElement>.GetEnumerator() { - foreach (ORMNamedElement element in myList1) + foreach (ModelElement element in myList1) { yield return element; } - foreach (ORMNamedElement element in myList2) + foreach (ModelElement element in myList2) { yield return element; } - foreach (ORMNamedElement element in myList3) + foreach (ModelElement element in myList3) { yield return element; } } - #endregion // IEnumerable<ORMNamedElement> Implementation + #endregion // IEnumerable<ModelElement> Implementation #region IEnumerable Implementation IEnumerator IEnumerable.GetEnumerator() { - return ((IEnumerable<ORMNamedElement>)this).GetEnumerator(); + return ((IEnumerable<ModelElement>)this).GetEnumerator(); } #endregion // IEnumerable Implementation } @@ -2288,7 +2290,10 @@ /// </summary> protected override IList<ModelElement> DuplicateElements { - get { return RecognizedPhraseCollection.ToArray(); } + get + { + return RecognizedPhraseCollection.ToArray(); + } } /// <summary> /// Provide an efficient name lookup @@ -2300,12 +2305,13 @@ /// <summary> /// Text to be displayed when an error is thrown. ///</summary> - //TODO: Add this to the ResourceStrings collection protected override string ErrorFormatText { - get { return "Duplicate recognized word exists in the model."; } + get + { + return ResourceStrings.ModelErrorModelHasDuplicateRecognizedPhraseNames; + } } - #region IHasIndirectModelErrorOwner Implementation private static Guid[] myIndirectModelErrorOwnerLinkRoles; /// <summary> Modified: trunk/ORMModel/ObjectModel/ORMModel.resx =================================================================== --- trunk/ORMModel/ObjectModel/ORMModel.resx 2009-01-01 04:29:35 UTC (rev 1349) +++ trunk/ORMModel/ObjectModel/ORMModel.resx 2009-01-08 22:48:55 UTC (rev 1350) @@ -306,6 +306,10 @@ <value>Model '{0}' contains multiple object types named '{1}'. Type names must be unique across all entity and value types in a model.</value> <comment>Model validation error text used when multiple object types with the same name are loaded into a model.Field 0 is the model name, field 1 is the element name.This is an uncommon condition that should only occur with a hand edit to a model file.</comment> </data> + <data name="ModelError.Model.DuplicateRecognizedPhraseNames.Text" xml:space="preserve"> + <value>Model '{0}' contains multiple recognized phrases called '{1}'. Phrase names must be unique across all phrases in a model.</value> + <comment>Model validation error text used when multiple recognized phrases with the same name are loaded into a model.Field 0 is the model name, field 1 is the element name.This is an uncommon condition that should only occur with a hand edit to a model file.</comment> + </data> <data name="ModelError.Model.PopulationMandatoryError.Text" xml:space="preserve"> <value>'{0}' instance '{1}' in model '{2}' must participate in FactType '{3}'{4}.</value> <comment>Model validation error shown when a population violates a mandatory constraint. Field 0 is the name of the role player, field 1 is the derived name of the instance, field 2 is the model name, field 3 is the name of the first facttype name, field 4 is a placeholder for additional fact types.</comment> Modified: trunk/ORMModel/Resources/ResourceStringsGenerator.cs =================================================================== --- trunk/ORMModel/Resources/ResourceStringsGenerator.cs 2009-01-01 04:29:35 UTC (rev 1349) +++ trunk/ORMModel/Resources/ResourceStringsGenerator.cs 2009-01-08 22:48:55 UTC (rev 1350) @@ -925,6 +925,14 @@ return ResourceStrings.GetString(ResourceManagers.Model, "ModelError.Model.DuplicateObjectTypeNames.Text"); } } + /// <summary>Model validation error text used when multiple recognized phrases with the same name are loaded into a model.Field 0 is the model name, field 1 is the element name.This is an uncommon condition that should only occur with a hand edit to a model file.</summary> + public static string ModelErrorModelHasDuplicateRecognizedPhraseNames + { + get + { + return ResourceStrings.GetString(ResourceManagers.Model, "ModelError.Model.DuplicateRecognizedPhraseNames.Text"); + } + } /// <summary>Model validation error shown when a population violates a uniqueness constraint and its role is named. Field 0 is the name of the object type, field 1 is the string representation of the instance, field 2 is the model name, field 3 is the role name.</summary> public static string ModelErrorModelHasPopulationUniquenessErrorWithNamedRole { Modified: trunk/ORMModel/Resources/ResourceStringsGenerator.xml =================================================================== --- trunk/ORMModel/Resources/ResourceStringsGenerator.xml 2009-01-01 04:29:35 UTC (rev 1349) +++ trunk/ORMModel/Resources/ResourceStringsGenerator.xml 2009-01-08 22:48:55 UTC (rev 1350) @@ -163,6 +163,7 @@ <ResourceString name="ModelErrorConstraintExternalConstraintArityMismatch" model="Model" resourceName="ModelError.Constraint.ExternalConstraintArityMismatch.Text"/> <ResourceString name="ModelErrorModelHasDuplicateConstraintNames" model="Model" resourceName="ModelError.Model.DuplicateConstraintNames.Text"/> <ResourceString name="ModelErrorModelHasDuplicateObjectTypeNames" model="Model" resourceName="ModelError.Model.DuplicateObjectTypeNames.Text"/> + <ResourceString name="ModelErrorModelHasDuplicateRecognizedPhraseNames" model="Model" resourceName="ModelError.Model.DuplicateRecognizedPhraseNames.Text"/> <ResourceString name="ModelErrorModelHasPopulationUniquenessErrorWithNamedRole" model="Model" resourceName="ModelError.Model.PopulationUniquenessError.Role.Text"/> <ResourceString name="ModelErrorModelHasPopulationUniquenessErrorWithUnnamedRole" model="Model" resourceName="ModelError.Model.PopulationUniquenessError.FactType.Text"/> <ResourceString name="ModelErrorModelHasPopulationMandatoryError" model="Model" resourceName="ModelError.Model.PopulationMandatoryError.Text"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2008-12-20 03:37:08
|
Revision: 1345 http://orm.svn.sourceforge.net/orm/?rev=1345&view=rev Author: mcurland Date: 2008-12-20 03:37:05 +0000 (Sat, 20 Dec 2008) Log Message: ----------- Modify the toolbox handling in the ORM Diagram Spy window to handle dynamic toolbox contents introduced with the shape extensions in [1344]. refs #376 refs #380 Modified Paths: -------------- trunk/ORMModel/Framework/Design/PropertyProvider.cs trunk/ORMModel/Framework/FrameworkServices.cs trunk/ORMModel/Framework/Shell/MultiDiagramDocView.cs trunk/ORMModel/Framework/Shell/MultiDiagramDocViewControl.cs trunk/ORMModel/ShapeModel/ORMDiagram.cs trunk/ORMModel/Shell/ORMDesignerCommandManager.cs trunk/ORMModel/Shell/ORMDiagramSpy.cs trunk/ORMModel/Shell/ORMDocData.cs trunk/ORMModel/Shell/ORMDocDataServices.cs trunk/ORMModel/Shell/ORMDocView.cs Modified: trunk/ORMModel/Framework/Design/PropertyProvider.cs =================================================================== --- trunk/ORMModel/Framework/Design/PropertyProvider.cs 2008-12-17 02:27:45 UTC (rev 1344) +++ trunk/ORMModel/Framework/Design/PropertyProvider.cs 2008-12-20 03:37:05 UTC (rev 1345) @@ -88,6 +88,18 @@ this.myProviderDictionary = new Dictionary<RuntimeTypeHandle, PropertyProvider>(RuntimeTypeHandleComparer.Instance); } #endregion // Constructor + #region Accessor Properties + /// <summary> + /// Get the context <see cref="Store"/> + /// </summary> + public Store Store + { + get + { + return myStore; + } + } + #endregion // Access Properties #region IPropertyProviderService implementation void IPropertyProviderService.AddOrRemovePropertyProvider<TExtendableElement>(PropertyProvider provider, bool includeSubtypes, EventHandlerAction action) { Modified: trunk/ORMModel/Framework/FrameworkServices.cs =================================================================== --- trunk/ORMModel/Framework/FrameworkServices.cs 2008-12-17 02:27:45 UTC (rev 1344) +++ trunk/ORMModel/Framework/FrameworkServices.cs 2008-12-20 03:37:05 UTC (rev 1345) @@ -83,6 +83,16 @@ myStore = store; } /// <summary> + /// The current <see cref="Store"/> + /// </summary> + public Store Store + { + get + { + return myStore; + } + } + /// <summary> /// Get an array of providers of the requested type, or null if the interface is not implemented /// </summary> public T[] GetTypedDomainModelProviders<T>() where T : class Modified: trunk/ORMModel/Framework/Shell/MultiDiagramDocView.cs =================================================================== --- trunk/ORMModel/Framework/Shell/MultiDiagramDocView.cs 2008-12-17 02:27:45 UTC (rev 1344) +++ trunk/ORMModel/Framework/Shell/MultiDiagramDocView.cs 2008-12-20 03:37:05 UTC (rev 1345) @@ -55,7 +55,7 @@ /// <summary> /// Determine when the toolbox should be refreshed /// </summary> - private Type myLastDiagramType; + private Type myLastToolboxDiagramType; private MultiDiagramDocViewControl DocViewControl { get @@ -86,19 +86,49 @@ protected override void OnSelectionChanged(EventArgs e) { base.OnSelectionChanged(e); - Diagram diagram = CurrentDiagram; + if (UpdateToolboxDiagram(CurrentDiagram)) + { + RefreshDiagramToolboxItems(); + } + } + /// <summary> + /// Update the type of diagram that sources the toolbox items for this document. If this + /// returns <see langword="true"/>, then it is the responsibility of the caller to call + /// <see cref="IToolboxService.Refresh"/> after updating the current toolbox filters. + /// </summary> + /// <param name="diagram">The <see cref="Diagram"/> to activate</param> + /// <returns><see langword="true"/> if the diagram type is changed</returns> + /// <remarks>The toolbox service always requests toolbox items from the document window, even + /// when the active selection container in a tool window supports the <see cref="Microsoft.VisualStudio.Shell.Interop.IVsToolboxUser"/> + /// interface. Derived classes can reimplement <see cref="Microsoft.VisualStudio.Shell.Interop.IVsToolboxUser"/> to redirect to the + /// implementation on an active toolwindow, but the document window needs to know the type of the + /// last diagram for which items were requested by both the document and tool windows. This enables + /// the items to be refreshed when the selection container is switched back and forth between the + /// document window and the tool window toolbox users.</remarks> + public bool UpdateToolboxDiagram(Diagram diagram) + { Type diagramType; if (diagram != null && - (diagramType = diagram.GetType()) != myLastDiagramType) + (diagramType = diagram.GetType()) != myLastToolboxDiagramType) { - myLastDiagramType = diagramType; - IToolboxService toolboxService; - if (this.UpdateToolboxFilters(ToolboxItemFilterType.Diagram, true) && (null != (toolboxService = base.ToolboxService))) - { - toolboxService.Refresh(); - } + myLastToolboxDiagramType = diagramType; + return true; } + return false; } + /// <summary> + /// Helper method to perform toolbox filter refresh. Should only call if <see cref="UpdateToolboxDiagram"/> returns true. + /// </summary> + private void RefreshDiagramToolboxItems() + { + IToolboxService toolboxService; + if (null != (toolboxService = base.ToolboxService)) + { + // We refresh on this request regardless of the response from UpdateToolboxFilters + UpdateToolboxFilters(ToolboxItemFilterType.Diagram, true); + toolboxService.Refresh(); + } + } #endregion // Base Overrides #region Public Properties #region Context Menu support @@ -328,6 +358,33 @@ } } #endregion // ReorderDiagrams method + #region DeactivateMouseActions method + /// <summary> + /// Verify that all mouse actions for the specified <see cref="DiagramView"/> + /// are canceled. Mouse actions are also canceled for the active view on the + /// associated <see cref="Diagram"/>. + /// </summary> + public static void DeactivateMouseActions(DiagramView diagramView) + { + if (diagramView != null) + { + MouseAction mouseAction; + if (null != (mouseAction = diagramView.ActiveMouseAction)) + { + diagramView.ActiveMouseAction = null; + } + Diagram diagram; + DiagramView activeView; + if (null != (diagram = diagramView.Diagram) && + null != (activeView = diagram.ActiveDiagramView) && + activeView != diagramView && + null != (mouseAction = activeView.ActiveMouseAction)) + { + diagramView.ActiveMouseAction = null; + } + } + } + #endregion // DeactivateMouseActions method #region Add methods /// <summary> /// Adds the <see cref="Diagram"/> specified by <paramref name="diagram"/> to this <see cref="MultiDiagramDocView"/>. @@ -573,7 +630,7 @@ if (0 != (reasons & EventSubscriberReasons.DocumentLoaded)) { // Force toolbox refresh on next selection change - myLastDiagramType = null; + myLastToolboxDiagramType = null; // Attach extra properties and events if we're tracking diagram order and position Store store = this.Store; Modified: trunk/ORMModel/Framework/Shell/MultiDiagramDocViewControl.cs =================================================================== --- trunk/ORMModel/Framework/Shell/MultiDiagramDocViewControl.cs 2008-12-17 02:27:45 UTC (rev 1344) +++ trunk/ORMModel/Framework/Shell/MultiDiagramDocViewControl.cs 2008-12-20 03:37:05 UTC (rev 1345) @@ -298,6 +298,10 @@ if (tabPage != null) { tabPage.Focus(); + if (DocView.UpdateToolboxDiagram(((DiagramTabPage)tabPage).Diagram)) + { + DocView.RefreshDiagramToolboxItems(); + } } } #endregion // OnGotFocus method @@ -416,6 +420,26 @@ DocView.SetSelectedComponents(null); } } + protected override void OnSelecting(TabControlCancelEventArgs e) + { + DiagramTabPage tabPage; + if (e.Action == TabControlAction.Selecting && + null != (tabPage = e.TabPage as DiagramTabPage)) + { + DeactivateMouseActions(tabPage.Designer); + } + base.OnSelecting(e); + } + protected override void OnDeselecting(TabControlCancelEventArgs e) + { + DiagramTabPage tabPage; + if (e.Action == TabControlAction.Deselecting && + null != (tabPage = e.TabPage as DiagramTabPage)) + { + DeactivateMouseActions(tabPage.Designer); + } + base.OnDeselecting(e); + } #endregion // OnSelectedIndexChanged method #region IndexOf methods public int IndexOf(DiagramView designer, int startingIndex) Modified: trunk/ORMModel/ShapeModel/ORMDiagram.cs =================================================================== --- trunk/ORMModel/ShapeModel/ORMDiagram.cs 2008-12-17 02:27:45 UTC (rev 1344) +++ trunk/ORMModel/ShapeModel/ORMDiagram.cs 2008-12-20 03:37:05 UTC (rev 1345) @@ -1319,7 +1319,7 @@ // during a chained mouse action cancels the action. // See corresponding code in ExternalConstraintConnectAction.ChainMouseAction and // InternalUniquenessConstraintConnectAction.ChainMouseAction. - (action != null || activeView.Toolbox.GetSelectedToolboxItem() != null)) + (action != null || (activeView != null && activeView.Toolbox.GetSelectedToolboxItem() != null))) { clientView.ActiveMouseAction = action; } Modified: trunk/ORMModel/Shell/ORMDesignerCommandManager.cs =================================================================== --- trunk/ORMModel/Shell/ORMDesignerCommandManager.cs 2008-12-17 02:27:45 UTC (rev 1344) +++ trunk/ORMModel/Shell/ORMDesignerCommandManager.cs 2008-12-20 03:37:05 UTC (rev 1345) @@ -41,6 +41,7 @@ namespace Neumont.Tools.ORM.Shell { + #region IORMDesignerView interface /// <summary> /// An interface representing a container that displays an ORM diagram. /// Abstracting the view enables commands to be handled/ the same for @@ -89,7 +90,246 @@ /// </summary> object PrimarySelection { get;} } + #endregion // IORMDesignerView interface + #region ToolboxFilterSet enum /// <summary> + /// The type of selection filter type to check. Used by <see cref="ToolboxFilterCache.UpdateFilters"/> + /// </summary> + [Flags] + public enum ToolboxFilterSet + { + /// <summary> + /// Update the filters for the currently selected item + /// </summary> + Selection = 1, + /// <summary> + /// Update the filters for the current diagram + /// </summary> + Diagram = 2, + /// <summary> + /// Udpate all filters + /// </summary> + All = Selection | Diagram, + } + #endregion // ToolboxFilterSet enum + #region ToolboxFilterCache class + /// <summary> + /// A class to manage toolbox filters as the selection in a <see cref="IORMDesignerView"/> implementation is modified + /// </summary> + [CLSCompliant(false)] + public class ToolboxFilterCache + { + // Use positive values for diagram items, negative for selection + private Dictionary<object, int> myFilterCache = new Dictionary<object, int>(); + private int myDiagramCookie; + private int mySelectionCookie; + private int myDiagramFilterCount; + private int mySelectionFilterCount; + private object[] myFilterCollection; + /// <summary> + /// Update the current toolbox filters to correspond to the current selection in <paramref name="designerView"/> + /// </summary> + /// <param name="designerView">The current <see cref="IORMDesignerView"/> to populate settings for</param> + /// <param name="filterType">The <see cref="ToolboxFilterSet"/> indicating the set of toolbox items to update</param> + /// <returns><see langword="true"/> if the filter set is changed.</returns> + public bool UpdateFilters(IORMDesignerView designerView, ToolboxFilterSet filterType) + { + Dictionary<object, int> filterCache = myFilterCache; + int diagramCookie = myDiagramCookie; + int selectionCookie = mySelectionCookie; + bool repopulate = false; + + // Check for first pass + if (diagramCookie == 0) + { + diagramCookie = NewDiagramCookie(); + filterType = ToolboxFilterSet.All; + } + if (selectionCookie == 0) + { + selectionCookie = NewSelectionCookie(); + filterType = ToolboxFilterSet.All; + } + + // Update the diagram information + if (0 != (filterType & ToolboxFilterSet.Diagram)) + { + Diagram diagram; + ICollection filters; + if (null != (diagram = designerView.CurrentDiagram) && + null != (filters = diagram.TargetToolboxItemFilterAttributes)) + { + int oldCount = myDiagramFilterCount; + int newCount = 0; + if (oldCount != 0) + { + int oldCookie = diagramCookie; + diagramCookie = NewDiagramCookie(); + foreach (object filter in filters) + { + int testCookie; + if (filterCache.TryGetValue(filter, out testCookie)) + { + filterCache[filter] = diagramCookie; + if (oldCookie != testCookie) + { + // Filter was not included in previous count + repopulate = true; + } + ++newCount; + } + else + { + filterCache[filter] = diagramCookie; + ++newCount; + repopulate = true; + } + } + if (!repopulate && newCount != oldCount) + { + repopulate = true; + } + } + else + { + foreach (object filter in filters) + { + // We updated the cookie when the count was set to zero, no reason to repeat + filterCache[filter] = diagramCookie; + ++newCount; + } + if (newCount != 0) + { + repopulate = true; + } + } + myDiagramFilterCount = newCount; + } + else if (myDiagramFilterCount != 0) + { + diagramCookie = NewDiagramCookie(); + myDiagramFilterCount = 0; + repopulate = true; + } + } + if (0 != (filterType & ToolboxFilterSet.Selection)) + { + IList selectedElements; + ShapeElement selectedShape; + ICollection filters; + if (null != (selectedElements = designerView.SelectedElements) && + 1 == selectedElements.Count && + null != (selectedShape = selectedElements[0] as ShapeElement) && + selectedShape != designerView.CurrentDiagram && + null != (filters = selectedShape.TargetToolboxItemFilterAttributes)) + { + int oldCount = mySelectionFilterCount; + int newCount = 0; + if (oldCount != 0) + { + int oldCookie = selectionCookie; + selectionCookie = NewSelectionCookie(); + foreach (object filter in filters) + { + int testCookie; + if (filterCache.TryGetValue(filter, out testCookie)) + { + filterCache[filter] = selectionCookie; + if (oldCookie != testCookie) + { + // Filter was not included in previous count + repopulate = true; + } + ++newCount; + } + else + { + filterCache[filter] = selectionCookie; + ++newCount; + repopulate = true; + } + } + if (!repopulate && newCount != oldCount) + { + repopulate = true; + } + } + else + { + foreach (object filter in filters) + { + // We updated the cookie when the count was set to zero, no reason to repeat + filterCache[filter] = selectionCookie; + ++newCount; + } + if (newCount != 0) + { + repopulate = true; + } + } + mySelectionFilterCount = newCount; + } + else if (mySelectionFilterCount != 0) + { + selectionCookie = NewSelectionCookie(); + mySelectionFilterCount = 0; + repopulate = true; + } + } + if (repopulate) + { + myFilterCollection = null; + } + return repopulate; + } + /// <summary> + /// Get a collection of all current toolbox filters + /// </summary> + public ICollection ToolboxFilters + { + get + { + object[] filters = myFilterCollection; + if (filters == null) + { + int totalCount = myDiagramFilterCount + mySelectionFilterCount; + myFilterCollection = filters = new object[totalCount]; + if (totalCount != 0) + { + int index = -1; + int diagramCookie = myDiagramCookie; + int selectionCookie = mySelectionCookie; + foreach (KeyValuePair<object, int> pair in myFilterCache) + { + int testValue = pair.Value; + if (testValue == diagramCookie || testValue == selectionCookie) + { + filters[++index] = pair.Key; + } + } + } + } + return filters; + } + } + private int NewDiagramCookie() + { + // Diagram cookies are positive + int cookie = myDiagramCookie; + myDiagramCookie = cookie = (cookie == int.MaxValue) ? 1 : (cookie + 1); + return cookie; + } + private int NewSelectionCookie() + { + // Selection cookies are negative + int cookie = mySelectionCookie; + mySelectionCookie = cookie = (cookie == int.MinValue) ? -11 : (cookie - 1); + return cookie; + } + } + #endregion // ToolboxFilterCache class + #region ORMDesignerCommandManager class + /// <summary> /// Handle command routing for views on the ORM designer /// </summary> [CLSCompliant(false)] @@ -3024,4 +3264,5 @@ } #endregion // Command Handlers } + #endregion // ORMDesignerCommandManager class } Modified: trunk/ORMModel/Shell/ORMDiagramSpy.cs =================================================================== --- trunk/ORMModel/Shell/ORMDiagramSpy.cs 2008-12-17 02:27:45 UTC (rev 1344) +++ trunk/ORMModel/Shell/ORMDiagramSpy.cs 2008-12-20 03:37:05 UTC (rev 1345) @@ -32,6 +32,8 @@ using Microsoft.VisualStudio.Shell.Interop; using Neumont.Tools.Modeling.Shell; using Neumont.Tools.Modeling; +using OLE = Microsoft.VisualStudio.OLE.Interop; +using System.Drawing.Design; namespace Neumont.Tools.ORM.Shell { @@ -41,7 +43,7 @@ /// </summary> [Guid("19A5C15D-14D4-4A88-9891-A3294077BE56")] [CLSCompliant(false)] - public class ORMDiagramSpyWindow : ORMToolWindow, IORMSelectionContainer, IProvideFrameVisibility, IORMDesignerView + public class ORMDiagramSpyWindow : ORMToolWindow, IORMSelectionContainer, IProvideFrameVisibility, IORMDesignerView, IVsToolboxUser { #region Member Variables private ToolWindowDiagramView myDiagramView; @@ -49,6 +51,8 @@ private LinkLabel myWatermarkLabel; private bool myDiagramSetChanged; private bool myDisassociating; + private IToolboxService myToolboxService; + private ToolboxFilterCache myToolboxFilterCache; private Store myStore; #endregion // Member Variables #region Constructor @@ -117,11 +121,13 @@ } if (!reselectOldDiagram) { + MultiDiagramDocView.DeactivateMouseActions(diagram.ActiveDiagramView); diagram.Associate(diagramView); } AdjustVisibility(true, false); if (!calledShow) { + calledShow = true; Show(); } if (reselectOldDiagram && diagramView.Selection.PrimaryItem != null) @@ -133,6 +139,12 @@ { SetSelectedComponents(new object[] { diagram }); } + DiagramClientView clientView; + if (calledShow && + !(clientView = diagramView.DiagramClientView).Focused) + { + clientView.Focus(); + } return true; } } @@ -236,7 +248,7 @@ myDiagramSetChanged = true; if (element == myDiagramView.Diagram) { - // Note that this is unlikely, the diagram will be disassociatin firts + // Note that this is unlikely, the diagram will be disassociated first AdjustVisibility(false, true); } } @@ -250,6 +262,7 @@ myDisassociating = true; try { + MultiDiagramDocView.DeactivateMouseActions(diagramView); diagram.Disassociate(diagramView); } finally @@ -288,16 +301,17 @@ } private void AdjustVisibility(bool diagramVisible, bool deferRebuildWatermark) { + DiagramView diagramView = myDiagramView; if (!diagramVisible) { - DiagramView view = myDiagramView; - Diagram diagram = view.Diagram; + Diagram diagram = diagramView.Diagram; if (diagram != null) { myDisassociating = true; try { - diagram.Disassociate(view); + MultiDiagramDocView.DeactivateMouseActions(diagramView); + diagram.Disassociate(diagramView); } finally { @@ -311,7 +325,7 @@ RebuildWatermark(); } } - myDiagramView.Visible = diagramVisible; + diagramView.Visible = diagramVisible; myWatermarkLabel.Visible = !diagramVisible; } private void RebuildWatermark() @@ -453,7 +467,32 @@ protected override void OnSelectionChanged(EventArgs e) { CommandManager.UpdateCommandStatus(); + UpdateToolbox(); } + /// <summary> + /// Update the toolbox when this window is activated + /// </summary> + protected override void OnORMSelectionContainerChanged() + { + if (CurrentORMSelectionContainer == this) + { + UpdateToolbox(); + } + } + private void UpdateToolbox() + { + MultiDiagramDocView docView; + if (null != (docView = CurrentDocumentView as MultiDiagramDocView) && + docView.UpdateToolboxDiagram(CurrentDiagram)) + { + IToolboxService toolboxService; + if (null != (toolboxService = ToolboxService)) + { + ToolboxFilterManager.UpdateFilters(this, ToolboxFilterSet.Diagram); + toolboxService.Refresh(); + } + } + } #endregion //ORMToolWindow overrides #region IORMDesignerView Implementation /// <summary> @@ -668,5 +707,68 @@ this.MenuService.ShowContextMenu(contextMenuId, pt.X, pt.Y); } #endregion // ContextMenu + #region IVsToolboxUser Implementation + /// <summary> + /// Get the <see cref="IToolboxService"/> for this object + /// </summary> + protected IToolboxService ToolboxService + { + get + { + return myToolboxService ?? (myToolboxService = (IToolboxService)ExternalServiceProvider.GetService(typeof(IToolboxService))); + } + } + /// <summary> + /// Get the <see cref="ToolboxFilterManager"/> for this window + /// </summary> + protected ToolboxFilterCache ToolboxFilterManager + { + get + { + ToolboxFilterCache retVal = myToolboxFilterCache; + if (retVal == null) + { + myToolboxFilterCache = retVal = new ToolboxFilterCache(); + retVal.UpdateFilters(this, ToolboxFilterSet.All); + } + return retVal; + } + } + /// <summary> + /// Implements <see cref="IVsToolboxUser.IsSupported"/> + /// </summary> + protected int IsSupported(OLE.IDataObject pDO) + { + IDataObject data = pDO as IDataObject; + if (data == null) + { + data = new DataObject(pDO); + } + IToolboxService toolboxService; + if (null != (toolboxService = ToolboxService)) + { + if (toolboxService.IsSupported(data, ToolboxFilterManager.ToolboxFilters)) + { + return VSConstants.S_OK; + } + } + return VSConstants.E_FAIL; + } + int IVsToolboxUser.IsSupported(OLE.IDataObject pDO) + { + return IsSupported(pDO); + } + /// <summary> + /// Implements <see cref="IVsToolboxUser.ItemPicked"/> + /// </summary> + protected static int ItemPicked(OLE.IDataObject pDO) + { + return VSConstants.S_OK; + } + int IVsToolboxUser.ItemPicked(OLE.IDataObject pDO) + { + return ItemPicked(pDO); + } + #endregion // IVsToolboxUser Implementation } } Modified: trunk/ORMModel/Shell/ORMDocData.cs =================================================================== --- trunk/ORMModel/Shell/ORMDocData.cs 2008-12-17 02:27:45 UTC (rev 1344) +++ trunk/ORMModel/Shell/ORMDocData.cs 2008-12-20 03:37:05 UTC (rev 1345) @@ -202,13 +202,13 @@ if (isReload) { - this.RemoveModelingEventHandlers(isReload); - // Null out the myPropertyProviderService and myTypedDomainModelProviderCache fields // so that a new instance will be created with the new Store next time it is needed this.myPropertyProviderService = null; this.myTypedDomainModelProviderCache = null; + this.RemoveModelingEventHandlers(isReload); + foreach (ModelingDocView view in DocViews) { MultiDiagramDocView multiDiagramDocView = view as MultiDiagramDocView; Modified: trunk/ORMModel/Shell/ORMDocDataServices.cs =================================================================== --- trunk/ORMModel/Shell/ORMDocDataServices.cs 2008-12-17 02:27:45 UTC (rev 1344) +++ trunk/ORMModel/Shell/ORMDocDataServices.cs 2008-12-20 03:37:05 UTC (rev 1345) @@ -1065,7 +1065,19 @@ { get { - return myPropertyProviderService ?? (myPropertyProviderService = new PropertyProviderService(Store)); + // Defensively verify store state + PropertyProviderService providers = myPropertyProviderService as PropertyProviderService; + Store store = Store; + if (providers == null || providers.Store != store) + { + if (store.ShuttingDown || store.Disposed) + { + myPropertyProviderService = null; + return null; + } + myPropertyProviderService = providers = new PropertyProviderService(store); + } + return providers; } } IPropertyProviderService IFrameworkServices.PropertyProviderService @@ -1081,10 +1093,17 @@ /// </summary> protected T[] GetTypedDomainModelProviders<T>() where T : class { + // Defensively verify store state TypedDomainModelProviderCache cache = myTypedDomainModelProviderCache; - if (cache == null) + Store store = Store; + if (cache == null || cache.Store != store) { - myTypedDomainModelProviderCache = cache = new TypedDomainModelProviderCache(Store); + if (store.ShuttingDown || store.Disposed) + { + myTypedDomainModelProviderCache = null; + return null; + } + myTypedDomainModelProviderCache = cache = new TypedDomainModelProviderCache(store); } return cache.GetTypedDomainModelProviders<T>(); } Modified: trunk/ORMModel/Shell/ORMDocView.cs =================================================================== --- trunk/ORMModel/Shell/ORMDocView.cs 2008-12-17 02:27:45 UTC (rev 1344) +++ trunk/ORMModel/Shell/ORMDocView.cs 2008-12-20 03:37:05 UTC (rev 1345) @@ -31,6 +31,7 @@ using Neumont.Tools.ORM.ObjectModel; using Neumont.Tools.ORM.ShapeModel; using Neumont.Tools.Modeling; +using Microsoft.VisualStudio.Shell.Interop; namespace Neumont.Tools.ORM.Shell { @@ -266,10 +267,11 @@ /// <see cref="DiagramDocView"/> designed to contain multiple <see cref="ORMDiagram"/>s. /// </summary> [CLSCompliant(false)] - public partial class ORMDesignerDocView : MultiDiagramDocView, IORMSelectionContainer, IORMDesignerView, IModelingEventSubscriber + public partial class ORMDesignerDocView : MultiDiagramDocView, IORMSelectionContainer, IORMDesignerView, IModelingEventSubscriber, IVsToolboxUser { #region Member variables private IServiceProvider myCtorServiceProvider; + private IMonitorSelectionService myMonitorSelectionService; private ORMDesignerCommandManager myCommandManager; #endregion // Member variables #region Construction/destruction @@ -819,6 +821,16 @@ } }); } + /// <summary> + /// Get the selection service for this designer + /// </summary> + protected IMonitorSelectionService MonitorSelection + { + get + { + return myMonitorSelectionService ?? (myMonitorSelectionService = (IMonitorSelectionService)myCtorServiceProvider.GetService(typeof(IMonitorSelectionService))); + } + } #endregion // ORMDesignerDocView Specific #region IORMDesignerView Implementation /// <summary> @@ -860,5 +872,39 @@ } } #endregion // IORMDesignerView Implementation + #region IVsToolboxUser Toolwindow Redirection + int IVsToolboxUser.IsSupported(Microsoft.VisualStudio.OLE.Interop.IDataObject pDO) + { + // Redirect toolbox queries to supporting tool windows if the document is not the + // active selection container. + object selectionContainer = MonitorSelection.CurrentSelectionContainer; + IVsToolboxUser redirectUser; + IORMDesignerView designerView; + if (selectionContainer != this && + null != (redirectUser = selectionContainer as IVsToolboxUser) && + null != (designerView = selectionContainer as IORMDesignerView) && + null != designerView.CurrentDiagram) + { + return redirectUser.IsSupported(pDO); + } + return IsSupported(pDO); + } + int IVsToolboxUser.ItemPicked(Microsoft.VisualStudio.OLE.Interop.IDataObject pDO) + { + // Redirect toolbox queries to supporting tool windows if the document is not the + // active selection container. + object selectionContainer = MonitorSelection.CurrentSelectionContainer; + IVsToolboxUser redirectUser; + IORMDesignerView designerView; + if (selectionContainer != this && + null != (redirectUser = selectionContainer as IVsToolboxUser) && + null != (designerView = selectionContainer as IORMDesignerView) && + null != designerView.CurrentDiagram) + { + return redirectUser.ItemPicked(pDO); + } + return ItemPicked(pDO); + } + #endregion // IVsToolboxUser Toolwindow Redirection } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2008-12-11 03:37:19
|
Revision: 1343 http://orm.svn.sourceforge.net/orm/?rev=1343&view=rev Author: mcurland Date: 2008-12-11 03:37:16 +0000 (Thu, 11 Dec 2008) Log Message: ----------- Fix display filter problems with extension error filters (the orm prefix was written regardless of model) and initial creation of TaskItem for filtered errors (errors filtered on load did not appear in the Error List when reenabled). refs #319 Also modified ModelError and NamedElementDictionary deserialization fixup listeners to support multiple invocations from extension models. This allows extension domain models to generate names and validate errors after the ORM core model is fully validated. Modified Paths: -------------- trunk/ORM2CommandLineTest/ORMTaskItem.cs trunk/ORMModel/Framework/DeserializationManager.cs trunk/ORMModel/Framework/NamedElementDictionary.cs trunk/ORMModel/ObjectModel/ModelError.cs trunk/ORMModel/ObjectModel/ModelErrorDisplayFilter.cs trunk/ORMModel/ObjectModel/ORMCore.DeserializationFixupListeners.cs trunk/ORMModel/ObjectModel/ORMModel.cs Modified: trunk/ORM2CommandLineTest/ORMTaskItem.cs =================================================================== --- trunk/ORM2CommandLineTest/ORMTaskItem.cs 2008-12-05 04:41:19 UTC (rev 1342) +++ trunk/ORM2CommandLineTest/ORMTaskItem.cs 2008-12-11 03:37:16 UTC (rev 1343) @@ -1,10 +1,9 @@ #region Using directives - using System; using System.Collections.Generic; using System.Text; +using Neumont.Tools.Modeling; using Neumont.Tools.ORM.ObjectModel; - #endregion namespace Neumont.Tools.ORM.SDK.TestEngine Modified: trunk/ORMModel/Framework/DeserializationManager.cs =================================================================== --- trunk/ORMModel/Framework/DeserializationManager.cs 2008-12-05 04:41:19 UTC (rev 1342) +++ trunk/ORMModel/Framework/DeserializationManager.cs 2008-12-11 03:37:16 UTC (rev 1343) @@ -207,7 +207,10 @@ TElement typedElement = element as TElement; if (typedElement != null) { - ElementCollection.Add(typedElement); + if (VerifyElementType(element)) + { + ElementCollection.Add(typedElement); + } } } void INotifyElementAdded.ElementAdded(ModelElement element) @@ -260,6 +263,20 @@ protected virtual void PhaseCompleted(Store store) { } + /// <summary> + /// Verify type information about the provided element. This filter is applied + /// after the <paramref name="element"/> is known to be of type <typeparamref name="TElement"/>. + /// Although the <see cref="ModelElement"/> instance is provided, no properties or + /// relationships generally associated with a fully constructed element are available + /// at this point. The only reliable information is available through <see cref="M:ModelElement.GetClassInfo"/> + /// and <see cref="P:ModelElement.Store"/>. + /// </summary> + /// <param name="element">The element to verify</param> + /// <returns><see langword="true"/> to process the element.</returns> + protected virtual bool VerifyElementType(ModelElement element) + { + return true; + } #endregion // DeserializationFixupListener specific } #endregion // DeserializationFixupListener class Modified: trunk/ORMModel/Framework/NamedElementDictionary.cs =================================================================== --- trunk/ORMModel/Framework/NamedElementDictionary.cs 2008-12-05 04:41:19 UTC (rev 1342) +++ trunk/ORMModel/Framework/NamedElementDictionary.cs 2008-12-11 03:37:16 UTC (rev 1343) @@ -914,11 +914,12 @@ /// ensures that the name dictionaries are correctly populated /// after a model deserialization is completed. /// </summary> - /// <param name="implicitFixupPhase">A fixup phase for adding implicitly + /// <param name="fixupPhase">A fixup phase for adding implicitly /// created elements and populating the name dictionaries</param> - public static IDeserializationFixupListener GetFixupListener(int implicitFixupPhase) + /// <param name="elementDomainModel">The required domain model type for processed elements</param> + public static IDeserializationFixupListener GetFixupListener(int fixupPhase, DomainModelInfo elementDomainModel) { - return new DeserializationFixupListener(implicitFixupPhase); + return new DeserializationFixupListener(fixupPhase, elementDomainModel); } /// <summary> /// A listener class to validate and/or populate the ModelError @@ -926,14 +927,21 @@ /// </summary> private sealed class DeserializationFixupListener : DeserializationFixupListener<INamedElementDictionaryLink> { + private DomainModelInfo myDomainModelFilter; /// <summary> /// Create a new NamedElementDictionary.DeserializationFixupListener /// </summary> - /// <param name="implicitFixupPhase">A fixup phase for adding implicitly - /// created elements and populating the name dictionaries</param> - public DeserializationFixupListener(int implicitFixupPhase) : base(implicitFixupPhase) + /// <param name="fixupPhase">The phase number for this listener</param> + /// <param name="elementDomainModel">The required domain model type for processed elements</param> + public DeserializationFixupListener(int fixupPhase, DomainModelInfo elementDomainModel) : base(fixupPhase) { + myDomainModelFilter = elementDomainModel; } + protected override bool VerifyElementType(ModelElement element) + { + DomainModelInfo modelFilter = myDomainModelFilter; + return (modelFilter != null) ? element.GetDomainClass().DomainModel == modelFilter : true; + } /// <summary> /// Add this element to the appropriate dictionary, and allow /// IDuplicateNameCollectionManager implementations to validate Modified: trunk/ORMModel/ObjectModel/ModelError.cs =================================================================== --- trunk/ORMModel/ObjectModel/ModelError.cs 2008-12-05 04:41:19 UTC (rev 1342) +++ trunk/ORMModel/ObjectModel/ModelError.cs 2008-12-11 03:37:16 UTC (rev 1343) @@ -381,16 +381,15 @@ return; } - IORMToolTaskProvider provider = (error.Store as IORMToolServices).TaskProvider; - IORMToolTaskItem newTask = provider.CreateTask(); - newTask.ElementLocator = error as IRepresentModelElements; - newTask.Text = error.ErrorText; - Debug.Assert(error.TaskData == null); - error.TaskData = newTask; - ModelErrorDisplayFilter filter = error.Model.ModelErrorDisplayFilter; if (filter == null || filter.ShouldDisplay(error)) { + IORMToolTaskProvider provider = (error.Store as IORMToolServices).TaskProvider; + IORMToolTaskItem newTask = provider.CreateTask(); + newTask.ElementLocator = error as IRepresentModelElements; + newTask.Text = error.ErrorText; + Debug.Assert(error.TaskData == null); + error.TaskData = newTask; provider.AddTask(newTask); } } @@ -406,15 +405,15 @@ #endregion // ModelError specific #region Deserialization Fixup /// <summary> - /// Return a deserialization fixup listener. The listener - /// validates all model errors and adds errors to the task provider. + /// Return a deserialization fixup listener. Return an error fixup listener + /// for errors in the specified domain model. The fixup listener validates + /// all model errors and adds errors to the task provider. /// </summary> - public static IDeserializationFixupListener FixupListener + /// <param name="fixupPhase">The phase for this listener</param> + /// <param name="errorDomainModel">The domain model that owns the errors</param> + public static IDeserializationFixupListener GetFixupListener(int fixupPhase, DomainModelInfo errorDomainModel) { - get - { - return new ModelErrorFixupListener(); - } + return new ModelErrorFixupListener(fixupPhase, errorDomainModel); } /// <summary> /// A listener class to validate and/or populate the ModelError @@ -422,12 +421,16 @@ /// </summary> private sealed class ModelErrorFixupListener : DeserializationFixupListener<IModelErrorOwner> { + private DomainModelInfo myDomainModelFilter; /// <summary> /// Create a new ModelErrorFixupListener /// </summary> - public ModelErrorFixupListener() - : base((int)ORMDeserializationFixupPhase.ValidateErrors) + /// <param name="fixupPhase">The phase for this listener</param> + /// <param name="errorDomainModel">The domain model that owns the errors</param> + public ModelErrorFixupListener(int fixupPhase, DomainModelInfo errorDomainModel) + : base(fixupPhase) { + myDomainModelFilter = errorDomainModel; } /// <summary> /// Defer to the IModelErrorOwner.ValidateErrors method @@ -441,19 +444,29 @@ element.ValidateErrors(notifyAdded); } /// <summary> - /// Add all model errors in the specific store to - /// the task list. + /// Verify that the element belongs to the correct domain model /// </summary> - /// <param name="store">The context store</param> + protected override bool VerifyElementType(ModelElement element) + { + DomainModelInfo modelFilter = myDomainModelFilter; + return (modelFilter != null) ? element.GetDomainClass().DomainModel == modelFilter : true; + } + /// <summary> + /// Add all model errors in the specific store that match the specified domain + /// model to the task provider. + /// </summary> protected sealed override void PhaseCompleted(Store store) { + DomainModelInfo modelFilter = myDomainModelFilter; IList<ModelHasError> errorLinks = store.ElementDirectory.FindElements<ModelHasError>(); int linkCount = errorLinks.Count; for (int i = 0; i < linkCount; ++i) { ModelHasError errorLink = errorLinks[i]; ModelError error = errorLink.Error; - if (!errorLink.IsDeleted && !error.IsDeleted) + if (!errorLink.IsDeleted && + !error.IsDeleted && + (modelFilter == null || error.GetDomainClass().DomainModel == modelFilter)) { // Make sure the text is up to date error.GenerateErrorText(); Modified: trunk/ORMModel/ObjectModel/ModelErrorDisplayFilter.cs =================================================================== --- trunk/ORMModel/ObjectModel/ModelErrorDisplayFilter.cs 2008-12-05 04:41:19 UTC (rev 1342) +++ trunk/ORMModel/ObjectModel/ModelErrorDisplayFilter.cs 2008-12-11 03:37:16 UTC (rev 1343) @@ -70,6 +70,7 @@ #region ModelErrorDisplayFilter class public partial class ModelErrorDisplayFilter : IXmlSerializable { + #region Xml serialization names private const string XMLCategoriesElement = "Categories"; private const string XMLIncludedErrorsElement = "IncludedErrors"; private const string XMLExcludedErrorsElement = "ExcludedErrors"; @@ -77,7 +78,8 @@ private const string XMLPrefix = "orm"; private const string XMLModelReferenceAttribute = "ref"; private const char ListDelimiter = ' '; - + #endregion // Xml serialization names + #region Member variables private bool myIncludedErrorsChanged = false; private bool myExcludedErrorsChanged = false; private bool myExcludedCategoriesChanged = false; @@ -87,7 +89,8 @@ private Dictionary<Type, Type> myIncludedErrors; private Dictionary<Type, Type> myExcludedErrors; private Dictionary<Type, Type> myExcludedCategories; - + #endregion // Member variables + #region Private Helper Methods private Dictionary<Type, Type> ExcludedCategoriesDictionary { get @@ -95,10 +98,10 @@ if (!myExcludedCategoriesChanged) { myExcludedCategories = ParseList(myExcludedCategoriesList, myExcludedCategories); + } + return myExcludedCategories; } - return myExcludedCategories; } - } private Dictionary<Type, Type> IncludedErrorsDictionary { get @@ -106,10 +109,10 @@ if (!myIncludedErrorsChanged) { myIncludedErrors = ParseList(myIncludedErrorsList, myIncludedErrors); + } + return myIncludedErrors; } - return myIncludedErrors; } - } private Dictionary<Type, Type> ExcludedErrorsDictionary { get @@ -117,10 +120,10 @@ if (!myExcludedErrorsChanged) { myExcludedErrors = ParseList(myExcludedErrorsList, myExcludedErrors); + } + return myExcludedErrors; } - return myExcludedErrors; } - } private Dictionary<Type, Type> ParseList(string list, Dictionary<Type, Type> cache) { if (list.Length != 0) @@ -151,14 +154,14 @@ return myExcludedCategoriesList; } private void SetExcludedCategoriesValue(string newValue) - { + { myExcludedCategoriesList = newValue; Dictionary<Type, Type> cache = ExcludedCategoriesDictionary; if (cache != null) - { + { cache.Clear(); - } } + } private string GetExcludedErrorsValue() { return myExcludedErrorsList; @@ -185,7 +188,41 @@ cache.Clear(); } } + private string GetValue(string myList, ref Dictionary<Type, Type> myCache) + { + string retVal = myList; + Dictionary<Type, Type> cache; + if ((cache = myCache) == null) + { + cache = myCache = new Dictionary<Type, Type>(); + } + //write the cache to a string + retVal = string.Empty; + foreach (Type type in cache.Keys) + { + retVal += type.FullName + ListDelimiter; + } + return retVal; + } + private Type GetCategory(Type error) + { + Type category = null; + object[] atributes = error.GetCustomAttributes(typeof(ModelErrorDisplayFilterAttribute), true); + foreach (object o in atributes) + { + ModelErrorDisplayFilterAttribute attribute = o as ModelErrorDisplayFilterAttribute; + if (attribute != null) + { + category = attribute.Category; + break; + } + } + + return category; + } + #endregion // Private Helper Methods + #region Public accessor methods /// <summary> /// Determines if an error should be displayed or not. /// </summary> @@ -217,20 +254,20 @@ if (exclude) { if (!(dictionary.ContainsKey(category))) - { + { myExcludedCategoriesChanged = true; - dictionary.Add(category, null); + dictionary.Add(category, null); + } } - } else - { + { if ((dictionary.ContainsKey(category))) - { + { myExcludedCategoriesChanged = true; dictionary.Remove(category); - } } } + } /// <summary> /// Toggles an error type to include or exclude. /// </summary> @@ -252,7 +289,7 @@ //flip whether to include or exclude the error in the sub-list exclude = !exclude; - } + } else { dictionary = ExcludedErrorsDictionary; @@ -264,7 +301,7 @@ } if (exclude) - { + { if (!(dictionary.ContainsKey(error))) { dictionary.Add(error, null); @@ -300,12 +337,12 @@ Dictionary<Type, Type> dictionary = IncludedErrorsDictionary; return !(dictionary != null && dictionary.ContainsKey(error)); } - else - { + else + { Dictionary<Type, Type> dictionary = ExcludedErrorsDictionary; return (dictionary != null && dictionary.ContainsKey(error)); - } } + } /// <summary> /// Commit any changes pending from calls to ToggleCategory or ToggleError. /// </summary> @@ -328,49 +365,54 @@ myExcludedErrorsChanged = false; myIncludedErrorsChanged = false; } - private string GetValue(string myList, ref Dictionary<Type, Type> myCache) + /// <summary> + /// returns string.Empty + /// </summary> + /// <returns></returns> + public override string ToString() { - string retVal = myList; - Dictionary<Type, Type> cache; - if ((cache = myCache) == null) + return ResourceStrings.ModelErrorDisplayFilteredText; + } + #endregion // Public accessor methods + #region Deserialization Fixup + /// <summary> + /// Return a deserialization fixup listener. The listener + /// verifies that the settings are not empty. + /// </summary> + public static IDeserializationFixupListener FixupListener + { + get { - cache = myCache = new Dictionary<Type, Type>(); + return new DisplayFilterFixupListener(); } - //write the cache to a string - retVal = string.Empty; - foreach (Type type in cache.Keys) - { - retVal += type.FullName + ListDelimiter; - } - return retVal; } - private Type GetCategory(Type error) + /// <summary> + /// Validate display filter contents + /// </summary> + private sealed class DisplayFilterFixupListener : DeserializationFixupListener<ModelErrorDisplayFilter> { - Type category = null; - - object[] atributes = error.GetCustomAttributes(typeof(ModelErrorDisplayFilterAttribute), true); - foreach (object o in atributes) + /// <summary> + /// DisplayFilterFixupListener constructor + /// </summary> + public DisplayFilterFixupListener() + : base((int)ORMDeserializationFixupPhase.ValidateErrors) { - ModelErrorDisplayFilterAttribute attribute = o as ModelErrorDisplayFilterAttribute; - if (attribute != null) + } + /// <summary> + /// Process objectification elements + /// </summary> + protected sealed override void ProcessElement(ModelErrorDisplayFilter element, Store store, INotifyElementAdded notifyAdded) + { + if (!element.IsDeleted) { - category = attribute.Category; - break; + if (string.IsNullOrEmpty(element.myExcludedCategoriesList) && string.IsNullOrEmpty(element.myExcludedErrorsList) && string.IsNullOrEmpty(element.myIncludedErrorsList)) + { + element.Delete(); + } } } - - return category; } - - /// <summary> - /// returns string.Empty - /// </summary> - /// <returns></returns> - public override string ToString() - { - return ResourceStrings.ModelErrorDisplayFilteredText; - } - + #endregion // Deserialization Fixup #region IXmlSerializable Implementation XmlSchema IXmlSerializable.GetSchema() { @@ -445,7 +487,17 @@ { namespaces = new Dictionary<string, string>(); } - namespaces.Add(serializationInfo.GetCustomElementNamespaces()[0, 1], serializationInfo.GetType().Namespace); + string defaultPrefix = serializationInfo.DefaultElementPrefix; + string[,] namespaceInfo = serializationInfo.GetCustomElementNamespaces(); + int infoCount = namespaceInfo.GetLength(0); + for (int i = 0; i < infoCount; ++i) + { + if (namespaceInfo[i, 0] == defaultPrefix) + { + namespaces.Add(namespaceInfo[i, 1], serializationInfo.GetType().Namespace); + break; + } + } } } if (namespaces != null) @@ -467,40 +519,60 @@ } void IXmlSerializable.WriteXml(XmlWriter writer) { - string XmlNamespace = ORMCoreDomainModel.XmlNamespace; - - writer.WriteStartElement(XMLPrefix, XMLElement, XmlNamespace); + writer.WriteStartElement(XMLPrefix, XMLElement, ORMCoreDomainModel.XmlNamespace); writer.WriteAttributeString("id", "_" + this.Id); writer.WriteAttributeString(XMLModelReferenceAttribute, "_" + Model.Id.ToString("D")); - writer.WriteStartElement(XMLPrefix, XMLCategoriesElement, XmlNamespace); - string[] types = myExcludedCategoriesList.Split(new char[] { ListDelimiter }, StringSplitOptions.RemoveEmptyEntries); - for (int i = 0; i < types.Length; ++i) - { - string type = types[i]; - writer.WriteElementString(XMLPrefix, type.Substring(type.LastIndexOf('.') + 1), XmlNamespace, string.Empty); - } + Dictionary<string, string[]> namespaceMap = null; + WriteTypeElements(writer, XMLCategoriesElement, myExcludedCategoriesList, ref namespaceMap); + WriteTypeElements(writer, XMLIncludedErrorsElement, myIncludedErrorsList, ref namespaceMap); + WriteTypeElements(writer, XMLExcludedErrorsElement, myExcludedErrorsList, ref namespaceMap); writer.WriteEndElement(); - - writer.WriteStartElement(XMLPrefix, XMLIncludedErrorsElement, XmlNamespace); - types = myIncludedErrorsList.Split(new char[] { ListDelimiter }, StringSplitOptions.RemoveEmptyEntries); - for (int i = 0; i < types.Length; ++i) + } + /// <summary> + /// Write the elements for the given container information + /// </summary> + /// <param name="writer">The current writer</param> + /// <param name="containerElementName">The name of the container element to write</param> + /// <param name="typeList">A space-delimited list of type names</param> + /// <param name="xmlNamespaceMap">A map associating CLR namespace names with XML prefix and namespace values</param> + private void WriteTypeElements(XmlWriter writer, string containerElementName, string typeList, ref Dictionary<string, string[]> xmlNamespaceMap) + { + string[] types = typeList.Split(new char[] { ListDelimiter }, StringSplitOptions.RemoveEmptyEntries); + if (types != null && types.Length != 0) { - string type = types[i]; - writer.WriteElementString(XMLPrefix, type.Substring(type.LastIndexOf('.') + 1), XmlNamespace, string.Empty); + writer.WriteStartElement(XMLPrefix, containerElementName, ORMCoreDomainModel.XmlNamespace); + for (int i = 0; i < types.Length; ++i) + { + string typeName = types[i]; + int namespaceDelimiterPosition = typeName.LastIndexOf('.'); + string[] xmlNames = (xmlNamespaceMap ?? (xmlNamespaceMap = BuildXmlNamespaceMap()))[typeName.Substring(0, namespaceDelimiterPosition)]; + writer.WriteElementString(xmlNames[0], typeName.Substring(typeName.LastIndexOf('.') + 1), xmlNames[1], string.Empty); } - writer.WriteEndElement(); - - writer.WriteStartElement(XMLPrefix, XMLExcludedErrorsElement, XmlNamespace); - types = myExcludedErrorsList.Split(new char[] { ListDelimiter }, StringSplitOptions.RemoveEmptyEntries); - for (int i = 0; i < types.Length; ++i) + writer.WriteEndElement(); + } + } + /// <summary> + /// Build a dictionary mapping a type namespace to an XML prefix and namespace + /// </summary> + private Dictionary<string, string[]> BuildXmlNamespaceMap() + { + Dictionary<string, string[]> retVal = new Dictionary<string,string[]>(); + foreach (ICustomSerializedDomainModel serializationInfo in Utility.EnumerateDomainModels<ICustomSerializedDomainModel>(Store.DomainModels)) { - string type = types[i]; - writer.WriteElementString(XMLPrefix, type.Substring(type.LastIndexOf('.') + 1), XmlNamespace, string.Empty); + string defaultPrefix = serializationInfo.DefaultElementPrefix; + string[,] namespaceInfo = serializationInfo.GetCustomElementNamespaces(); + int infoCount = namespaceInfo.GetLength(0); + for (int i = 0; i < infoCount; ++i) + { + if (namespaceInfo[i, 0] == defaultPrefix) + { + retVal.Add(serializationInfo.GetType().Namespace, new string[]{defaultPrefix, namespaceInfo[i, 1]}); + break; + } } - writer.WriteEndElement(); - - writer.WriteEndElement(); + } + return retVal; } #endregion // IXmlSerializable Implementation } Modified: trunk/ORMModel/ObjectModel/ORMCore.DeserializationFixupListeners.cs =================================================================== --- trunk/ORMModel/ObjectModel/ORMCore.DeserializationFixupListeners.cs 2008-12-05 04:41:19 UTC (rev 1342) +++ trunk/ORMModel/ObjectModel/ORMCore.DeserializationFixupListeners.cs 2008-12-11 03:37:16 UTC (rev 1343) @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; +using Microsoft.VisualStudio.Modeling; using Neumont.Tools.Modeling; namespace Neumont.Tools.ORM.ObjectModel @@ -26,13 +27,14 @@ /// <summary> /// Implements <see cref="IDeserializationFixupListenerProvider.DeserializationFixupListenerCollection"/> /// </summary> - protected static IEnumerable<IDeserializationFixupListener> DeserializationFixupListenerCollection + protected IEnumerable<IDeserializationFixupListener> DeserializationFixupListenerCollection { get { + DomainModelInfo contextDomainModel = DomainModelInfo; yield return SetComparisonConstraint.FixupListener; yield return SetConstraint.FixupListener; - yield return NamedElementDictionary.GetFixupListener((int)ORMDeserializationFixupPhase.ValidateElementNames); + yield return NamedElementDictionary.GetFixupListener((int)ORMDeserializationFixupPhase.ValidateElementNames, contextDomainModel); yield return SubtypeFact.FixupListener; yield return FactType.NameFixupListener; yield return FactType.UnaryFixupListener; @@ -43,9 +45,10 @@ yield return ORMModel.DataTypesFixupListener; yield return ObjectType.IsIndependentFixupListener; yield return ObjectType.PreferredIdentificationPathFixupListener; - yield return ModelError.FixupListener; + yield return ModelError.GetFixupListener((int)ORMDeserializationFixupPhase.ValidateErrors, contextDomainModel); yield return NameAlias.FixupListener; yield return NameGenerator.FixupListener; + yield return ModelErrorDisplayFilter.FixupListener; } } IEnumerable<IDeserializationFixupListener> IDeserializationFixupListenerProvider.DeserializationFixupListenerCollection Modified: trunk/ORMModel/ObjectModel/ORMModel.cs =================================================================== --- trunk/ORMModel/ObjectModel/ORMModel.cs 2008-12-05 04:41:19 UTC (rev 1342) +++ trunk/ORMModel/ObjectModel/ORMModel.cs 2008-12-11 03:37:16 UTC (rev 1343) @@ -1701,7 +1701,7 @@ /// returned elements will all come from a /// generated metarole collections. /// </summary> - protected abstract IList<ORMNamedElement> DuplicateElements { get;} + protected abstract IList<ModelElement> DuplicateElements { get;} /// <summary> /// Get the text to display the duplicate error information. Replacement /// field {0} is replaced by the model name, field {1} is replaced by the @@ -1709,12 +1709,26 @@ /// </summary> protected abstract string ErrorFormatText { get;} /// <summary> + /// Get the name of an element. The default implementation uses + /// the <see cref="DomainClassInfo.NameDomainProperty"/> to determine + /// the name. Derived classes can produce a more efficient implementation + /// if they know the actual element type. + /// </summary> + /// <param name="element"></param> + /// <returns></returns> + protected virtual string GetElementName(ModelElement element) + { + DomainPropertyInfo nameProperty = element.GetDomainClass().NameDomainProperty; + Debug.Assert(nameProperty != null, "Duplicate names should only be checked on elements with names"); + return nameProperty.GetValue(element) as string; + } + /// <summary> /// Verify that all of the duplicate elements attached to /// this error actually have the same name. /// </summary> /// <returns>true if validation succeeded. false is /// returned if testElement does not have a name specified</returns> - public bool ValidateDuplicates(ORMNamedElement testElement) + public bool ValidateDuplicates(ModelElement testElement) { return ValidateDuplicates(testElement, null); } @@ -1727,9 +1741,9 @@ /// <param name="duplicates">Pre-fetched duplicates, or null</param> /// <returns>true if validation succeeded. false is /// returned if testElement does not have a name specified</returns> - private bool ValidateDuplicates(ORMNamedElement testElement, IList<ORMNamedElement> duplicates) + private bool ValidateDuplicates(ModelElement testElement, IList<ModelElement> duplicates) { - string testName = testElement.Name; + string testName = GetElementName(testElement); if (testName.Length > 0) { if (duplicates == null) @@ -1739,8 +1753,8 @@ int duplicatesCount = duplicates.Count; for (int i = 0; i < duplicatesCount; ++i) { - ORMNamedElement compareTo = duplicates[i]; - if (compareTo != testElement && compareTo.Name != testElement.Name) + ModelElement compareTo = duplicates[i]; + if (compareTo != testElement && GetElementName(compareTo) != testName) { return false; } @@ -1756,8 +1770,8 @@ /// </summary> public override void GenerateErrorText() { - IList<ORMNamedElement> elements = DuplicateElements; - string elementName = (elements.Count != 0) ? (elements[0]).Name : string.Empty; + IList<ModelElement> elements = DuplicateElements; + string elementName = (elements.Count != 0) ? GetElementName(elements[0]) : string.Empty; ORMModel model = Model; string modelName = (model != null) ? model.Name : string.Empty; string newText = string.Format(CultureInfo.InvariantCulture, ErrorFormatText, modelName, elementName); @@ -1784,19 +1798,23 @@ /// <summary> /// Implements <see cref="IRepresentModelElements.GetRepresentedElements"/> /// </summary> - protected new ORMNamedElement[] GetRepresentedElements() + protected new ModelElement[] GetRepresentedElements() { // Pick up all roles played directly by this element. This // will get ObjectTypeCollection, FactTypeCollection, etc, but // not the owning model. These are non-aggregating roles. - IList<ORMNamedElement> elements = DuplicateElements; + IList<ModelElement> elements = DuplicateElements; int count = elements.Count; if (count == 0) { return null; } - ORMNamedElement[] retVal = new ORMNamedElement[count]; - elements.CopyTo(retVal, 0); + ModelElement[] retVal = elements as ModelElement[]; + if (retVal == null) + { + retVal = new ModelElement[count]; + elements.CopyTo(retVal, 0); + } return retVal; } ModelElement[] IRepresentModelElements.GetRepresentedElements() @@ -1830,7 +1848,7 @@ { if (!IsDeleted) { - IList<ORMNamedElement> duplicates = DuplicateElements; + IList<ModelElement> duplicates = DuplicateElements; // Note that existing name error links are validated when // the element is loaded via the IDuplicateNameCollectionManager // implementation(s) on the model itself. All remaining duplicate @@ -1868,7 +1886,7 @@ /// Get the duplicate elements represented by this DuplicateNameError /// </summary> /// <returns>ObjectTypeCollection</returns> - protected override IList<ORMNamedElement> DuplicateElements + protected override IList<ModelElement> DuplicateElements { get { @@ -1876,6 +1894,13 @@ } } /// <summary> + /// Provide an efficient name lookup + /// </summary> + protected override string GetElementName(ModelElement element) + { + return ((ORMNamedElement)element).Name; + } + /// <summary> /// Get the text to display the duplicate error information. Replacement /// field {0} is replaced by the model name, field {1} is replaced by the /// element name. @@ -1916,14 +1941,21 @@ /// Get the duplicate elements represented by this DuplicateNameError /// </summary> /// <returns>ConstraintCollection</returns> - protected override IList<ORMNamedElement> DuplicateElements + protected override IList<ModelElement> DuplicateElements { get { - return ConstraintCollection; + return ConstraintCollection as IList<ModelElement>; } } /// <summary> + /// Provide an efficient name lookup + /// </summary> + protected override string GetElementName(ModelElement element) + { + return ((ORMNamedElement)element).Name; + } + /// <summary> /// Get the text to display the duplicate error information. Replacement /// field {0} is replaced by the model name, field {1} is replaced by the /// element name. @@ -2136,11 +2168,18 @@ /// <summary> /// Returns the list of DuplicateElements /// </summary> - protected override IList<ORMNamedElement> DuplicateElements + protected override IList<ModelElement> DuplicateElements { get { return RecognizedPhraseCollection.ToArray(); } } /// <summary> + /// Provide an efficient name lookup + /// </summary> + protected override string GetElementName(ModelElement element) + { + return ((ORMNamedElement)element).Name; + } + /// <summary> /// Text to be displayed when an error is thrown. ///</summary> //TODO: Add this to the ResourceStrings collection This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2008-12-05 04:41:22
|
Revision: 1342 http://orm.svn.sourceforge.net/orm/?rev=1342&view=rev Author: mcurland Date: 2008-12-05 04:41:19 +0000 (Fri, 05 Dec 2008) Log Message: ----------- Fixed crash adding new diagram with [1341] when the 'Diagram Management' extension is not turned on. Also changed the display name of SaveDiagramPosition to SaveDiagramPositions to more accurately reflect its application to all diagrams, not just the selected one where the property is displayed. refs #379 Modified Paths: -------------- trunk/ORMModel/Framework/Shell/DiagramDisplay.dsl trunk/ORMModel/Framework/Shell/GeneratedCode/DomainModelResx.resx trunk/ORMModel/Framework/Shell/MultiDiagramDocView.cs trunk/ORMModel/Shell/ORMDocView.cs Modified: trunk/ORMModel/Framework/Shell/DiagramDisplay.dsl =================================================================== --- trunk/ORMModel/Framework/Shell/DiagramDisplay.dsl 2008-12-03 21:41:29 UTC (rev 1341) +++ trunk/ORMModel/Framework/Shell/DiagramDisplay.dsl 2008-12-05 04:41:19 UTC (rev 1342) @@ -35,7 +35,7 @@ <Classes> <DomainClass Name="DiagramDisplay" Namespace="Neumont.Tools.Modeling.Shell" Id="14A6B724-7849-4D7D-A5C2-29910FFBB516" DisplayName="DiagramDisplay" InheritanceModifier="Sealed" Description=""> <Properties> - <DomainProperty Name="SaveDiagramPosition" DisplayName="SaveDiagramPosition" IsBrowsable="true" DefaultValue="true" Id="17AA2B64-3328-4420-8C68-34157D10DB77" Description="Save the most recent position and zoom information for each diagram in addition to diagram order."> + <DomainProperty Name="SaveDiagramPosition" DisplayName="SaveDiagramPositions" IsBrowsable="true" DefaultValue="true" Id="17AA2B64-3328-4420-8C68-34157D10DB77" Description="Save the most recent position and zoom information for each diagram in addition to diagram order."> <Type> <ExternalTypeMoniker Name="/System/Boolean"/> </Type> Modified: trunk/ORMModel/Framework/Shell/GeneratedCode/DomainModelResx.resx =================================================================== --- trunk/ORMModel/Framework/Shell/GeneratedCode/DomainModelResx.resx 2008-12-03 21:41:29 UTC (rev 1341) +++ trunk/ORMModel/Framework/Shell/GeneratedCode/DomainModelResx.resx 2008-12-05 04:41:19 UTC (rev 1342) @@ -138,7 +138,7 @@ <comment>Description for DomainProperty 'SaveDiagramPosition' on DomainClass 'DiagramDisplay'</comment> </data> <data name="Neumont.Tools.Modeling.Shell.DiagramDisplay/SaveDiagramPosition.DisplayName" xml:space="preserve"> - <value>SaveDiagramPosition</value> + <value>SaveDiagramPositions</value> <comment>DisplayName for DomainProperty 'SaveDiagramPosition' on DomainClass 'DiagramDisplay'</comment> </data> <data name="Neumont.Tools.Modeling.Shell.DiagramPlaceHolder.Description" xml:space="preserve"> Modified: trunk/ORMModel/Framework/Shell/MultiDiagramDocView.cs =================================================================== --- trunk/ORMModel/Framework/Shell/MultiDiagramDocView.cs 2008-12-03 21:41:29 UTC (rev 1341) +++ trunk/ORMModel/Framework/Shell/MultiDiagramDocView.cs 2008-12-05 04:41:19 UTC (rev 1342) @@ -557,7 +557,7 @@ { DomainDataDirectory dataDirectory = store.DomainDataDirectory; DomainClassInfo classInfo; - classInfo = dataDirectory.FindDomainClass(DiagramDisplayHasDiagramOrder.DomainClassId); + classInfo = dataDirectory.FindDomainRelationship(DiagramDisplayHasDiagramOrder.DomainClassId); if (classInfo != null) { // DiagramDisplay is an optional domain model, it may not be loaded in the store Modified: trunk/ORMModel/Shell/ORMDocView.cs =================================================================== --- trunk/ORMModel/Shell/ORMDocView.cs 2008-12-03 21:41:29 UTC (rev 1341) +++ trunk/ORMModel/Shell/ORMDocView.cs 2008-12-05 04:41:19 UTC (rev 1342) @@ -413,6 +413,7 @@ LinkedElementCollection<Diagram> diagramOrder; int selectedDiagramIndex; if (null != (selectedDiagram = ContextMenuStrip.SelectedDiagram) && + null != store.FindDomainModel(DiagramDisplayDomainModel.DomainModelId) && null != (displayContainer = DiagramDisplayHasDiagramOrder.GetDiagramDisplay(selectedDiagram)) && (selectedDiagramIndex = (diagramOrder = displayContainer.OrderedDiagramCollection).IndexOf(selectedDiagram)) < (diagramOrder.Count - 1)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2008-11-21 17:40:44
|
Revision: 1340 http://orm.svn.sourceforge.net/orm/?rev=1340&view=rev Author: mcurland Date: 2008-11-21 17:40:41 +0000 (Fri, 21 Nov 2008) Log Message: ----------- Pressing F2 (the View.EditLabel command) while an in-place edit control was already active disabled the command. Always handle this command to stop it disabling. refs #374 Modified Paths: -------------- trunk/ORMModel/Shell/ORMModelBrowser.cs trunk/ORMModel/Shell/ORMModelBrowserCommandSet.cs trunk/ORMModel/Shell/ORMReadingEditor.cs trunk/ORMModel/Shell/ORMSamplePopulationToolWindow.cs Modified: trunk/ORMModel/Shell/ORMModelBrowser.cs =================================================================== --- trunk/ORMModel/Shell/ORMModelBrowser.cs 2008-11-20 08:17:47 UTC (rev 1339) +++ trunk/ORMModel/Shell/ORMModelBrowser.cs 2008-11-21 17:40:41 UTC (rev 1340) @@ -218,7 +218,12 @@ /// </summary> protected virtual void OnMenuEditLabel() { - myTreeContainer.TreeControl.BeginLabelEdit(); + // We always report an enabled status on this, so verify that it + // is actually enabled before handling it. + if (0 != (myEnabledCommands & ORMDesignerCommands.EditLabel)) + { + myTreeContainer.TreeControl.BeginLabelEdit(); + } } /// <summary> /// Select the specified shape in the specified target window. Modified: trunk/ORMModel/Shell/ORMModelBrowserCommandSet.cs =================================================================== --- trunk/ORMModel/Shell/ORMModelBrowserCommandSet.cs 2008-11-20 08:17:47 UTC (rev 1339) +++ trunk/ORMModel/Shell/ORMModelBrowserCommandSet.cs 2008-11-21 17:40:41 UTC (rev 1340) @@ -166,7 +166,16 @@ } public void OnStatusEditLabel(Object sender, EventArgs e) { - ORMModelBrowserToolWindow.OnStatusCommand(sender, ORMDesignerCommands.EditLabel, CurrentToolWindow); + MenuCommand command = sender as MenuCommand; + if (command != null) + { + // Support this command regardless of whether or not it is supported by the current + // element or the current state of the inline editor. If we do not do this, then an F2 + // keypress with an editor already open will report the command as disabled and we would + // need to use IVsUIShell.UpdateCommandUI whenever an editor closed to reenable the command. + command.Visible = true; + command.Enabled = true; + } } public void OnMenuEditLabel(Object sender, EventArgs e) { Modified: trunk/ORMModel/Shell/ORMReadingEditor.cs =================================================================== --- trunk/ORMModel/Shell/ORMReadingEditor.cs 2008-11-20 08:17:47 UTC (rev 1339) +++ trunk/ORMModel/Shell/ORMReadingEditor.cs 2008-11-21 17:40:41 UTC (rev 1340) @@ -420,16 +420,12 @@ break; case VSConstants.VSStd97CmdID.EditLabel: - // Inform the shell that we should have a chance to handle the edit label (rename) command. - if (!this.myForm.ReadingEditor.EditingFactType.IsEmpty) - { - cmd.cmdf = (int)(MSOLE.OLECMDF.OLECMDF_SUPPORTED | MSOLE.OLECMDF.OLECMDF_ENABLED); - prgCmds[0] = cmd; - } - else - { - goto default; - } + // Support this command regardless of the current state of the inline editor. + // If we do not do this, then an F2 keypress with an editor already open will + // report the command as disabled and we would need to use IVsUIShell.UpdateCommandUI + // whenever an editor closed to reenable the command. + cmd.cmdf = (int)(MSOLE.OLECMDF.OLECMDF_SUPPORTED | MSOLE.OLECMDF.OLECMDF_ENABLED); + prgCmds[0] = cmd; break; default: @@ -528,13 +524,9 @@ myForm.EditSelectedReading(); } } - // We enabled the command, so we say we handled it regardless of the further conditions - hr = VSConstants.S_OK; } - else - { - goto default; - } + // We enabled the command, so we say we handled it regardless of the further conditions + hr = VSConstants.S_OK; break; default: Modified: trunk/ORMModel/Shell/ORMSamplePopulationToolWindow.cs =================================================================== --- trunk/ORMModel/Shell/ORMSamplePopulationToolWindow.cs 2008-11-20 08:17:47 UTC (rev 1339) +++ trunk/ORMModel/Shell/ORMSamplePopulationToolWindow.cs 2008-11-21 17:40:41 UTC (rev 1340) @@ -374,16 +374,12 @@ } break; case VSConstants.VSStd97CmdID.EditLabel: - // Inform the shell that we should have a chance to handle the edit command - if (!this.myEditor.FullRowSelect && !this.myEditor.InLabelEdit) - { - cmd.cmdf = (int)(MSOLE.OLECMDF.OLECMDF_SUPPORTED | MSOLE.OLECMDF.OLECMDF_ENABLED); - prgCmds[0] = cmd; - } - else - { - goto default; - } + // Support this command regardless of the current state of the inline editor. + // If we do not do this, then an F2 keypress with an editor already open will + // report the command as disabled and we would need to use IVsUIShell.UpdateCommandUI + // whenever an editor closed to reenable the command. + cmd.cmdf = (int)(MSOLE.OLECMDF.OLECMDF_SUPPORTED | MSOLE.OLECMDF.OLECMDF_ENABLED); + prgCmds[0] = cmd; break; default: // Inform the shell that we don't support any other commands. @@ -486,13 +482,10 @@ SendMessage(editHandle, 0x101, (int)Keys.F2, 0x40000001); } } - // We enabled the command, so we say we handled it regardless of the further conditions - hr = VSConstants.S_OK; } - else - { - goto default; - } + // We enabled the command, so we say we handled it irrespective of the other conditions. + // See commands in QueryStatus regarding the enabled state of this command. + hr = VSConstants.S_OK; break; default: // If the command is from our command set, but not explicitly handled, inform the shell This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2008-11-20 08:17:50
|
Revision: 1339 http://orm.svn.sourceforge.net/orm/?rev=1339&view=rev Author: mcurland Date: 2008-11-20 08:17:47 +0000 (Thu, 20 Nov 2008) Log Message: ----------- Reprioritize shapes for the context window so that entities are preferred over valuetypes (stops occasional reference mode value types from appearing in the context window with their respective entity types). Also returned attached FactTypes for objectification case, and cleaned up recursion in core context window routines. refs #283 Modified Paths: -------------- trunk/ORMModel/ObjectModel/Constraint.cs trunk/ORMModel/ObjectModel/FactType.cs trunk/ORMModel/ObjectModel/HierarchyContext.cs trunk/ORMModel/ObjectModel/ObjectType.cs trunk/ORMModel/ObjectModel/Role.cs trunk/ORMModel/Shell/ORMContextWindow.cs Modified: trunk/ORMModel/ObjectModel/Constraint.cs =================================================================== --- trunk/ORMModel/ObjectModel/Constraint.cs 2008-11-20 08:09:04 UTC (rev 1338) +++ trunk/ORMModel/ObjectModel/Constraint.cs 2008-11-20 08:17:47 UTC (rev 1339) @@ -1465,21 +1465,15 @@ } } /// <summary> - /// Implements <see cref="IHierarchyContextEnabled.ForcedHierarchyContextElementCollection"/> + /// Implements <see cref="IHierarchyContextEnabled.GetForcedHierarchyContextElements"/> /// </summary> - protected static IEnumerable<IHierarchyContextEnabled> ForcedHierarchyContextElementCollection + protected static IEnumerable<IHierarchyContextEnabled> GetForcedHierarchyContextElements(bool minimalElements) { - get - { - return null; - } + return null; } - IEnumerable<IHierarchyContextEnabled> IHierarchyContextEnabled.ForcedHierarchyContextElementCollection + IEnumerable<IHierarchyContextEnabled> IHierarchyContextEnabled.GetForcedHierarchyContextElements(bool minimalElements) { - get - { - return ForcedHierarchyContextElementCollection; - } + return GetForcedHierarchyContextElements(minimalElements); } /// <summary> /// Implements <see cref="IHierarchyContextEnabled.HierarchyContextPlacementPriority"/> @@ -2639,21 +2633,15 @@ } } /// <summary> - /// Implements <see cref="IHierarchyContextEnabled.ForcedHierarchyContextElementCollection"/> + /// Implements <see cref="IHierarchyContextEnabled.GetForcedHierarchyContextElements"/> /// </summary> - protected static IEnumerable<IHierarchyContextEnabled> ForcedHierarchyContextElementCollection + protected static IEnumerable<IHierarchyContextEnabled> GetForcedHierarchyContextElements(bool minimalElements) { - get - { - return null; - } + return null; } - IEnumerable<IHierarchyContextEnabled> IHierarchyContextEnabled.ForcedHierarchyContextElementCollection + IEnumerable<IHierarchyContextEnabled> IHierarchyContextEnabled.GetForcedHierarchyContextElements(bool minimalElements) { - get - { - return ForcedHierarchyContextElementCollection; - } + return GetForcedHierarchyContextElements(minimalElements); } /// <summary> /// Implements <see cref="IHierarchyContextEnabled.HierarchyContextPlacementPriority"/> Modified: trunk/ORMModel/ObjectModel/FactType.cs =================================================================== --- trunk/ORMModel/ObjectModel/FactType.cs 2008-11-20 08:09:04 UTC (rev 1338) +++ trunk/ORMModel/ObjectModel/FactType.cs 2008-11-20 08:17:47 UTC (rev 1339) @@ -2678,22 +2678,54 @@ } } /// <summary> - /// Gets the elements that the current instance is dependant on for display. - /// The returned elements will be forced to display in the context window. + /// Implements <see cref="IHierarchyContextEnabled.GetForcedHierarchyContextElements"/>. + /// Returns all role players if minimal elements are called for, otherwise returns all + /// related FactTypes, Subtypes, and Supertypes of an ObjectifiedFactType, plus the elements + /// needed for display of those elements. /// </summary> - /// <value>The dependant context elements.</value> - protected IEnumerable<IHierarchyContextEnabled> ForcedHierarchyContextElementCollection + protected IEnumerable<IHierarchyContextEnabled> GetForcedHierarchyContextElements(bool minimalElements) { - get + foreach (RoleBase roleBase in RoleCollection) { - LinkedElementCollection<RoleBase> collection = RoleCollection; - int collectionCount = collection.Count; - for (int i = 0; i < collectionCount; ++i) + ObjectType rolePlayer = roleBase.Role.RolePlayer; + if (!rolePlayer.IsImplicitBooleanValue) { - IHierarchyContextEnabled rolePlayer = collection[i].Role.RolePlayer as IHierarchyContextEnabled; - if (rolePlayer != null) + yield return roleBase.Role.RolePlayer; + } + } + if (!minimalElements) + { + ObjectType nestingType = NestingType; + if (nestingType != null) + { + // Make sure an objectified FactType picks up its supertypes, subtypes, and + // facttypes for directly played roles + foreach (Role role in nestingType.PlayedRoleCollection) { - yield return rolePlayer; + SubtypeMetaRole subtypeRole; + SupertypeMetaRole supertypeRole; + if (null != (subtypeRole = role as SubtypeMetaRole)) + { + yield return ((SubtypeFact)role.FactType).Supertype; + } + else if (null != (supertypeRole = role as SupertypeMetaRole)) + { + yield return ((SubtypeFact)role.FactType).Subtype; + } + else + { + FactType relatedFactType = role.FactType; + yield return relatedFactType; + foreach (RoleBase roleBase in relatedFactType.RoleCollection) + { + ObjectType rolePlayer = roleBase.Role.RolePlayer; + if (rolePlayer != nestingType && + !rolePlayer.IsImplicitBooleanValue) + { + yield return rolePlayer; + } + } + } } } } @@ -2713,7 +2745,7 @@ } else { - return HierarchyContextPlacementPriority.High; + return HierarchyContextPlacementPriority.Higher; } } } @@ -2754,9 +2786,9 @@ { get { return ForwardHierarchyContextTo; } } - IEnumerable<IHierarchyContextEnabled> IHierarchyContextEnabled.ForcedHierarchyContextElementCollection + IEnumerable<IHierarchyContextEnabled> IHierarchyContextEnabled.GetForcedHierarchyContextElements(bool minimalElements) { - get { return ForcedHierarchyContextElementCollection; } + return GetForcedHierarchyContextElements(minimalElements); } HierarchyContextPlacementPriority IHierarchyContextEnabled.HierarchyContextPlacementPriority { Modified: trunk/ORMModel/ObjectModel/HierarchyContext.cs =================================================================== --- trunk/ORMModel/ObjectModel/HierarchyContext.cs 2008-11-20 08:09:04 UTC (rev 1338) +++ trunk/ORMModel/ObjectModel/HierarchyContext.cs 2008-11-20 08:17:47 UTC (rev 1339) @@ -10,25 +10,49 @@ public enum HierarchyContextPlacementPriority { /// <summary> + /// Highest + /// </summary> + Highest = 100, + /// <summary> /// VeryHigh /// </summary> - VeryHigh = 100, // Object types + VeryHigh = 90, // Entity types /// <summary> + /// Higher + /// </summary> + Higher = 80, // Objectified Fact Types + /// <summary> /// High /// </summary> - High = 75, // Objectified Fact Types + High = 70, // Value types /// <summary> + /// MediumHigh + /// </summary> + MediumHigh = 60, + /// <summary> /// Medium /// </summary> Medium = 50, // Fact types /// <summary> + /// MediumLow + /// </summary> + MediumLow = 40, + /// <summary> /// Low /// </summary> - Low = 25, // roles + Low = 30, // roles /// <summary> + /// Lower + /// </summary> + Lower = 20, + /// <summary> /// VeryLow /// </summary> - VeryLow = 0, // Constraints + VeryLow = 10, // Constraints + /// <summary> + /// Lowest + /// </summary> + Lowest = 0, } /// <summary> /// Defines the methods and properties required for an object to display in the ORMContextWindow @@ -66,8 +90,10 @@ /// Gets the elements that the current instance is dependant on for display. /// The returned elements will be forced to display in the context window. /// </summary> - /// <value>The dependant context elements.</value> - IEnumerable<IHierarchyContextEnabled> ForcedHierarchyContextElementCollection { get;} + /// <param name="minimalElements">The final elements have been retrieved, + /// retrieve the minimal number of elements for display.</param> + /// <returns>Elements that always need to be shown with this element</returns> + IEnumerable<IHierarchyContextEnabled> GetForcedHierarchyContextElements(bool minimalElements); /// <summary> /// Gets the place priority. The place priority specifies the order in which the element will /// be placed on the context diagram. Modified: trunk/ORMModel/ObjectModel/ObjectType.cs =================================================================== --- trunk/ORMModel/ObjectModel/ObjectType.cs 2008-11-20 08:09:04 UTC (rev 1338) +++ trunk/ORMModel/ObjectModel/ObjectType.cs 2008-11-20 08:17:47 UTC (rev 1339) @@ -4133,26 +4133,24 @@ get { return ForwardHierarchyContextTo; } } /// <summary> - /// Gets the elements that the current instance is dependant on for display. - /// The returned elements will be forced to display in the context window. + /// Implements <see cref="IHierarchyContextEnabled.GetForcedHierarchyContextElements"/> /// </summary> - /// <value>The dependant context elements.</value> - protected static IEnumerable<IHierarchyContextEnabled> ForcedHierarchyContextElementCollection + protected static IEnumerable<IHierarchyContextEnabled> GetForcedHierarchyContextElements(bool minimalElements) { - get { return null; } + return null; } - IEnumerable<IHierarchyContextEnabled> IHierarchyContextEnabled.ForcedHierarchyContextElementCollection + IEnumerable<IHierarchyContextEnabled> IHierarchyContextEnabled.GetForcedHierarchyContextElements(bool minimalElements) { - get { return ForcedHierarchyContextElementCollection; } + return GetForcedHierarchyContextElements(minimalElements); } /// <summary> /// Gets the place priority. The place priority specifies the order in which the element will /// be placed on the context diagram. /// </summary> /// <value>The place priority.</value> - protected static HierarchyContextPlacementPriority HierarchyContextPlacementPriority + protected HierarchyContextPlacementPriority HierarchyContextPlacementPriority { - get { return HierarchyContextPlacementPriority.VeryHigh; } + get { return IsValueType ? HierarchyContextPlacementPriority.High : HierarchyContextPlacementPriority.VeryHigh; } } HierarchyContextPlacementPriority IHierarchyContextEnabled.HierarchyContextPlacementPriority { Modified: trunk/ORMModel/ObjectModel/Role.cs =================================================================== --- trunk/ORMModel/ObjectModel/Role.cs 2008-11-20 08:09:04 UTC (rev 1338) +++ trunk/ORMModel/ObjectModel/Role.cs 2008-11-20 08:17:47 UTC (rev 1339) @@ -1490,17 +1490,15 @@ get { return ForwardHierarchyContextTo; } } /// <summary> - /// Gets the elements that the current instance is dependant on for display. - /// The returned elements will be forced to display in the context window. + /// Implements <see cref="IHierarchyContextEnabled.GetForcedHierarchyContextElements"/> /// </summary> - /// <value>The dependant context elements.</value> - protected static IEnumerable<IHierarchyContextEnabled> ForcedHierarchyContextElementCollection + protected static IEnumerable<IHierarchyContextEnabled> GetForcedHierarchyContextElements(bool minimalElements) { - get { return null; } + return null; } - IEnumerable<IHierarchyContextEnabled> IHierarchyContextEnabled.ForcedHierarchyContextElementCollection + IEnumerable<IHierarchyContextEnabled> IHierarchyContextEnabled.GetForcedHierarchyContextElements(bool minimalElements) { - get { return ForcedHierarchyContextElementCollection; } + return GetForcedHierarchyContextElements(minimalElements); } /// <summary> /// Gets the place priority. The place priority specifies the order in which the element will Modified: trunk/ORMModel/Shell/ORMContextWindow.cs =================================================================== --- trunk/ORMModel/Shell/ORMContextWindow.cs 2008-11-20 08:09:04 UTC (rev 1338) +++ trunk/ORMModel/Shell/ORMContextWindow.cs 2008-11-20 08:17:47 UTC (rev 1339) @@ -347,9 +347,7 @@ /// <param name="element">The element.</param> private void PlaceObject(IHierarchyContextEnabled element) { - SortedList<IHierarchyContextEnabled, int> elementsToPlace = GetRelatedContextableElements(element, myGenerations); - IList<IHierarchyContextEnabled> elements = elementsToPlace.Keys; - foreach (IHierarchyContextEnabled elem in elements) + foreach (IHierarchyContextEnabled elem in GetRelatedContextableElements(element, myGenerations)) { if (elem.ForwardHierarchyContextTo != null) { @@ -363,34 +361,56 @@ /// </summary> /// <param name="element">The element.</param> /// <param name="generations">The numeber of generations out to go.</param> - /// <returns></returns> - private static SortedList<IHierarchyContextEnabled, int> GetRelatedContextableElements(IHierarchyContextEnabled element, int generations) + /// <returns>Sorted list of elements</returns> + private static IList<IHierarchyContextEnabled> GetRelatedContextableElements(IHierarchyContextEnabled element, int generations) { - SortedList<IHierarchyContextEnabled, int> relatedElementsCollection = new SortedList<IHierarchyContextEnabled, int>(HierarchyContextPlacePrioritySortComparer.Instance); - GetRelatedContextableElementsHelper(element, ref relatedElementsCollection, generations); - IList<IHierarchyContextEnabled> keys = relatedElementsCollection.Keys; - int relatedElementsCount = keys.Count; - for (int i = 0; i < relatedElementsCount; ++i) + Dictionary<IHierarchyContextEnabled, int> masterDictionary = new Dictionary<IHierarchyContextEnabled, int>(); + GetRelatedContextableElementsHelper(element, masterDictionary, ref masterDictionary, generations); + int nextPassCount = masterDictionary.Count; + IHierarchyContextEnabled[] firstPassElements = new IHierarchyContextEnabled[nextPassCount]; + masterDictionary.Keys.CopyTo(firstPassElements, 0); + ICollection<IHierarchyContextEnabled> nextPassElements = firstPassElements; + + while (nextPassCount != 0) { - IEnumerable<IHierarchyContextEnabled> forcedContextElements = keys[i].ForcedHierarchyContextElementCollection; - if (forcedContextElements != null) + Dictionary<IHierarchyContextEnabled, int> localDictionary = null; + bool requestMinimum = generations == 0; + generations = Math.Max(generations - 1, 0); + foreach (IHierarchyContextEnabled nextPassElement in nextPassElements) { - foreach (IHierarchyContextEnabled dependantContextableElement in forcedContextElements) + IEnumerable<IHierarchyContextEnabled> forcedContextElements = nextPassElement.GetForcedHierarchyContextElements(requestMinimum); + if (forcedContextElements != null) { - GetRelatedContextableElementsHelper(dependantContextableElement, ref relatedElementsCollection, 0); + foreach (IHierarchyContextEnabled dependantContextableElement in forcedContextElements) + { + GetRelatedContextableElementsHelper(dependantContextableElement, masterDictionary, ref localDictionary, generations); + } } } + if (localDictionary != null) + { + nextPassElements = localDictionary.Keys; + nextPassCount = nextPassElements.Count; + } + else + { + nextPassCount = 0; + } } - return relatedElementsCollection; + List<IHierarchyContextEnabled> retVal = new List<IHierarchyContextEnabled>(masterDictionary.Keys); + retVal.Sort(HierarchyContextPlacePrioritySortComparer.Instance); + return retVal; } /// <summary> /// Dont use this method. Use GetRelatedContextableElements instead. /// helper function for GetRelatedContextableElements. /// </summary> /// <param name="element">The element.</param> - /// <param name="relatedElementsCollection">The related elements collection.</param> + /// <param name="masterDictionary">A master dictionary of all elements</param> + /// <param name="localDictionary">A local dictionary for this pass through. + /// Allows us to track multiple passes while iterating through the elements of another dictionary.</param> /// <param name="generations">The generations.</param> - private static void GetRelatedContextableElementsHelper(IHierarchyContextEnabled element, ref SortedList<IHierarchyContextEnabled, int> relatedElementsCollection, int generations) + private static void GetRelatedContextableElementsHelper(IHierarchyContextEnabled element, Dictionary<IHierarchyContextEnabled, int> masterDictionary, ref Dictionary<IHierarchyContextEnabled, int> localDictionary, int generations) { if (element == null) { @@ -401,37 +421,55 @@ { return; } - if (!relatedElementsCollection.ContainsKey(contextableElement)) + int existingGenerations; + if (!masterDictionary.TryGetValue(contextableElement, out existingGenerations)) { - relatedElementsCollection.Add(contextableElement, generations); + masterDictionary.Add(contextableElement, generations); + if (localDictionary != masterDictionary) + { + (localDictionary ?? (localDictionary = new Dictionary<IHierarchyContextEnabled, int>())).Add(contextableElement, generations); + } } else { - if (relatedElementsCollection[contextableElement] >= generations) + if (existingGenerations >= generations) { return; } else { - relatedElementsCollection[contextableElement] = generations; + masterDictionary[contextableElement] = generations; + if (localDictionary == null) + { + (localDictionary = new Dictionary<IHierarchyContextEnabled,int>()).Add(contextableElement, generations); + } + else if (localDictionary != masterDictionary && !localDictionary.ContainsKey(contextableElement)) + { + // Note that we don't actually use the generations value from + // the local dictionary, there is no reason to update it. + localDictionary.Add(contextableElement, generations); + } } } - if (contextableElement.ForwardHierarchyContextTo != null) + IHierarchyContextEnabled forwardTo; + if (null != (forwardTo = contextableElement.ForwardHierarchyContextTo)) { - GetRelatedContextableElementsHelper(contextableElement.ForwardHierarchyContextTo, ref relatedElementsCollection, generations); + GetRelatedContextableElementsHelper(forwardTo, masterDictionary, ref localDictionary, generations); } - if (generations > 0 && (relatedElementsCollection.Count == 1 || contextableElement.ContinueWalkingHierarchyContext)) + if (generations > 0 && (masterDictionary.Count == 1 || contextableElement.ContinueWalkingHierarchyContext)) { - GetLinkedElements(contextableElement, ref relatedElementsCollection, generations); + GetLinkedElements(contextableElement, masterDictionary, ref localDictionary, generations); } } /// <summary> /// Gets the linked elements for the specified element. /// </summary> /// <param name="element">The element.</param> - /// <param name="relatedElementsCollection">The related elements collection.</param> + /// <param name="masterDictionary">A master dictionary of all elements</param> + /// <param name="localDictionary">A local dictionary for this pass through. + /// Allows us to track multiple passes while iterating through the elements of another dictionary.</param> /// <param name="generations">The generations.</param> - private static void GetLinkedElements(IHierarchyContextEnabled element, ref SortedList<IHierarchyContextEnabled, int> relatedElementsCollection, int generations) + private static void GetLinkedElements(IHierarchyContextEnabled element, Dictionary<IHierarchyContextEnabled, int> masterDictionary, ref Dictionary<IHierarchyContextEnabled, int> localDictionary, int generations) { ReadOnlyCollection<ElementLink> col = DomainRoleInfo.GetAllElementLinks((ModelElement)element); foreach (ElementLink link in col) @@ -444,11 +482,11 @@ continue; } int decrement = contextableElement.HierarchyContextDecrementCount; - if (relatedElementsCollection.Count == 1 && contextableElement.ForwardHierarchyContextTo != null) + if (masterDictionary.Count == 1 && contextableElement.ForwardHierarchyContextTo != null) { decrement = 0; } - GetRelatedContextableElementsHelper(contextableElement, ref relatedElementsCollection, generations - decrement); + GetRelatedContextableElementsHelper(contextableElement, masterDictionary, ref localDictionary, generations - decrement); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2008-11-20 08:09:08
|
Revision: 1338 http://orm.svn.sourceforge.net/orm/?rev=1338&view=rev Author: mcurland Date: 2008-11-20 08:09:04 +0000 (Thu, 20 Nov 2008) Log Message: ----------- Modify the selection container tracking routines to allow a covered toolwindow that is an ORM selection container (currently this set is the model browser and diagram spy) to provide the selection for other toolwindows. Previously, the selection could jump back to the current document window when the tool window was deactivated, which made these containers unusable for toolwindow-based edits. refs #376 Modified Paths: -------------- trunk/ORMModel/Framework/Shell/ToolWindowActivator.cs trunk/ORMModel/Shell/ORMDiagramSpy.cs trunk/ORMModel/Shell/ORMModelBrowser.cs Modified: trunk/ORMModel/Framework/Shell/ToolWindowActivator.cs =================================================================== --- trunk/ORMModel/Framework/Shell/ToolWindowActivator.cs 2008-11-19 22:47:15 UTC (rev 1337) +++ trunk/ORMModel/Framework/Shell/ToolWindowActivator.cs 2008-11-20 08:09:04 UTC (rev 1338) @@ -85,6 +85,7 @@ ClearContentsOnSelectionChanged, } #endregion // CoveredFrameContentActions enum + #region INotifyToolWindowActivation interface /// <summary> /// Callback interface provided by consumers of the <see cref="T:ToolWindowActivationHelper"/> class. /// </summary> @@ -122,7 +123,21 @@ /// <param name="docData">The document to detach from</param> void ActivatorDetachEventHandlers(DocDataType docData); } - + #endregion // INotifyToolWindowActivation interface + #region ICurrentFrameVisibility interface + /// <summary> + /// Provide the current frame visibility. Implement this interface + /// on a selection container tool window to enable maintaining the tool + /// window as a selection container even when it is hidden. + /// </summary> + public interface IProvideFrameVisibility + { + /// <summary> + /// The current <see cref="FrameVisibility"/> for this container + /// </summary> + FrameVisibility CurrentFrameVisibility { get;} + } + #endregion // ICurrentFrameVisibility interface #region ToolWindowActivationHelper class /// <summary> /// Helper class to enable tool window implementations to track changes selection @@ -410,7 +425,7 @@ } } /// <summary> - /// Clear the contents of the tool window associated with thie <see cref="T:ToolWindowActivationHelper"/> + /// Clear the contents of the tool window associated with this <see cref="T:ToolWindowActivationHelper"/> /// </summary> protected virtual void ClearContents() { @@ -602,7 +617,16 @@ private void MonitorSelectionChanged(object sender, MonitorSelectionEventArgs e) { IMonitorSelectionService monitor = (IMonitorSelectionService)sender; - CurrentSelectionContainer = monitor.CurrentSelectionContainer as SelectionContainerType ?? monitor.CurrentDocumentView as SelectionContainerType; + SelectionContainerType newContainer = monitor.CurrentSelectionContainer as SelectionContainerType; + if (newContainer == null) + { + IProvideFrameVisibility visibility = myCurrentSelectionContainer as IProvideFrameVisibility; + if (visibility == null || visibility.CurrentFrameVisibility == FrameVisibility.Hidden) + { + newContainer = monitor.CurrentDocumentView as SelectionContainerType; + } + } + CurrentSelectionContainer = newContainer; } /// <summary> /// Handles the DocumentWindowChanged event on the IMonitorSelectionService Modified: trunk/ORMModel/Shell/ORMDiagramSpy.cs =================================================================== --- trunk/ORMModel/Shell/ORMDiagramSpy.cs 2008-11-19 22:47:15 UTC (rev 1337) +++ trunk/ORMModel/Shell/ORMDiagramSpy.cs 2008-11-20 08:09:04 UTC (rev 1338) @@ -41,7 +41,7 @@ /// </summary> [Guid("19A5C15D-14D4-4A88-9891-A3294077BE56")] [CLSCompliant(false)] - public class ORMDiagramSpyWindow : ORMToolWindow, IORMSelectionContainer, IORMDesignerView + public class ORMDiagramSpyWindow : ORMToolWindow, IORMSelectionContainer, IProvideFrameVisibility, IORMDesignerView { #region Member Variables private ToolWindowDiagramView myDiagramView; @@ -557,6 +557,15 @@ } } #endregion // IORMDesignerView Implementation + #region IProvideFrameVisibility Implementation + FrameVisibility IProvideFrameVisibility.CurrentFrameVisibility + { + get + { + return CurrentFrameVisibility; + } + } + #endregion // IProvideFrameVisibility Implementation #region ORMDiagramSpyToolWindow specific /// <summary> /// Loads the SurveyTreeControl from the current document Modified: trunk/ORMModel/Shell/ORMModelBrowser.cs =================================================================== --- trunk/ORMModel/Shell/ORMModelBrowser.cs 2008-11-19 22:47:15 UTC (rev 1337) +++ trunk/ORMModel/Shell/ORMModelBrowser.cs 2008-11-20 08:09:04 UTC (rev 1338) @@ -32,6 +32,7 @@ using System.Runtime.InteropServices; using Neumont.Tools.Modeling.Design; using Microsoft.VisualStudio.Modeling.Diagrams; +using Neumont.Tools.Modeling.Shell; using Neumont.Tools.ORM.ShapeModel; using MSOLE = Microsoft.VisualStudio.OLE.Interop; using Microsoft.VisualStudio; @@ -44,9 +45,17 @@ /// </summary> [Guid("DD2334C3-AFDB-4FC5-9E8A-17D19A8CC97A")] [CLSCompliant(false)] - public partial class ORMModelBrowserToolWindow : ORMToolWindow, IORMSelectionContainer + public partial class ORMModelBrowserToolWindow : ORMToolWindow, IORMSelectionContainer, IProvideFrameVisibility { + #region Member Variables private SurveyTreeContainer myTreeContainer; + private ORMDesignerCommands myVisibleCommands; + private ORMDesignerCommands myCheckedCommands; + private ORMDesignerCommands myCheckableCommands; + private ORMDesignerCommands myEnabledCommands; + private object myCommandSet; + #endregion // Member Variables + #region Constructor /// <summary> /// public constructor /// </summary> @@ -55,12 +64,7 @@ : base(serviceProvider) { } - private ORMDesignerCommands myVisibleCommands; - private ORMDesignerCommands myCheckedCommands; - private ORMDesignerCommands myCheckableCommands; - private ORMDesignerCommands myEnabledCommands; - private object myCommandSet; - + #endregion // Constructor #region MenuService, MonitorSelectionService, and SelectedNode properties private static bool myCommandsPopulated; /// <summary> @@ -477,5 +481,14 @@ } } #endregion //ORMToolWindow overrides + #region IProvideFrameVisibility Implementation + FrameVisibility IProvideFrameVisibility.CurrentFrameVisibility + { + get + { + return CurrentFrameVisibility; + } + } + #endregion // IProvideFrameVisibility Implementation } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |