示例#1
0
        public UserOrderProductGrammar()
        {
            this.db  = new UserOrderProductDataSet();
            this.pop = new DatabasePopulator();
            this.pop.Populate(this.db);

            this.ProductionFinished += new EventHandler(UserOrderProductGrammar_ProductionFinished);

            // create rules
            this.addUser         = Rules.Method(new MethodInvoker(this.AddUser));
            this.addOrder        = Rules.Method(new MethodInvoker(this.AddOrder));
            this.addProduct      = Rules.Method(new MethodInvoker(this.AddProduct));
            this.addOrderProduct = Rules.Method(new MethodInvoker(this.AddOrderProduct));

            // guarded rules
            this.guardAddOrder        = Rules.Guard(this.addUser, typeof(InvalidOperationException));
            this.guardAddOrderProduct = Rules.Guard(this.addOrderProduct, typeof(InvalidOperationException));

            this.init = Rules.Seq(this.addUser, this.addProduct, this.addOrder);

            this.StartRule = Rules.Seq(this.init,
                                       Rules.Kleene(
                                           Rules.Alt(
                                               this.addUser,
                                               this.addOrder,
                                               this.addProduct,
                                               this.addOrderProduct
                                               )
                                           )
                                       );
        }
示例#2
0
        public void SetUp()
        {
            this.db  = new UserOrderProductDataSet();
            this.pop = new DatabasePopulator();
            this.pop.Populate(this.db);

            this.users         = this.pop.Tables[this.db.Tables["Users"]];
            this.orders        = this.pop.Tables[this.db.Tables["Orders"]];
            this.products      = this.pop.Tables[this.db.Tables["Products"]];
            this.orderProducts = this.pop.Tables[this.db.Tables["OrderProducts"]];
        }
        public void SetUp()
        {
            this.db = new UserOrderProductDataSet();
            this.pop = new DatabasePopulator();
            this.pop.Populate(this.db);

            this.users=this.pop.Tables[this.db.Tables["Users"]];
            this.orders=this.pop.Tables[this.db.Tables["Orders"]];
            this.products=this.pop.Tables[this.db.Tables["Products"]];
            this.orderProducts=this.pop.Tables[this.db.Tables["OrderProducts"]];
        }
 public void SetUp()
 {
     this.dataSource = new UserOrderProductDataSet();
     this.graph = new DataJoinGraph(DataGraph.Create(this.dataSource));
 }
示例#5
0
 public void SetUp()
 {
     this.dataSource = new UserOrderProductDataSet();
     this.graph      = new DataJoinGraph(DataGraph.Create(this.dataSource));
 }