Exemple #1
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;
            }
        }
Exemple #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);
        }
 public DialogResult ShowDialog(PlayShadow shadow)
 {
     this.shadow = shadow;
     return ShowDialog();
 }
Exemple #4
0
 public DialogResult ShowDialog(PlayShadow shadow)
 {
     this.shadow = shadow;
     return(ShowDialog());
 }
        // Creates a shadow from a shape.  Should only be called from PathMaker
        // event handlers when things are loaded, added, etc.
        public static Shadow MakeShapeShadow(Shape shape)
        {
            ShapeTypes shapeType = Common.GetShapeType(shape);
            Shadow shadow = null;

            switch (shapeType) {
                case ShapeTypes.CallSubDialog:
                    shadow = new CallSubDialogShadow(shape);
                    break;
                case ShapeTypes.ChangeLog:
                    shadow = new ChangeLogShadow(shape);
                    break;
                case ShapeTypes.AppDesc:
                    shadow = new AppDescShadow(shape);
                    break;
                case ShapeTypes.PrefixList:
                    shadow = new PrefixListShadow(shape);
                    break;
                case ShapeTypes.Comment:
                    shadow = new IgnoredShadow(shape);
                    break;
                case ShapeTypes.Connector:
                    shadow = new ConnectorShadow(shape);
                    break;
                case ShapeTypes.Data:
                    shadow = new DataShadow(shape);
                    break;
                case ShapeTypes.Decision:
                    shadow = new DecisionShadow(shape);
                    break;
                case ShapeTypes.DocTitle:
                    shadow = new DocTitleShadow(shape);
                    break;
                case ShapeTypes.HangUp:
                    shadow = new HangUpShadow(shape);
                    break;
                case ShapeTypes.Interaction:
                    shadow = new InteractionShadow(shape);
                    break;
                case ShapeTypes.None:
                    break;
                case ShapeTypes.OffPageRef:
                    shadow = new OffPageRefShadow(shape);
                    break;
                case ShapeTypes.OnPageRefIn:
                    shadow = new OnPageRefInShadow(shape);
                    break;
                case ShapeTypes.OnPageRefOut:
                    shadow = new OnPageRefOutShadow(shape);
                    break;
                case ShapeTypes.Page:
                    break;
                case ShapeTypes.Placeholder:
                    shadow = new IgnoredShadow(shape);
                    break;
                case ShapeTypes.Play:
                    shadow = new PlayShadow(shape);
                    break;
                case ShapeTypes.Return:
                    shadow = new ReturnShadow(shape);
                    break;
                case ShapeTypes.Start:
                    shadow = new StartShadow(shape);
                    break;
                case ShapeTypes.SubDialog:
                    shadow = new SubDialogShadow(shape);
                    break;
                case ShapeTypes.Transfer:
                    shadow = new TransferShadow(shape);
                    break;
            }
            return shadow;
        }
        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);
        }
Exemple #7
0
        // Creates a shadow from a shape.  Should only be called from PathMaker
        // event handlers when things are loaded, added, etc.
        public static Shadow MakeShapeShadow(Shape shape)
        {
            ShapeTypes shapeType = Common.GetShapeType(shape);
            Shadow     shadow    = null;

            switch (shapeType)
            {
            case ShapeTypes.CallSubDialog:
                shadow = new CallSubDialogShadow(shape);
                break;

            case ShapeTypes.ChangeLog:
                shadow = new ChangeLogShadow(shape);
                break;

            case ShapeTypes.AppDesc:
                shadow = new AppDescShadow(shape);
                break;

            case ShapeTypes.PrefixList:
                shadow = new PrefixListShadow(shape);
                break;

            case ShapeTypes.Comment:
                shadow = new IgnoredShadow(shape);
                break;

            case ShapeTypes.Connector:
                shadow = new ConnectorShadow(shape);
                break;

            case ShapeTypes.Data:
                shadow = new DataShadow(shape);
                break;

            case ShapeTypes.Decision:
                shadow = new DecisionShadow(shape);
                break;

            case ShapeTypes.DocTitle:
                shadow = new DocTitleShadow(shape);
                break;

            case ShapeTypes.HangUp:
                shadow = new HangUpShadow(shape);
                break;

            case ShapeTypes.Interaction:
                shadow = new InteractionShadow(shape);
                break;

            case ShapeTypes.None:
                break;

            case ShapeTypes.OffPageRef:
                shadow = new OffPageRefShadow(shape);
                break;

            case ShapeTypes.OnPageRefIn:
                shadow = new OnPageRefInShadow(shape);
                break;

            case ShapeTypes.OnPageRefOut:
                shadow = new OnPageRefOutShadow(shape);
                break;

            case ShapeTypes.Page:
                break;

            case ShapeTypes.Placeholder:
                shadow = new IgnoredShadow(shape);
                break;

            case ShapeTypes.Play:
                shadow = new PlayShadow(shape);
                break;

            case ShapeTypes.Return:
                shadow = new ReturnShadow(shape);
                break;

            case ShapeTypes.Start:
                shadow = new StartShadow(shape);
                break;

            case ShapeTypes.SubDialog:
                shadow = new SubDialogShadow(shape);
                break;

            case ShapeTypes.Transfer:
                shadow = new TransferShadow(shape);
                break;
            }
            return(shadow);
        }
        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 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;

            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);
        }