示例#1
0
        private void SubDialogForm_Load(object sender, EventArgs e)
        {
            Table table;

            // State Name
            string stateId = shadow.GetStateId();

            CommonForm.LoadStateIdTextBoxes(statePrefixTextBox, stateNumberTextBox, stateNameTextBox, stateId);

            // Developer Notes
            table = shadow.GetDeveloperNotes();
            CommonForm.LoadDeveloperNotesTextBox(developerNotesTextBox, table);


            // Design Notes
            table = shadow.GetDesignNotes();
            CommonForm.LoadDesignNotesTextBox(designNotesTextBox, table);

            statePrefixTextBox.Focus();
        }
示例#2
0
        private static void AddSubDialogElement(XmlDocument xmlDoc, SubDialogShadow shadow)
        {
            XmlElement stateElement = CreateElement(xmlDoc.DocumentElement, xmlStrings.SubDialog);

            stateElement.SetAttribute(xmlStrings.StateId, shadow.GetStateId());

            XmlElement startingStateElement = CreateElement(stateElement, xmlStrings.StartingState);

            Shadow targetShadow = shadow.GetFirstStateTarget();

            if (targetShadow == null)
            {
                startingStateElement.InnerText = Strings.DisconnectedConnectorTarget;
            }
            else
            {
                startingStateElement.InnerText = targetShadow.GetGotoName();
            }

            AddReturnList(shadow, stateElement);
            AddDeveloperNotes(shadow.GetDeveloperNotes(), stateElement);
        }
        private static void AddSubDialogTable(Document doc, SubDialogShadow subDialogShadow)
        {
            Selection content = doc.Application.Selection;

            doc.Tables[Templates.SubDialog].Range.Copy();
            content.Bookmarks.Add("bm" + Left(AlphaNumericCharsOnly(subDialogShadow.GetStateId()), 38));
            content.Move(WdUnits.wdStory);
            content.Paste();

            Microsoft.Office.Interop.Word.Table wordTable = doc.Tables[doc.Tables.Count];

            wordTable.Range.ParagraphFormat.KeepWithNext = -1;
            wordTable.Cell(1, 1).Range.InsertAfter(subDialogShadow.GetStateId());

            string tmp = CachedGetGotoName(subDialogShadow);

            Cell cell = wordTable.Cell(7, 1);
            Table table = subDialogShadow.GetDeveloperNotes();
            if (!table.IsEmpty()) {
                string notes = table.GetData(0, (int)TableColumns.DeveloperNotes.Text);
                string notesDate = table.GetData(0, (int)TableColumns.DeveloperNotes.TextDateStamp);
                cell.Range.InsertAfter(notes);
                SetCellBackgroundColorIfNecessary(cell, notesDate);
            }

            cell = wordTable.Cell(5, 1);
            string startState = CachedGetGotoName(subDialogShadow.GetFirstStateTarget());
            content.InsertAfter(startState);
            content.set_Style("Hyperlink");
            content.Hyperlinks.Add(Anchor: content.Range, SubAddress: "bm" + Left(AlphaNumericCharsOnly(startState), 38));
            content.Move(WdUnits.wdStory);
            content.MoveStart(WdUnits.wdParagraph, -1);
            content.Cut();
            cell.Range.Paste();

            List<SubDialogShadow.ReturnPair> pairs = subDialogShadow.GetReturnPairs();
            InsertWordTableRows(wordTable, 3, pairs.Count - 1);
            for (int i = 0; i < pairs.Count; i++) {
                cell = wordTable.Cell(i + 3, 1);
                string prev = CachedGetGotoName(pairs[i].PreviousState);
                content.InsertAfter(prev);
                content.set_Style("Hyperlink");
                content.Hyperlinks.Add(Anchor: content.Range, SubAddress: "bm" + Left(AlphaNumericCharsOnly(prev), 38));
                content.Move(WdUnits.wdStory);
                content.MoveStart(WdUnits.wdParagraph, -1);
                content.Cut();
                cell.Range.Paste();

                cell = wordTable.Cell(i + 3, 2);
                cell.Range.InsertAfter(CachedGetGotoName(pairs[i].Return));
                string next = CachedGetGotoName(pairs[i].Return);
                content.InsertAfter(next);
                content.set_Style("Hyperlink");
                content.Hyperlinks.Add(Anchor: content.Range, SubAddress: "bm" + Left(AlphaNumericCharsOnly(next), 38));
                content.Move(WdUnits.wdStory);
                content.MoveStart(WdUnits.wdParagraph, -1);
                content.Cut();
                cell.Range.Paste();
            }

            //SetCellBackgroundColorIfNecessary(wordTable.Cell(1, 1), subDialogShadow.GetLastChangeDate());
            SetCellBackgroundColorIfNecessary(wordTable.Cell(1, 1), subDialogShadow.GetLastChangeVersion());//JDK added

            content.Move(WdUnits.wdStory);
            content.set_Style("Normal");
            content.TypeParagraph();
            content.Move(WdUnits.wdStory);
        }
示例#4
0
        private static void AddSubDialogElement(XmlDocument xmlDoc, SubDialogShadow shadow)
        {
            XmlElement stateElement = CreateElement(xmlDoc.DocumentElement, xmlStrings.SubDialog);
            stateElement.SetAttribute(xmlStrings.StateId, shadow.GetStateId());

            XmlElement startingStateElement = CreateElement(stateElement, xmlStrings.StartingState);

            Shadow targetShadow = shadow.GetFirstStateTarget();
            if (targetShadow == null)
                startingStateElement.InnerText = Strings.DisconnectedConnectorTarget;
            else
                startingStateElement.InnerText = targetShadow.GetGotoName();

            AddReturnList(shadow, stateElement);
            AddDeveloperNotes(shadow.GetDeveloperNotes(), stateElement);
        }