Subversion Repositories DevTools

Rev

Rev 2094 | Rev 2100 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2094 Rev 2098
Line 184... Line 184...
184
         this.button_generate.Text = "Generate";
184
         this.button_generate.Text = "Generate";
185
         this.button_generate.Click += new System.EventHandler(this.button_generate_Click);
185
         this.button_generate.Click += new System.EventHandler(this.button_generate_Click);
186
         // 
186
         // 
187
         // button_view_output
187
         // button_view_output
188
         // 
188
         // 
-
 
189
         this.button_view_output.Enabled = false;
189
         this.button_view_output.Location = new System.Drawing.Point(376, 384);
190
         this.button_view_output.Location = new System.Drawing.Point(376, 384);
190
         this.button_view_output.Name = "button_view_output";
191
         this.button_view_output.Name = "button_view_output";
191
         this.button_view_output.Size = new System.Drawing.Size(96, 23);
192
         this.button_view_output.Size = new System.Drawing.Size(96, 23);
192
         this.button_view_output.TabIndex = 6;
193
         this.button_view_output.TabIndex = 6;
193
         this.button_view_output.Text = "View Output";
194
         this.button_view_output.Text = "View Output";
Line 390... Line 391...
390
                  && true == theElement.Visibility.StartsWith("Private") )
391
                  && true == theElement.Visibility.StartsWith("Private") )
391
               {
392
               {
392
                  // do nothing
393
                  // do nothing
393
               }
394
               }
394
               else
395
               else
-
 
396
               {
395
                  Elements.Add( theElement );
397
                  Elements.Add( theElement );
-
 
398
               }
396
            }
399
            }
397
         }
400
         }
398
      }
401
      }
399
 
402
 
400
 
403
 
Line 446... Line 449...
446
         if (EA_Project.PutDiagramImageOnClipboard(theDiagram.DiagramGUID,0))
449
         if (EA_Project.PutDiagramImageOnClipboard(theDiagram.DiagramGUID,0))
447
         {
450
         {
448
            object startLocation;
451
            object startLocation;
449
            object endLocation;
452
            object endLocation;
450
 
453
 
-
 
454
            TextUtils.appendDescription( theDiagram.Notes, EA_Utils );
-
 
455
 
451
            // create a range at the end of the document
456
            // create a range at the end of the document
452
            startLocation = WordDocument.Content.End;
457
            startLocation = WordDocument.Content.End;
453
            WordDocument.Content.InsertParagraphAfter();
458
            WordDocument.Content.InsertParagraphAfter();
454
            endLocation = WordDocument.Content.End;
459
            endLocation = WordDocument.Content.End;
455
            Word.Range WordRange = WordDocument.Range(ref startLocation, ref endLocation);
460
            Word.Range WordRange = WordDocument.Range(ref startLocation, ref endLocation);
Line 1263... Line 1268...
1263
 
1268
 
1264
 
1269
 
1265
      private void generateMethodContent( EA.Element theElement, int recurse_level )
1270
      private void generateMethodContent( EA.Element theElement, int recurse_level )
1266
      {
1271
      {
1267
         recurse_level++;
1272
         recurse_level++;
1268
         if (recurse_level > 8)  // 8 instead of 9 because this function generates two heading levels 
1273
         if (recurse_level > EA_Constants.MAX_HEADING_LEVEL - 1)  // -1 because this function generates two heading levels 
1269
         {
1274
         {
1270
            throw new System.StackOverflowException("Max Recursion Depth (9) Exceeded" );
1275
            throw new System.StackOverflowException(EA_Constants.maxRecursionDepthException );
1271
         }
1276
         }
1272
 
1277
 
1273
         // Get all the methods into an array list and sort them by their position in the class's
1278
         // Get all the methods into an array list and sort them by their position in the class's
1274
         // method list (ie. sort order is determined by the Pos value in each method).
1279
         // method list (ie. sort order is determined by the Pos value in each method).
1275
         ArrayList theMethods = new ArrayList();
1280
         ArrayList theMethods = new ArrayList();
Line 1318... Line 1323...
1318
                     theParams.Add( theParam );
1323
                     theParams.Add( theParam );
1319
                  parameterSortByPos paramSorter = new parameterSortByPos();
1324
                  parameterSortByPos paramSorter = new parameterSortByPos();
1320
                  theParams.Sort( paramSorter );
1325
                  theParams.Sort( paramSorter );
1321
 
1326
 
1322
                  // Print the prototype heading
1327
                  // Print the prototype heading
1323
                  wr = TextUtils.appendAndSelectText("\nPrototype:", EA_Constants.styleName_Body1);
1328
                  wr = TextUtils.appendAndSelectText("\nPrototype:", EA_Constants.styleName_Body1_Left_2_5cm_Italic);
1324
                  wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)2.5);
-
 
1325
                  wr.Font.Italic = 1;
-
 
1326
 
1329
 
1327
                  // begin to build the prototype string
1330
                  // begin to build the prototype string
1328
                  sb = new StringBuilder();
1331
                  sb = new StringBuilder();
1329
                  sb.Append( theMethod.ReturnType );
1332
                  sb.Append( theMethod.ReturnType );
1330
                  sb.Append( " " );
1333
                  sb.Append( " " );
Line 1334... Line 1337...
1334
                  if (theParams.Count > 0)
1337
                  if (theParams.Count > 0)
1335
                  {
1338
                  {
1336
                     int numParamsRemaining = theParams.Count;
1339
                     int numParamsRemaining = theParams.Count;
1337
 
1340
 
1338
                     // print what we have so far constructed for the prototype
1341
                     // print what we have so far constructed for the prototype
1339
                     wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1342
                     wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_3_5cm);
1340
                     wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)3.5);
-
 
1341
 
1343
 
1342
                     // Now form a new string for the params
1344
                     // Now form a new string for the params
1343
                     sb = new StringBuilder();
1345
                     sb = new StringBuilder();
1344
                     foreach(EA.Parameter theParam in theParams)
1346
                     foreach(EA.Parameter theParam in theParams)
1345
                     {
1347
                     {
Line 1364... Line 1366...
1364
                        numParamsRemaining--;
1366
                        numParamsRemaining--;
1365
                     }
1367
                     }
1366
 
1368
 
1367
                     // complete the prototype and print it.
1369
                     // complete the prototype and print it.
1368
                     sb.Append( ")" );
1370
                     sb.Append( ")" );
1369
                     wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1371
                     wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_4_5cm);
