Example #1
0
 private void CBSersicView_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
 {
     TextUS.Content  = "Загрузка...";
     TextEVR.Content = "Загрузка...";
     try
     {
         System.Data.DataSet Curs = CBServis.GetCursOnDate(System.DateTime.Now);
         TextUS.Content  = Curs.Tables[0].Rows[9].ItemArray[2].ToString();
         TextEVR.Content = Curs.Tables[0].Rows[10].ItemArray[2].ToString();
     }
     catch (Exception)
     {
         TextUS.Content  = "Не доступно";
         TextEVR.Content = TextUS.Content;
     }
 }
Example #2
0
        //private ObservableCollection<RssItem> listViewCollection;
        public MainWindow()
        {
            using (MemoryStream memory = new MemoryStream())
            {
                Properties.Resources.icon.Save(memory);
                memory.Position = 0;
                BitmapImage bitmapImage = new BitmapImage();
                bitmapImage.BeginInit();
                bitmapImage.StreamSource = memory;
                bitmapImage.CacheOption  = BitmapCacheOption.OnLoad;
                bitmapImage.EndInit();
                Icon = bitmapImage;
            }

            string fullPath = AppDomain.CurrentDomain.BaseDirectory;

            InitializeComponent();

            CBServis = new CB.DailyInfoSoapClient();
            try
            {
                System.Data.DataSet Curs = CBServis.GetCursOnDate(System.DateTime.Now);
                TextUS.Content  = Curs.Tables[0].Rows[9].ItemArray[2].ToString();
                TextEVR.Content = Curs.Tables[0].Rows[10].ItemArray[2].ToString();
            }
            catch (Exception)
            {
                TextUS.Content  = "Не доступно";
                TextEVR.Content = TextUS.Content;
            }



            ipDispatcher = "";

            rssChanels = this.LoadChannelsFromFile("RssChannels.bin");
            Logger.Write("загружены из файла rss каналы");
            this.UpdateChannels();
            //listViewCollection = new ObservableCollection<RssItem>(rssChanels[0].Articles);
            lvArticles.ItemsSource = rssChanels[0].Articles;


            // аля неудачная попытка сделать красивый интерфейс
            // create buttons for articles categories
            //for (int i = 0; i < rssChanels.Count; i++)
            //{
            //    var btnCateg = new Button() { Name = "btnCat" + i, Content = rssChanels[i].Category };
            //    btnCateg.Click += RssCateg_Click;
            //    btnCateg.Uid = i.ToString();
            //    btnCateg.Style = this.FindResource("channelBtn") as Style;
            //    CategoryWrap.Children.Add(btnCateg);
            //}

            foreach (RssChannel channel in rssChanels)
            {
                cmbCategoryList.Items.Add(channel.Category);
            }
            cmbCategoryList.SelectedIndex = 0;
            broadCast            = new UDPClient();
            broadCast.onMessage += this.UDP_Receive;
            broadCast.Start();
            Logger.Write("запущен поток на прослушку UDP");
        }
Example #3
0
        //private ObservableCollection<RssItem> listViewCollection;
        public MainWindow()
        {
            using (MemoryStream memory = new MemoryStream())
            {
                Properties.Resources.icon.Save(memory);
                memory.Position = 0;
                BitmapImage bitmapImage = new BitmapImage();
                bitmapImage.BeginInit();
                bitmapImage.StreamSource = memory;
                bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
                bitmapImage.EndInit();
                Icon = bitmapImage;
            }
            
            string fullPath = AppDomain.CurrentDomain.BaseDirectory;
            InitializeComponent();
            
            CBServis = new CB.DailyInfoSoapClient();
            try
            {
                System.Data.DataSet Curs = CBServis.GetCursOnDate(System.DateTime.Now);
                TextUS.Content = Curs.Tables[0].Rows[9].ItemArray[2].ToString();
                TextEVR.Content = Curs.Tables[0].Rows[10].ItemArray[2].ToString();
            }
            catch (Exception )
            {
                TextUS.Content = "Не доступно";
                TextEVR.Content = TextUS.Content;


            }



            ipDispatcher = "";

            rssChanels = this.LoadChannelsFromFile("RssChannels.bin");
            Logger.Write("загружены из файла rss каналы");
            this.UpdateChannels();
            //listViewCollection = new ObservableCollection<RssItem>(rssChanels[0].Articles);
            lvArticles.ItemsSource = rssChanels[0].Articles;


            // аля неудачная попытка сделать красивый интерфейс
            // create buttons for articles categories
            //for (int i = 0; i < rssChanels.Count; i++)
            //{
            //    var btnCateg = new Button() { Name = "btnCat" + i, Content = rssChanels[i].Category };
            //    btnCateg.Click += RssCateg_Click;
            //    btnCateg.Uid = i.ToString();
            //    btnCateg.Style = this.FindResource("channelBtn") as Style;
            //    CategoryWrap.Children.Add(btnCateg);
            //}

            foreach (RssChannel channel in rssChanels)
            {
                cmbCategoryList.Items.Add(channel.Category);
            }
            cmbCategoryList.SelectedIndex = 0;
            broadCast = new UDPClient();
            broadCast.onMessage += this.UDP_Receive;
            broadCast.Start();
            Logger.Write("запущен поток на прослушку UDP");
        }