[commit] r2179 - trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Generator

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Fri Apr 19 13:03:41 CDT 2013


Author: ksmyth
Date: Fri Apr 19 13:03:41 2013
New Revision: 2179

Log:
Fix DsmlGenerator: AssociationClass is bidirectional

Modified:
   trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Generator/Configuration.cs
   trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Generator/FcoHelper.cs
   trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Generator/FcoSrcDstConnections.cs

Modified: trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Generator/Configuration.cs
==============================================================================
--- trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Generator/Configuration.cs	Fri Apr 19 12:02:59 2013	(r2178)
+++ trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Generator/Configuration.cs	Fri Apr 19 13:03:41 2013	(r2179)
@@ -167,13 +167,13 @@
 
 			public const string SrcConnections =
 @"<summary>
-<para>Retrives all connections, which have this object as a DESTINATION.</para>
+<para>Retrieves all connections, which have this object as a DESTINATION.</para>
 <para></para>
 </summary>";
 
 			public const string DstConnections =
 @"<summary>
-<para>Retrives all connections, which have this object as a SOURCE.</para>
+<para>Retrieves all connections, which have this object as a SOURCE.</para>
 <para></para>
 </summary>";
 

Modified: trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Generator/FcoHelper.cs
==============================================================================
--- trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Generator/FcoHelper.cs	Fri Apr 19 12:02:59 2013	(r2178)
+++ trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Generator/FcoHelper.cs	Fri Apr 19 13:03:41 2013	(r2179)
@@ -540,7 +540,7 @@
 							{
 								if (simpleConn.MetaBase.Name == "AssociationClass")
 								{
-                                    MgaFCO target = simpleConn.Src;
+                                    MgaFCO target = simpleConn.Src == connector ? simpleConn.Dst : simpleConn.Src;
                                     if (target is MgaReference)
                                     {
                                         target = (target as MgaReference).Referred;
@@ -589,7 +589,7 @@
 							{
 								if (simpleConn.MetaBase.Name == "AssociationClass")
 								{
-                                    MgaFCO target = simpleConn.Src;
+                                    MgaFCO target = simpleConn.Src == connector ? simpleConn.Dst : simpleConn.Src;
 									if (target is MgaReference)
 									{
                                         target = (target as MgaReference).Referred;

Modified: trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Generator/FcoSrcDstConnections.cs
==============================================================================
--- trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Generator/FcoSrcDstConnections.cs	Fri Apr 19 12:02:59 2013	(r2178)
+++ trunk/SDK/DotNet/DsmlGenerator/CSharpDsmlGenerator/Generator/FcoSrcDstConnections.cs	Fri Apr 19 13:03:41 2013	(r2179)
@@ -56,9 +56,9 @@
 
 				newSrcConn.Members.Add(ctor);
 
-				foreach (IGrouping<MgaFCO, string> tuple in connections.GroupBy(x => x.Item1, x => x.Item2))
+				foreach (IGrouping<MgaFCO, string> group in connections.GroupBy(x => x.Item1, x => x.Item2))
 				{
-                    MgaFCO item = tuple.Key;
+                    MgaFCO item = group.Key;
                     if (!(item is MgaAtom))
                     {
                         continue;
@@ -74,11 +74,11 @@
 					newConnections.Comments.Add(
 						new CodeCommentStatement(Configuration.Comments.SrcConnections, true));
 
-                    if (tuple.Count() == 1)
+                    if (group.Count() == 1)
                     {
 					    newConnections.GetStatements.Add(
 						    new CodeMethodReturnStatement(
-							    new CodeSnippetExpression(typeof(ISIS.GME.Common.Utils).FullName + ".Cast" + tuple.First() + "Connections<" + Configuration.GetClassName(item as MgaObject) + ", global::" + typeof(MgaFCO).FullName + ">(Impl as global::" + typeof(MgaFCO).FullName + ", \"" + Configuration.GetKindName(item as MgaObject) + "\")")));
+							    new CodeSnippetExpression(typeof(ISIS.GME.Common.Utils).FullName + ".CastSrcConnections<" + Configuration.GetClassName(item as MgaObject) + ", global::" + typeof(MgaFCO).FullName + ">(Impl as global::" + typeof(MgaFCO).FullName + ", \"" + Configuration.GetKindName(item as MgaObject) + "\")")));
                     }
                     else
                     {
@@ -203,9 +203,9 @@
 
 				newDstConn.Members.Add(ctor);
 
-				foreach (IGrouping<MgaFCO, string> tuple in connections.GroupBy(x => x.Item1, x => x.Item2))
+				foreach (IGrouping<MgaFCO, string> group in connections.GroupBy(x => x.Item1, x => x.Item2))
 				{
-                    MgaFCO item = tuple.Key;
+                    MgaFCO item = group.Key;
                     if (!(item is MgaAtom))
                     {
                         continue;
@@ -221,7 +221,7 @@
 					newConnections.Comments.Add(
 						new CodeCommentStatement(Configuration.Comments.DstConnections, true));
 
-                    if (tuple.Count() == 1)
+                    if (group.Count() == 1)
                     {
                         newConnections.GetStatements.Add(
                             new CodeMethodReturnStatement(
@@ -262,7 +262,8 @@
 				}
 				else
 				{
-                    var allConnectionClasses = connections.Select(x => x.Item1).Distinct();
					newAllDstConnections.GetStatements.Add(
+                    var allConnectionClasses = connections.Select(x => x.Item1).Distinct();
+					newAllDstConnections.GetStatements.Add(
 							new CodeSnippetExpression(
 								"IEnumerable<" + typeof(ISIS.GME.Common.Interfaces.Connection).FullName + "> result = ((" +
 								Configuration.GetInterfaceName(Subject) +


More information about the gme-commit mailing list