Exemplo n.º 1
0
        private void updateNews(object sender, EventArgs e)
        {
            XMLReader reader = new XMLReader(@"\\192.168.0.116\c$\Surable\DataServer\XML\News.xml");

            _NoticeData = reader.NewsRead();
            _NoticeText.moveText(_NoticeData);
        }
Exemplo n.º 2
0
        private void updateWeather(object sender, EventArgs e)
        {
            XMLReader weatherReader = new XMLReader(@"C:\Users\User\Documents\카카오톡 받은 파일\DataServer (1)\DataServer\XML\Weather.xml");

            String[] data = weatherReader.WeatherRead();
            _WeatherSub.setWeather(data[0], data[1]);
        }
Exemplo n.º 3
0
        private void LoadXml()
        {
            XmlDocument xml = new XmlDocument();

            xml.Load(_sXmlPath + "Config.xml");

            XmlNodeList xmlList = xml.SelectNodes("/Info");

            foreach (XmlNode xmldata in xmlList)
            {
                string sServer = xmldata["ServerIP"].InnerText;
                _sWebServerDownloadPath = string.Format("http://{0}/img/upload/", sServer);
                _sWebServerPath         = string.Format("http://{0}/contents/client/", sServer);
                _iCaptionTime           = int.Parse(xmldata["CaptionTime"].InnerText);
                _iTextCount             = int.Parse(xmldata["CaptionTextCount"].InnerText);
            }

            XMLReader reader = new XMLReader("C:\\Surable\\DataServer\\XML\\News.xml");
            //_NoticeData = reader.Read();
        }
