//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.8009
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace WComp.Beans
{
    using System;
    using WComp.Beans;
    
    [Bean(Category="Basic")]
    public class DisplayMode
    {
    	private int mode = 0;
        #region Property FlowRate
        private string _flowrate;
        public string FlowRate
        {
            get
            {
                return _flowrate;
            }
            set
            {
                _flowrate = value;
            }
        }
        #endregion
        #region Property Timer
        private string _timer;
        public string Timer
        {
            get
            {
                return _timer;
            }
            set
            {
                _timer = value;
            }
        }
        #endregion
        #region Property Quantity
        private string _quantity;
        public string Quantity
        {
            get
            {
                return _quantity;
            }
            set
            {
                _quantity = value;
            }
        }
        #endregion
        public void setDisplay()
        {
        	//mode = (mode+1)%3;
        	switch(mode){
        		case 0:
        			mode = 1;
        			//setFlowRate(_flowrate);
        			break;
        		case 1:
        			mode = 2;
        			//setQuantity(_quantity);
        			break;
        		case 2:
        			mode = 0;
        			//setTimer(_timer);
        			break;
        	}
        }
        public void setFlowRate(string flowRate)
        {
        	if(mode == 0){
        		this._flowrate = flowRate;
        		FirenewLineEvent(_flowrate);
        	}
        }
        public void setTimer(string timer)
        {
        	if(mode == 1){
        		this._timer = timer;
        		FirenewLineEvent(_timer);
        	}
        }
        public void setQuantity(string quantity)
        {
        	if(mode == 2){
        		this._quantity = quantity;
        		FirenewLineEvent(_quantity);
        	}
        }
        public delegate void newLineEventHandler(string value);
        public event newLineEventHandler newLine;
        private void FirenewLineEvent(string value)
        {
            if (newLine != null)
            {
                this.newLine(value);
            }
        }
    }
}
