Пример #1
0
        private void NewFile()
        {
            operaterecordMgr = new OperateRecordManager();
            Map map = new Map(operaterecordMgr);

            map.ShowDialog();
            if (operaterecordMgr != null && operaterecordMgr.OperateList.Count > 0)
            {
                this.ContentTextBox.Text = commandMgr.Render(operaterecordMgr);
            }
        }
Пример #2
0
        public DialogType(OperateRecordManager operateRecordManager, int pageIndex, int commandIndex, string prevCommand, int preUniqueId)
        {
            InitializeComponent();
            this.operateRecordManager = operateRecordManager;
            this.PageIndex            = pageIndex;
            this.CommandIndex         = commandIndex;
            this.prevCommand          = prevCommand;
            this.PreUniqueId          = preUniqueId;

            BindDialogDropDownList();
        }
        public OptionDialog(OperateRecordManager operateRecordManager, int pageIndex, int commandIndex, string prevCommand, int preUniqueId)
        {
            InitializeComponent();
            this.operateRecordManager = operateRecordManager;
            this.PageIndex            = pageIndex;
            this.CommandIndex         = commandIndex;
            this.prevCommand          = prevCommand;
            this.PreUniqueId          = preUniqueId;
            this.UniqueId             = UniqueIdManager.Create();

            OptionCommand = operateRecordManager.AddOptionCommand(this.PageIndex, this.CommandIndex, this.Rule.Text, this.Comment.Text, prevCommand, preUniqueId, UniqueId);
        }
        public static Form Create(OperateRecordManager operateRecordManager, int typeId, int pageIndex, int commandIndex, string prevCommand, int preUniqueId)
        {
            switch (typeId)
            {
            case 1:
                return(new MessageDialog(operateRecordManager, pageIndex, commandIndex, prevCommand, preUniqueId));

            case 2:
                return(new OptionDialog(operateRecordManager, pageIndex, commandIndex, prevCommand, preUniqueId));

            case 3:
                return(new ItemDialog(operateRecordManager, pageIndex, commandIndex, prevCommand, preUniqueId));

            case 4:
                operateRecordManager.AddCloseCommand(pageIndex, commandIndex, prevCommand, preUniqueId);
                return(null);

            default:
                return(new MessageDialog(operateRecordManager, pageIndex, commandIndex, prevCommand, preUniqueId));
            }
        }
Пример #5
0
        public void RenderTest()
        {
            CommandManager       target = new CommandManager();                     // TODO: Initialize to an appropriate value
            OperateRecordManager operateRecordManager = new OperateRecordManager(); // TODO: Initialize to an appropriate value

            operateRecordManager.NpcId   = 1;
            operateRecordManager.NpcKey  = "npc_test";
            operateRecordManager.SceneId = 1;
            MessageDialogInfo messageDialogInfo = new MessageDialogInfo();

            messageDialogInfo.Comment = "test";
            MessageCommand messageCommand = new MessageCommand();

            messageCommand.PageIndex         = 1;
            messageCommand.CommandIndex      = 1;
            messageCommand.messageDialogInfo = messageDialogInfo;
            operateRecordManager.OperateList.Add(messageCommand);
            string expected = string.Empty; // TODO: Initialize to an appropriate value
            string actual;

            actual = target.Render(operateRecordManager);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Пример #6
0
 public Map(OperateRecordManager operateRecordManager)
 {
     InitializeComponent();
     this.OperateRecordManager = operateRecordManager;
     BindMapDropDownList();
 }