Exemplo n.º 4
0
        //sScheduleType ==> 스케쥴의 템플릿 레이아웃 수, 레이아웃 번호
        //bSchedule(true) 우선스케쥴
        //bSchedule(false) 기본스케쥴
        private void SetScheduleLayout(string sScheduleType, int iWidth1, int iHeight1, int iWidth2, int iHeight2, int iWidth3, int iHeight3, bool bSchedule)
        {
            try
            {
                /*
                 * JArray jArr = new JArray();
                 *
                 * if (bSchedule)
                 *  jArr = _jArrNow;
                 * else
                 *  jArr = _jArrBasic;
                 */
                this.Controls.Clear();

                double dMaxWidth  = _dWidth;
                double dMaxHeight = _dHeight;
                double dWidth1    = dMaxWidth / 100 * iWidth1;
                double dWidth2    = dMaxWidth / 100 * iWidth2;
                double dWidth3    = dMaxWidth / 100 * iWidth3;
                double dHeight1   = dMaxHeight / 100 * iHeight1;
                double dHeight2   = dMaxHeight / 100 * iHeight2;
                double dHeight3   = dMaxHeight / 100 * iHeight3;

                if (_PlayerInfo.sPlayerType == "ElevDid")
                {
                    //엘베 레이아웃 설정해야됨
                    this.Controls.Add(_ContentsModule1);
                    _ContentsModule1.Location = new System.Drawing.Point(0, 0);
                    _ContentsModule1.Width    = (int)dMaxWidth - 400;
                    _ContentsModule1.Height   = (int)dMaxHeight - 80;
                    _ContentsModule1.ChangeSchedule(_jArrNow, _jArrBasic, 1);

                    double svWidth  = 400;
                    double svHeight = (_ContentsModule1.Height) / 4;

                    //로고
                    _LogoHost.Location  = new Point((int)dMaxWidth - 400, 0);
                    _LogoHost.Width     = (int)svWidth;
                    _LogoHost.Height    = (int)svHeight;
                    _LogoHost.BackColor = Color.White;
                    this.Controls.Add(_LogoHost);
                    _LogoSub.InitializeComponent();
                    _LogoHost.Child = _LogoSub;


                    //주가정보
                    _StockHost.Location  = new Point((int)dMaxWidth - 400, (int)svHeight * 1);
                    _StockHost.Width     = (int)svWidth;
                    _StockHost.Height    = (int)svHeight;
                    _StockHost.BackColor = Color.White;
                    this.Controls.Add(_StockHost);
                    _StockSub.InitializeComponent();
                    _StockHost.Child = _StockSub;

                    //날씨정보
                    _WeatherHost.Location  = new Point((int)dMaxWidth - 400, (int)svHeight * 2);
                    _WeatherHost.Width     = (int)svWidth;
                    _WeatherHost.Height    = (int)svHeight;
                    _WeatherHost.BackColor = Color.White;
                    this.Controls.Add(_WeatherHost);
                    _WeatherSub.InitializeComponent();
                    _WeatherHost.Child = _WeatherSub;

                    etc1.Location  = new Point((int)dMaxWidth - 400, (int)svHeight * 3);
                    etc1.Width     = (int)svWidth;
                    etc1.Height    = (int)svHeight;
                    etc1.BackColor = Color.Blue;
                    this.Controls.Add(etc1);

                    XMLReader weatherReader = new XMLReader(@"\\192.168.0.116\c$\Surable\DataServer\XML\Weather.xml");
                    String[]  data          = weatherReader.WeatherRead();
                    _WeatherSub.setWeather(data[0], data[1]);

                    DispatcherTimer weatherUpdater = new DispatcherTimer();
                    weatherUpdater.Tick    += updateWeather;
                    weatherUpdater.Interval = new TimeSpan(0, 30, 0);
                    weatherUpdater.Start();


                    //뉴스 자막
                    _NewsHost.Location  = new Point(0, (int)dMaxHeight - 100);
                    _NewsHost.Width     = (int)dMaxWidth;
                    _NewsHost.Height    = 100;
                    _NewsHost.BackColor = Color.DodgerBlue;
                    this.Controls.Add(_NewsHost);
                    _NoticeText.InitializeComponent();
                    _NewsHost.Child = _NoticeText;
                    //_NoticeText.setText("카카오 1분기 실적조사 및 계획 발표", dMaxWidth, 3);//_iCaptionTime);
                    XMLReader newsReader = new XMLReader(@"\\192.168.0.116\c$\Surable\DataServer\XML\News.xml");
                    _NoticeData = newsReader.NewsRead();
                    _NoticeText.moveText(_NoticeData);
                    DispatcherTimer newsUpdater = new DispatcherTimer();

                    newsUpdater.Tick    += updateNews;
                    newsUpdater.Interval = new TimeSpan(0, 0, (int)(_NoticeData.Replace(" ", "").Length * 0.4 < 10 ? 15 : _NoticeData.Replace(" ", "").Length * 0.4));
                    newsUpdater.Start();
                }
                else if (_PlayerInfo.sPlayerType == "BasicDid")
                {
                    switch (sScheduleType)
                    {
                    case "1":
                    default:
                        this.Controls.Add(_ContentsModule1);
                        _ContentsModule1.Location = new System.Drawing.Point(0, 0);
                        _ContentsModule1.Width    = (int)dMaxWidth;
                        _ContentsModule1.Height   = (int)dMaxHeight;
                        _ContentsModule1.ChangeSchedule(_jArrNow, _jArrBasic, 1);
                        break;

                    case "2":
                        this.Controls.Add(_ContentsModule1);
                        this.Controls.Add(_ContentsModule2);

                        _ContentsModule1.Location = new System.Drawing.Point(0, 0);
                        _ContentsModule1.Width    = (int)dMaxWidth;
                        _ContentsModule1.Height   = (int)dHeight1;
                        _ContentsModule2.Location = new System.Drawing.Point(0, (int)dHeight1);
                        _ContentsModule2.Width    = (int)dMaxWidth;
                        _ContentsModule2.Height   = (int)dHeight2;
                        _ContentsModule1.ChangeSchedule(_jArrNow, _jArrBasic, 1);
                        _ContentsModule2.ChangeSchedule(_jArrNow, _jArrBasic, 2);
                        break;

                    case "3":
                        this.Controls.Add(_ContentsModule1);
                        this.Controls.Add(_ContentsModule2);

                        _ContentsModule1.Location = new System.Drawing.Point(0, 0);
                        _ContentsModule1.Width    = (int)dWidth1;
                        _ContentsModule1.Height   = (int)dMaxHeight;
                        _ContentsModule2.Location = new System.Drawing.Point((int)dWidth1, 0);
                        _ContentsModule2.Width    = (int)dWidth2;
                        _ContentsModule2.Height   = (int)dMaxHeight;
                        _ContentsModule1.ChangeSchedule(_jArrNow, _jArrBasic, 1);
                        _ContentsModule2.ChangeSchedule(_jArrNow, _jArrBasic, 2);
                        break;

                    case "4":
                        this.Controls.Add(_ContentsModule1);
                        this.Controls.Add(_ContentsModule2);
                        this.Controls.Add(_ContentsModule3);

                        _ContentsModule1.Location = new System.Drawing.Point(0, 0);
                        _ContentsModule1.Width    = (int)dWidth1;
                        _ContentsModule1.Height   = (int)dMaxHeight;
                        _ContentsModule2.Location = new System.Drawing.Point((int)dWidth1, 0);
                        _ContentsModule2.Width    = (int)dWidth2;
                        _ContentsModule2.Height   = (int)dHeight2;
                        _ContentsModule3.Location = new System.Drawing.Point((int)dWidth2, (int)dHeight2);
                        _ContentsModule3.Width    = (int)dWidth3;
                        _ContentsModule3.Height   = (int)dHeight3;
                        _ContentsModule1.ChangeSchedule(_jArrNow, _jArrBasic, 1);
                        _ContentsModule2.ChangeSchedule(_jArrNow, _jArrBasic, 2);
                        _ContentsModule3.ChangeSchedule(_jArrNow, _jArrBasic, 3);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                _Log.Error("ScheduleLayout Error \r\n", ex);
            }
        }