Example #1
0
        private void PlayForm_Load(object sender, EventArgs e)
        {
            Table table;

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

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

            // Initialize Prompts
            table = shadow.GetPrompts();
            CommonForm.LoadPromptDataGridView(promptsDataGridView, table);

            // Initialize Transitions
            table = shadow.GetTransitions();
            CommonForm.LoadTransitionDataGridView(transitionsDataGridView, table);

            // Special Settings
            table = shadow.GetSpecialSettings();
            CommonForm.LoadSpecialSettingsTextBox(specialSettingsTextBox, table);

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

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

            statePrefixTextBox.Focus();
        }
Example #2
0
        private static void AddPlayElement(XmlDocument xmlDoc, PlayShadow shadow)
        {
            XmlElement stateElement = CreateElement(xmlDoc.DocumentElement, xmlStrings.Play);

            stateElement.SetAttribute(xmlStrings.StateId, shadow.GetStateId());
            AddEnteringFrom(shadow, stateElement);
            AddPrompts(shadow, stateElement);
            AddTransitions(shadow, stateElement);
            AddSpecialSettings(shadow.GetSpecialSettings(), stateElement);
            AddDeveloperNotes(shadow.GetDeveloperNotes(), stateElement);
        }
Example #3
0
 private static void AddPlayElement(XmlDocument xmlDoc, PlayShadow shadow)
 {
     XmlElement stateElement = CreateElement(xmlDoc.DocumentElement, xmlStrings.Play);
     stateElement.SetAttribute(xmlStrings.StateId, shadow.GetStateId());
     AddEnteringFrom(shadow, stateElement);
     AddPrompts(shadow, stateElement);
     AddTransitions(shadow, stateElement);
     AddSpecialSettings(shadow.GetSpecialSettings(), stateElement);
     AddDeveloperNotes(shadow.GetDeveloperNotes(), stateElement);
 }
        private static void AddPlayTable(Document doc, PlayShadow playShadow)
        {
            Selection content = doc.Application.Selection;

            if (addMSWordMapMarkers)
            {
                content.Font.Name = "Arial";
                content.Font.Size = 2;
                content.Font.Color = WdColor.wdColorWhite;//change this to white late to make it more hidden
                content.TypeText(playShadow.GetStateId());
                content.set_Style(WdBuiltinStyle.wdStyleHeading3);
                content.TypeParagraph();
                content = doc.Application.Selection;//re-read all current content
            }

            doc.Tables[Templates.Play].Range.Copy();
            content.Bookmarks.Add("bm" + Left(AlphaNumericCharsOnly(playShadow.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(playShadow.GetStateId());
            FillEnteringFrom(wordTable.Cell(3, 1), playShadow);

            Cell cell = wordTable.Cell(12, 1);
            Table table = playShadow.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(10, 1);
            table = playShadow.GetSpecialSettings();
            if (!table.IsEmpty()) {
                string settings = table.GetData(0, (int)TableColumns.SpecialSettings.Text);
                string settingsDate = table.GetData(0, (int)TableColumns.SpecialSettings.TextDateStamp);
                cell.Range.InsertAfter(settings);
                SetCellBackgroundColorIfNecessary(cell, settingsDate);
            }

            table = playShadow.GetTransitions();
            FillTransitionTable(wordTable, 8, table);
            table = playShadow.GetPrompts();
            FillPromptTable(wordTable, 6, table);

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

            content.Move(WdUnits.wdStory);
            content.set_Style("Normal");
            content.TypeParagraph();
            content.Move(WdUnits.wdStory);
        }
Example #5
0
        private static void AddPlayTable(Document doc, PlayShadow playShadow)
        {
            Selection content = doc.Application.Selection;

            doc.Tables[Templates.Play].Range.Copy();
            content.Bookmarks.Add("bm" + Left(AlphaNumericCharsOnly(playShadow.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(playShadow.GetStateId());
            FillEnteringFrom(wordTable.Cell(3, 1), playShadow);

            Cell cell = wordTable.Cell(12, 1);
            Table table = playShadow.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(10, 1);
            table = playShadow.GetSpecialSettings();
            if (!table.IsEmpty()) {
                string settings = table.GetData(0, (int)TableColumns.SpecialSettings.Text);
                string settingsDate = table.GetData(0, (int)TableColumns.SpecialSettings.TextDateStamp);
                cell.Range.InsertAfter(settings);
                SetCellBackgroundColorIfNecessary(cell, settingsDate);
            }

            table = playShadow.GetTransitions();
            FillTransitionTable(wordTable, 8, table);
            table = playShadow.GetPrompts();
            FillPromptTable(wordTable, 6, table);

            SetCellBackgroundColorIfNecessary(wordTable.Cell(1, 1), playShadow.GetLastChangeDate());

            content.Move(WdUnits.wdStory);
            content.set_Style("Normal");
            content.TypeParagraph();
            content.Move(WdUnits.wdStory);
        }