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 AddPrompts(PlayShadow shadow, XmlElement parentElement)
        {
            Table table = shadow.GetPrompts();

            if (table.IsEmpty())
            {
                return;
            }

            XmlElement promptListElement = CreateElement(parentElement, xmlStrings.PromptList);

            for (int r = 0; r < table.GetNumRows(); r++)
            {
                string condition = table.GetData(r, (int)TableColumns.Prompts.Condition);

                XmlElement promptElement = CreateElement(promptListElement, xmlStrings.Prompt);
                if (condition.Length > 0)
                {
                    XmlElement conditionElement = CreateElement(promptElement, xmlStrings.Condition);
                    int        level            = Common.GetConditionLevel(condition);
                    condition = condition.Replace(Strings.IndentCharacterString, "");
                    CreateCDataSection(conditionElement, condition);
                    conditionElement.SetAttribute(xmlStrings.Level, level.ToString());
                }
                XmlElement wordingElement  = CreateElement(promptElement, xmlStrings.Wording);
                XmlElement promptIdElement = CreateElement(promptElement, xmlStrings.PromptId);

                string wording = Common.StripBracketLabels(table.GetData(r, (int)TableColumns.Prompts.Wording));
                CreateCDataSection(wordingElement, wording);

                string promptId = table.GetData(r, (int)TableColumns.Prompts.Id);
                promptIdElement.InnerText = promptId;
            }
        }
Example #3
0
        private static void AddPrompts(PlayShadow shadow, XmlElement parentElement)
        {
            Table table = shadow.GetPrompts();
            if (table.IsEmpty())
                return;

            XmlElement promptListElement = CreateElement(parentElement, xmlStrings.PromptList);

            for (int r = 0; r < table.GetNumRows(); r++) {
                string condition = table.GetData(r, (int)TableColumns.Prompts.Condition);

                XmlElement promptElement = CreateElement(promptListElement, xmlStrings.Prompt);
                if (condition.Length > 0) {
                    XmlElement conditionElement = CreateElement(promptElement, xmlStrings.Condition);
                    int level = Common.GetConditionLevel(condition);
                    condition = condition.Replace(Strings.IndentCharacterString, "");
                    CreateCDataSection(conditionElement, condition);
                    conditionElement.SetAttribute(xmlStrings.Level, level.ToString());
                }
                XmlElement wordingElement = CreateElement(promptElement, xmlStrings.Wording);
                XmlElement promptIdElement = CreateElement(promptElement, xmlStrings.PromptId);

                string wording = Common.StripBracketLabels(table.GetData(r, (int)TableColumns.Prompts.Wording));
                CreateCDataSection(wordingElement, wording);

                string promptId = table.GetData(r, (int)TableColumns.Prompts.Id);
                promptIdElement.InnerText = promptId;
            }
        }
        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);
        }