Exemple #1
0
            } // Dispose

            private void ProcessSegments()
            {
                byte[] payload;

                while ((payload = GetNextSegment()) != null)
                {
                    try
                    {
                        var item     = XmlSerialization.Deserialize <TvaMain>(payload, trimExtraWhitespace: true, namespaceReplacer: NamespaceUnification.Replacer);
                        var schedule = item?.ProgramDescription?.LocationTable?.Schedule;
                        if (schedule == null)
                        {
                            // TODO: log
                            continue;
                        } // if
                        var epgService = EpgService.FromSchedule(schedule);
                        ScheduleReceived?.Invoke(this, EventArgs.Empty);
                        _datastore.Add(epgService);
                    }
                    catch (Exception ex)
                    {
                        ParseError?.Invoke(this, EventArgs.Empty);
#if DEBUG
                        // TODO: log
                        Console.WriteLine("Unable to parse: {0}", ex.Message);
#endif
                        return;
                    } // try-catch
                }     // while

                _processSegmentsEnded.Set();
            } // ProcessSegments
        private async void Edit_Tapped(object sender, EventArgs e)
        {
            Console.WriteLine("***************Edit_Tapped**************");
            //   return;
            if (isEditMode)
            {
                await navigation.PushAsync(new ConfigurationSettingPage(uIDays, scheduleOperation, indexText, SelectedStartTime, SelectedStopTime, SelectedIntervsl, isActive, rawSchedules));

                return;

                AnimationHelper.Instance.AnimationInvisible(schduleView, schduleView.HeightRequest);
                AnimationHelper.Instance.AnimationVisible(expandView, 125);
            }
            else
            {
                return;

                AnimationHelper.Instance.AnimationInvisible(expandView, expandView.HeightRequest);
                AnimationHelper.Instance.AnimationVisible(schduleView, 40);
                ScheduleReceived.Invoke(uIDays, indexText, new TimeSpan(SelectedStartTime.Ticks), new TimeSpan(SelectedStopTime.Ticks), SelectedIntervsl, isActive);
                SetInterval();
            }
        }
 void Toggle_Toggled(System.Object sender, Xamarin.Forms.ToggledEventArgs e)
 {
     ScheduleReceived.Invoke(uIDays, indexText, new TimeSpan(SelectedStartTime.Ticks), new TimeSpan(SelectedStopTime.Ticks), SelectedIntervsl, e.Value);
 }