1370
                     wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)4.5);
-
 
1371
                  }
1372
                  }
1372
                  else
1373
                  else
1373
                  {
1374
                  {
1374
                     // complete the prototype and print it.
1375
                     // complete the prototype and print it.
1375
                     sb.Append( ")" );
1376
                     sb.Append( ")" );
1376
                     wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1377
                     wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_3_5cm);
1377
                     wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)3.5);
-
 
1378
                  }
1378
                  }
1379
 
1379
 
1380
 
1380
 
1381
                  // Prototype Attributes/Characteristics
1381
                  // Prototype Attributes/Characteristics
1382
                  sb = new StringBuilder();
1382
                  sb = new StringBuilder();
Line 1418... Line 1418...
1418
                     sb.Append( theMethod.Throws );
1418
                     sb.Append( theMethod.Throws );
1419
                  }
1419
                  }
1420
 
1420
 
1421
                  if (sb.Length > 0)
1421
                  if (sb.Length > 0)
1422
                  {
1422
                  {
1423
                     wr = TextUtils.appendAndSelectText("Characteristics:", EA_Constants.styleName_Body1);
1423
                     wr = TextUtils.appendAndSelectText("Characteristics:", EA_Constants.styleName_Body1_Left_2_5cm_Italic);
1424
                     wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)2.5);
-
 
1425
                     wr.Font.Italic = 1;
-
 
1426
 
1424
 
1427
                     wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1425
                     wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_3_5cm);
1428
                     wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)3.5);
-
 
1429
                  }
1426
                  }
1430
 
1427
 
1431
                  // Parameter Descriptions
1428
                  // Parameter Descriptions
1432
                  if (theParams.Count > 0)
1429
                  if (theParams.Count > 0)
1433
                  {
1430
                  {
1434
                     wr = TextUtils.appendAndSelectText("Parameters:", EA_Constants.styleName_Body1);
1431
                     wr = TextUtils.appendAndSelectText("Parameters:", EA_Constants.styleName_Body1_Left_2_5cm_Italic);
1435
                     wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)2.5);
-
 
1436
                     wr.Font.Italic = 1;
-
 
1437
 
1432
 
1438
                     foreach(EA.Parameter theParam in theParams)
1433
                     foreach(EA.Parameter theParam in theParams)
