Exemplo n.º 1
0
        public Server()
        {
            InitializeComponent();
            _atmStatus = new ATMInfoProvider();
            TcpChannel listenerCh = new TcpChannel();

            ChannelServices.RegisterChannel(listenerCh, true);
            _dataSharer = (DataSharingObject)Activator.GetObject(typeof(DataSharingObject), "tcp://localhost:8090/Server");
            reportTimer.Start();
        }
Exemplo n.º 2
0
        public Monitor()
        {
            InitializeComponent();
            _dataSharer = new DataSharingObject();
            _atmInfo    = Cache.GetInstance()._atmInfo;
            TcpChannel channel = new TcpChannel(8090);

            ChannelServices.RegisterChannel(channel, true);
            RemotingConfiguration.RegisterWellKnownServiceType(typeof(DataSharingObject), "Server", WellKnownObjectMode.SingleCall);
            Cache.Attach(this);
        }
Exemplo n.º 3
0
        private void setAtmCurrentInfo(ATMInfoProvider atmStatus)
        {
            atmStatus.CIM = "OK " + _counter;
            atmStatus.CDM = "OK " + _counter;
            atmStatus.IDC = "OK " + _counter;
            atmStatus.PTR = "OK " + _counter;
            atmStatus.SIU = "OK " + _counter;

            setControlText(this, lb_cdm, atmStatus.CDM);
            setControlText(this, lb_cim, atmStatus.CIM);
            setControlText(this, lb_ptr, atmStatus.PTR);
            setControlText(this, lb_idc, atmStatus.IDC);
            setControlText(this, lb_siu, atmStatus.SIU);
        }
Exemplo n.º 4
0
        public void Notify(ATMInfoProvider infoObj)
        {
            Action action = delegate()
            {
                if (infoObj != null)
                {
                    lb_cim.Text = infoObj.CIM;
                    lb_cdm.Text = infoObj.CDM;
                    lb_idc.Text = infoObj.IDC;
                    lb_ptr.Text = infoObj.PTR;
                    lb_siu.Text = infoObj.SIU;
                }
            };

            this.BeginInvoke(action);
            Console.Beep(865, 44);
        }