예제 #1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            System.Net.ServicePointManager.DefaultConnectionLimit = 1;
            receivedDataObject recDataObj = (receivedDataObject)e.Parameter;            //объект класса receivedDataObject для передачи данных о каналах между страницами

            channelSList   = recDataObj.channelStringList;
            paramsUriSList = recDataObj.uriParamsStringList;
            serverUriPart  = recDataObj.serverUriPart;
            int chosenInd = recDataObj.chosenIndex;

            channelsCBox.SelectedIndex = chosenInd;

            ImageCenterText.Visibility = Visibility.Collapsed;
            streamIsActive             = false;

            fpsList = new List <int>();
            fpsCBox.SelectedValue = defFpsList.DefaultIfEmpty(30).FirstOrDefault();
            try {
                var fps = Convert.ToInt32(paramsUriSList.ElementAt(chosenInd).Split("&fps=")[1]);
                fpsList.Clear();
                foreach (int fpsitem in defFpsList)
                {
                    if (fps >= fpsitem)
                    {
                        fpsList.Add(fpsitem);
                        fpsCBox.SelectedIndex = 0;                      //установить значение в fpsCBox только если макс.FPS не меньше всех значений в defFpsList
                    }
                }
                ;
            }
            catch { StopStream(fpsRespErrorText); }
        }
예제 #2
0
 private void channelsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (serverPartUriTBox.Text.Trim() != "" && (serverPartUriTBox.Text.Trim().IndexOf("http://") == 0 || serverPartUriTBox.Text.Trim().IndexOf("https://") == 0))
     {
         receivedDataObject recDataObj = new receivedDataObject();
         recDataObj.channelStringList   = channelList;
         recDataObj.uriParamsStringList = uriList;
         recDataObj.serverUriPart       = serverPartUriTBox.Text;
         recDataObj.chosenIndex         = channelsListBox.SelectedIndex;
         //if (Frame.CanGoForward)
         //    Frame.GoForward();
         //else
         Frame.Navigate(typeof(StreamPage), recDataObj);
     }
     else
     {
         ShowTemporarilyMessageAsync(streamUriInpErrorMsg, 4000);
         channelsListBox.SelectedIndex = -1;
     }
 }