1439
                     {
1434
                     {
1440
                        wr = TextUtils.appendAndSelectText( theParam.Name, EA_Constants.styleName_Body1);
1435
                        wr = TextUtils.appendAndSelectText( theParam.Name + "\t", EA_Constants.stylename_Parameter_Description);
1441
                        wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)3.5);
1436
                        // do notes in seperate step since we want to call the appendDescription() method which 
1442
 
-
 
1443
                        wr = TextUtils.appendDescription(theParam.Notes, EA_Utils);
1437
                        // automatically alerts us to missing descriptions in the generated document.
1444
                        wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)4.5);
1438
                        wr = TextUtils.appendDescription( theParam.Notes, EA_Constants.stylename_Parameter_Description, EA_Utils, true);
1445
                     }
1439
                     }
1446
                  }
1440
                  }
1447
               }
1441
               }
1448
            }
1442
            }
1449
         }
1443
         }
Line 1456... Line 1450...
1456
      /// <param name="theElement"></param>
1450
      /// <param name="theElement"></param>
1457
      /// <param name="recurse_level"></param>
1451
      /// <param name="recurse_level"></param>
1458
      private void generateAttributeContent( EA.Element theElement, int recurse_level )
1452
      private void generateAttributeContent( EA.Element theElement, int recurse_level )
1459
      {
1453
      {
1460
         recurse_level++;
1454
         recurse_level++;
1461
         if (recurse_level > 9)
1455
         if (recurse_level > EA_Constants.MAX_HEADING_LEVEL)
1462
         {
1456
         {
1463
            throw new System.StackOverflowException("Max Recursion Depth (9) Exceeded" );
1457
            throw new System.StackOverflowException(EA_Constants.maxRecursionDepthException );
1464
         }
1458
         }
1465
      
1459
      
1466
         // Get all the attributes into an array list and sort them by their position in the class's
1460
         // Get all the attributes into an array list and sort them by their position in the class's
1467
         // attribute list (ie. sort order is determined by the Pos value in each attribute).
1461
         // attribute list (ie. sort order is determined by the Pos value in each attribute).
1468
         ArrayList theAttrs = new ArrayList();
1462
         ArrayList theAttrs = new ArrayList();
Line 1626... Line 1620...
1626
                  if (sb.Length > 0)
1620
                  if (sb.Length > 0)
1627
                  {
1621
                  {
1628
                     // remove the trailing "\n"
1622
                     // remove the trailing "\n"
1629
                     sb.Remove( sb.ToString().Length - 1, 1);
1623
                     sb.Remove( sb.ToString().Length - 1, 1);
1630
 
1624
 
1631
                     wr = TextUtils.appendAndSelectText("Characteristics:", EA_Constants.styleName_Body1);
1625
                     wr = TextUtils.appendAndSelectText("Characteristics:", EA_Constants.styleName_Body1_Left_3_5cm_Italic);
1632
                     wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)3.5);
-
 
1633
                     wr.Font.Italic = 1;
-
 
1634
 
1626
 
1635
                     wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1627
                     wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_4_5cm);
1636
                     wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)4.5);
-
 
1637
                  }
1628
                  }
1638
 
1629
 
1639
                  numAttrsRemaining--;
1630
                  numAttrsRemaining--;
1640
               }
1631
               }
1641
            }
1632
            }
Line 1646... Line 1637...
1646
      private void generateClassCharacteristics( EA.Element theElement, int recurse_level )
1637
      private void generateClassCharacteristics( EA.Element theElement, int recurse_level )
1647
      {
1638
      {
1648
         StringBuilder sb = new StringBuilder();
1639
         StringBuilder sb = new StringBuilder();
1649
 
1640
 
1650
         sb.Append( "Characteristics:" );
1641
         sb.Append( "Characteristics:" );
1651
         Word.Range wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1642
         Word.Range wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_2_5cm_Italic);
1652
         wr.Font.Italic = 1;
-
 
1653
         
1643
         
1654
         sb = new StringBuilder();
1644
         sb = new StringBuilder();
1655
         sb.Append( theElement.Visibility );
1645
         sb.Append( theElement.Visibility );
1656
 
1646
 
1657
         if (System.Convert.ToInt32(theElement.Abstract) == 1)
1647
         if (System.Convert.ToInt32(theElement.Abstract) == 1)
1658
            sb.Append( "\nAbstract" );
1648
            sb.Append( "\nAbstract" );
1659
 
1649
 
1660
         wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1650
         wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_3_5cm);
