示例#1
0
        public void AddTest()
        {
            var list = new MessageContainer <RequestMessageBase>(-1);

            //测试不限量添加
            for (int i = 0; i < 1000; i++)
            {
                list.Add(new RequestMessageText()
                {
                    Content = i.ToString()
                });;
            }
            Assert.AreEqual(1000, list.Count);

            //限量
            list.MaxRecordCount = 100;//限量100条
            for (int i = 0; i < 1000; i++)
            {
                list.Add(new RequestMessageText()
                {
                    Content = i.ToString()
                });
            }
            Assert.AreEqual(100, list.Count);
        }
    /// <summary>
    /// Called from a button OnClick event in the example
    /// </summary>
    public void AddMessage()
    {
        //Get a random MessageOption from the array
        MessageOptions option = options[Random.Range(0, options.Length)];

        //Add the message
        messageContainer.Add(option);
    }
示例#3
0
        private static MessageContainer ValidateStyleSheet(StyleSheet styleSheet, QuestionForm astForm)
        {
            var messages = new MessageContainer();

            messages.Add(QLSReferenceChecker.CheckQuestionReferences(styleSheet, astForm));
            if (AnyErrors(messages))
            {
                return(messages);
            }
            messages.Add(QLSTypeChecker.CheckTypes(styleSheet, astForm));
            return(messages);
        }
        public void AddTest()
        {
            var list = new MessageContainer<int>(-1);

            //测试不限量添加
            for (int i = 0; i < 1000; i++)
            {
                list.Add(i);
            }
            Assert.AreEqual(1000, list.Count);

            //限量
            list.MaxRecordCount = 100;//限量100条
            for (int i = 0; i < 1000; i++)
            {
                list.Add(i);
            }
            Assert.AreEqual(100, list.Count);
        }
示例#5
0
        public void AddTest()
        {
            var list = new MessageContainer <int>(-1);

            //测试不限量添加
            for (int i = 0; i < 1000; i++)
            {
                list.Add(i);
            }
            Assert.AreEqual(1000, list.Count);

            //限量
            list.MaxRecordCount = 100;//限量100条
            for (int i = 0; i < 1000; i++)
            {
                list.Add(i);
            }
            Assert.AreEqual(100, list.Count);
        }
示例#6
0
        public static MessageContainer ValidateForm(QuestionForm astForm)
        {
            var messages = new MessageContainer();

            messages.Add(QLDuplicateChecker.CheckDuplicates(astForm));
            if (AnyErrors(messages))
            {
                return(messages);
            }
            messages.Add(QLScopeChecker.CheckReferenceScopes(astForm));
            if (AnyErrors(messages))
            {
                return(messages);
            }
            messages.Add(QLCyclicDependencyChecker.CheckForCycles(astForm));
            if (AnyErrors(messages))
            {
                return(messages);
            }
            messages.Add(QLTypeChecker.CheckTypes(astForm));
            return(messages);
        }
示例#7
0
        public override void OnEnter()
        {
            MessageContainer mWindow = UIUtility.Find <MessageContainer> (_name.Value);

            if (mWindow != null)
            {
                MessageOptions settings = new MessageOptions();
                settings.text     = message.Value;
                settings.color    = color.Value;
                settings.duration = duration.Value;
                settings.delay    = delay.Value;
                mWindow.Add(settings);
            }
            Finish();
        }