Exemplo n.º 1
0
        static void TestList()
        {
            __opColon__opColon <int> test    = MakeList <int>(new int[] { 5, 3, 2 });
            __opColon__opColon <int> addTest = MakeList <int>(new int[] { 1, 6 });

            length <int> __tmp0 = new length <int>();

            __tmp0.__arg0 = test;
            __tmp0.Run();

            append <int> __tmp1 = new append <int>();

            __tmp1.__arg0 = test;
            __tmp1.__arg1 = addTest;
            __tmp1.Run();

            if (__tmp0.__res.HasValue)
            {
                Console.WriteLine(__tmp0.__res.Value);
            }
            else
            {
                Console.WriteLine("The rule has failed its evaluation");
            }

            if (__tmp1.__res.HasValue)
            {
                Console.WriteLine(__tmp1.__res.Value);
            }
            else
            {
                Console.WriteLine("The rule has failed its evaluation");
            }
        }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            string ret           = "OK";
            append test1         = new append();
            string reporter      = "Test Id";
            string productSN     = "AllFit";
            string propertyName  = "volt";
            string propertyValue = "100";
            string Ext           = "Ext";
            string Time          = DateTime.Now.ToString("u");

            string problemType = "Unk ";

            Sql_config.InitDataBase();
            int index = comboBox1.SelectedIndex;

            switch (index)
            {
            case 3:
                for (int idx = 0; idx < 10; idx++)
                {
                    try
                    {
                        reporter      += idx.ToString();
                        productSN     += idx.ToString();
                        propertyName  += idx.ToString();
                        propertyValue += idx.ToString();
                        Ext           += idx.ToString();

                        ret = test1.NewData(reporter, productSN, propertyName, propertyValue, Ext, Time);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                }
                break;

            case 0:
                for (int idx = 0; idx < 10; idx++)
                {
                    try
                    {
                        reporter  += idx.ToString();
                        productSN += idx.ToString();
                        Ext       += idx.ToString();
                        ret        = test1.ErrNotify(reporter, problemType, Ext, Time);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                }
                break;

            case 1:
                for (int idx = 0; idx < 10; idx++)
                {
                    try
                    {
                        reporter  += idx.ToString();
                        productSN += idx.ToString();
                        Ext       += idx.ToString();
                        // (string reporter, string productSN, string Ext, string Time)
                        ret = test1.ErrNotify(reporter, problemType, Ext, Time);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                }
                break;
            }
            MessageBox.Show(ret);
        }
Exemplo n.º 3
0
			: base(GetHandle(fileName, forWriting, append), forWriting ? FileAccess.Write : FileAccess.Read, true)