1661
         wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)3.5);
-
 
1662
         
1651
         
1663
         sb = new StringBuilder();
1652
         sb = new StringBuilder();
1664
         foreach(EA.Element baseClass in theElement.BaseClasses)
1653
         foreach(EA.Element baseClass in theElement.BaseClasses)
1665
         {
1654
         {
1666
            sb.Append( baseClass.Name);
1655
            sb.Append( baseClass.Name);
1667
         }
1656
         }
1668
         if (sb.Length > 0)
1657
         if (sb.Length > 0)
1669
         {
1658
         {
1670
            wr = TextUtils.appendAndSelectText("Base Class(es):", EA_Constants.styleName_Body1);
1659
            wr = TextUtils.appendAndSelectText("Base Class(es):", EA_Constants.styleName_Body1_Left_2_5cm_Italic);
1671
            wr.Font.Italic = 1;
-
 
1672
 
1660
 
1673
            wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1661
            wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_3_5cm);
1674
            wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)3.5);
-
 
1675
         }
1662
         }
1676
 
1663
 
1677
         sb = new StringBuilder();
1664
         sb = new StringBuilder();
1678
         foreach(EA.Element intf in theElement.Realizes)
1665
         foreach(EA.Element intf in theElement.Realizes)
1679
         {
1666
         {
1680
            sb.Append( intf.Name);
1667
            sb.Append( intf.Name);
1681
         }
1668
         }
1682
         if (sb.Length > 0)
1669
         if (sb.Length > 0)
1683
         {
1670
         {
1684
            wr = TextUtils.appendAndSelectText("Realises:", EA_Constants.styleName_Body1);
1671
            wr = TextUtils.appendAndSelectText("Realises:", EA_Constants.styleName_Body1_Left_2_5cm_Italic);
1685
            wr.Font.Italic = 1;
-
 
1686
 
1672
 
1687
            wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1673
            wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_3_5cm);
1688
            wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)3.5);
-
 
1689
         }
1674
         }
1690
      }
1675
      }
1691
 
1676
 
1692
      
1677
      
1693
      private void generateClassRequirements( EA.Element theElement, int recurse_level )
1678
      private void generateClassRequirements( EA.Element theElement, int recurse_level )
1694
      {
1679
      {
1695
         StringBuilder sb = new StringBuilder();
1680
         StringBuilder sb = new StringBuilder();
1696
 
1681
 
1697
         sb.Append( "Requirements:" );
1682
         sb.Append( "Requirements:" );
1698
         Word.Range wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1683
         Word.Range wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_2_5cm_Italic);
1699
         wr.Font.Italic = 1;
-
 
1700
 
1684
 
1701
         foreach(EA.Requirement theReq in theElement.Requirements)
1685
         foreach(EA.Requirement theReq in theElement.Requirements)
1702
         {
1686
         {
1703
            sb = new StringBuilder();
1687
            sb = new StringBuilder();
1704
            sb.Append( theReq.Name );
1688
            sb.Append( theReq.Name );
1705
            wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1689
            wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_3_5cm);
1706
            wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)3.5);
-
 
1707
            sb = new StringBuilder();
1690
            sb = new StringBuilder();
1708
            sb.Append( theReq.Notes );
1691
            sb.Append( theReq.Notes );
1709
            if (sb.Length > 0)
1692
            if (sb.Length > 0)
1710
            {
1693
            {
1711
               wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1694
               wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_4_5cm);
1712
               wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)4.5);
-
 
1713
            }
1695
            }
1714
         }
1696
         }
1715
      }
1697
      }
1716
 
1698
 
1717
      
1699
      
1718
      private void generateClassConstraints( EA.Element theElement, int recurse_level )
1700
      private void generateClassConstraints( EA.Element theElement, int recurse_level )
1719
      {
1701
      {
1720
         StringBuilder sb = new StringBuilder();
1702
         StringBuilder sb = new StringBuilder();
1721
 
1703
 
1722
         sb.Append( "Constraints:" );
1704
         sb.Append( "Constraints:" );
1723
         Word.Range wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1705
         Word.Range wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_2_5cm_Italic);
1724
         wr.Font.Italic = 1;
-
 
1725
         
1706
         
1726
         foreach(EA.Constraint theCons in theElement.Constraints)
1707
         foreach(EA.Constraint theCons in theElement.Constraints)
1727
         {
1708
         {
1728
            sb = new StringBuilder();
1709
            sb = new StringBuilder();
1729
            sb.Append( theCons.Type );
1710
            sb.Append( theCons.Type );
1730
            sb.Append( ": {" );
1711
            sb.Append( ": {" );
1731
            sb.Append( theCons.Name );
1712
            sb.Append( theCons.Name );
1732
            sb.Append( "}" );
1713
            sb.Append( "}" );
1733
 
1714
 
1734
            wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1715
            wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_3_5cm);
1735
            wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)3.5);
-
 
1736
 
1716
 
1737
            if (theCons.Notes.Length > 0)
1717
            if (theCons.Notes.Length > 0)
1738
            {
1718
            {
1739
               sb = new StringBuilder();
1719
               sb = new StringBuilder();
1740
               sb.Append( theCons.Notes );
1720
               sb.Append( theCons.Notes );
1741
               wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1);
1721
               wr = TextUtils.appendAndSelectText(sb.ToString(), EA_Constants.styleName_Body1_Left_4_5cm);
1742
               wr.ParagraphFormat.LeftIndent = WordApp.CentimetersToPoints((float)4.5);
-
 
1743
            }
1722
            }
1744
         }
1723
         }
1745
      }
1724
      }
1746
 
1725
 
1747
 
1726
 
1748
      private void generateElementContent( EA.Element theElement, int recurse_level )
1727
      private void generateElementContent( EA.Element theElement, int recurse_level )
1749
      {
1728
      {
1750
         // track recursion level to control heading style formatting requirements
1729
         // track recursion level to control heading style formatting requirements
1751
         if (oneShot_skipRootElementHeading == false)
1730
         if (oneShot_skipRootElementHeading == false)
1752
            recurse_level++;
1731
            recurse_level++;
1753
         if (recurse_level > 9)
-
 
1754
         {
-
 
1755
            throw new System.StackOverflowException("Max Recursion Depth (9) Exceeded" );
-
 
1756
         }
-
 
1757
 
1732
 
1758
         if (EA_Utils.options.elementTypeFoundInEA_DocGen( theElement.Type ))
1733
         if (EA_Utils.options.elementTypeFoundInEA_DocGen( theElement.Type ))
1759
         {
1734
         {
1760
            // pass the element to the requirement element serialisation function. It
1735
            // pass the element to the requirement element serialisation function. It
1761
            // will tell us if it did anything with it. If not, then carry out the default
1736
            // will tell us if it did anything with it. If not, then carry out the default
Line 1770... Line 1745...
1770
               {
1745
               {
1771
                  // do nothing
1746
                  // do nothing
1772
               }
1747
               }
1773
               else
1748
               else
1774
               {
1749
               {
-
 
1750
                  if (recurse_level > EA_Constants.MAX_HEADING_LEVEL)
-
 
1751
                  {
-
 
1752
                     throw new System.StackOverflowException(EA_Constants.maxRecursionDepthException);
-
 
1753
                  }
-
 
1754
 
1775
                  trackDocSection(recurse_level);
1755
                  trackDocSection(recurse_level);
1776
                  displayProgress( "ELEMENT: ", theElement.Name );
1756
                  displayProgress( "ELEMENT: ", theElement.Name );
1777
 
1757
 
-
 
1758
                  // Determine if element is filtered out by a NO_DOC tagged value
-
 
1759
                  // Having written this code, I realised it might be a bad idea to let users filter out
-
 
1760
                  // elements by tagged values. The reason is, if that content is not in a document model
-
 
1761
                  // but in a design model, then it might be used by >1 document model made by different
-
 
1762
                  // users, so one users choice of filtering might not suit another users. The only way we 
-
 
1763
                  // could get this to work is if the tagged values were somehow made specific to a document
-
 
1764
                  // model, but how do you do this? GUIDs are the only safe way to key to something but we
-
 
1765
                  // dont want every tagged value key to contain a GUID do we?
-
 
1766
//                  bool noDocGen = false;
-
 
1767
//                  string str_noDocGen = EA_Utils.ReadTag(theElement, "NO_DOC");
-
 
1768
//                  if (str_noDocGen.Length > 0)
-
 
1769
//                  {
-
 
1770
//                     str_noDocGen = str_noDocGen.ToLower();
-
 
1771
//                     if (str_noDocGen.CompareTo("true"))
-
 
1772
//                     {
-
 
1773
//                        noDocGen = true;
-
 
1774
//                        displayProgress( "FILTERED: ", theElement.Type );
-
 
1775
//                        oneShot_skipRootElementHeading = false;
-
 
1776
//                        return;
-
 
1777
//                     }
-
 
1778
//                  }                     
-
 
1779
 
1778
                  // disarm the one-shot element (heading) skipping feature if it was armed, and 
1780
                  // disarm the one-shot element (heading) skipping feature if it was armed, and 
1779
                  // by-pass the code to generate a new heading level for the element
1781
                  // by-pass the code to generate a new heading level for the element
1780
                  if (oneShot_skipRootElementHeading == false)
1782
                  if (oneShot_skipRootElementHeading == false)
1781
                  {
1783
                  {
1782
                     // Default element serialisation
1784
                     // Default element serialisation
Line 1994... Line 1996...
1994
         {
1996
         {
1995
            recurse_level++;
1997
            recurse_level++;
1996
            trackDocSection(recurse_level);
1998
            trackDocSection(recurse_level);
1997
         }
1999
         }
1998
 
2000
 
1999
         if (recurse_level > 9)
2001
         if (recurse_level > EA_Constants.MAX_HEADING_LEVEL)
2000
         {
2002
         {
2001
            throw new System.StackOverflowException("Max Recursion Depth (9) Exceeded" );
2003
            throw new System.StackOverflowException(EA_Constants.maxRecursionDepthException );
2002
         }
2004
         }
2003
 
2005
 
2004
         // If we have reached a "Detailed Design" section, we should begin to capture in a list, all public 
2006
         // If we have reached a "Detailed Design" section, we should begin to capture in a list, all public 
2005
         // classes so that we know later on what classes need to be considered in the unit testing section
2007
         // classes so that we know later on what classes need to be considered in the unit testing section
2006
         // of the document, assuming that this is a s/w design document being generated ofcoarse. 
2008
         // of the document, assuming that this is a s/w design document being generated ofcoarse. 
Line 2104... Line 2106...
2104
 
2106
 
2105
            // If the input template does not contain the styles needed for requirement documents, 
2107
            // If the input template does not contain the styles needed for requirement documents, 
2106
            // programmatically create them just in case.
2108
            // programmatically create them just in case.
2107
            StyleUtils.createRequirementStylesIfNecessary();
2109
            StyleUtils.createRequirementStylesIfNecessary();
2108
 
2110
 
-
 
2111
            StyleUtils.createElementDetailsStyles();
-
 
2112
 
2109
            // Parse EA_DocGen Document Model. The parent package is the document model itself
2113
            // Parse EA_DocGen Document Model. The parent package is the document model itself
2110
            // and the packages within it are the top level packages only.
2114
            // and the packages within it are the top level packages only.
2111
            // Question: do we have to parse diagrams and elements at this top level? So far,
2115
            // Question: do we have to parse diagrams and elements at this top level? So far,
2112
            // this has been found to be unecessary, but you never know. For now, dont do it.
2116
            // this has been found to be unecessary, but you never know. For now, dont do it.
2113
            foreach(EA.Package thePackage in EA_ParentPackage.Packages)
2117
            foreach(EA.Package thePackage in EA_ParentPackage.Packages)
Line 2145... Line 2149...
2145
               ref nothing, ref nothing, ref nothing);
2149
               ref nothing, ref nothing, ref nothing);
2146
 
2150
 
2147
            // Tell user the process completed ok
2151
            // Tell user the process completed ok
2148
            textBox_progress.AppendText( "---Completed---" );
2152
            textBox_progress.AppendText( "---Completed---" );
2149
            MessageBox.Show("Document Generation Complete");
2153
            MessageBox.Show("Document Generation Complete");
-
 
2154
 
-
 
2155
            button_view_output.Enabled = true;
2150
         }
2156
         }
2151
         catch (Exception createTheWordDoc_exception)
2157
         catch (Exception createTheWordDoc_exception)
2152
         {
2158
         {
2153
            MessageBox.Show("Document Generation Failed\n\n" + createTheWordDoc_exception.Message);
2159
            MessageBox.Show("Document Generation Failed\n\n" + createTheWordDoc_exception.Message);
2154
         }
2160
         }