Exemplo n.º 1
0
 public AppointmentStream(params Calendar[] cals)
 {
     _cals = new List<CalendarInfo>();
     _serializer = new CalendarSerializer();
     foreach (var c in cals)
     {
         Add(c);
     }
 }
Exemplo n.º 2
0
        private void SetInput(SerializerBase ser)
        {
            this.serializer?.Dispose();

            this.serializer     = ser;
            this.edFile.Text    = serializer.FileName;
            this.rbAuto.Enabled = this.rbManual.Enabled = true;
            ser.DataRoot.ApplyCurrentProgramNumbers();
            ser.DataRoot.ValidateAfterLoad();

            // fill source first, so that when a target is selected later, the event handler can pick the best source
            this.comboSource.EditValue = null;
            this.comboSource.Properties.Items.Clear();
            foreach (var list in serializer.DataRoot.ChannelLists)
            {
                if (list.Channels.Count == 0)
                {
                    continue;
                }
                if (!list.IsMixedSourceFavoritesList)
                {
                    this.comboSource.Properties.Items.Add(new ListOption(list, 0, list.ShortCaption));
                }

                if (!serializer.DataRoot.MixedSourceFavorites || list.IsMixedSourceFavoritesList)
                {
                    for (int i = 1; i <= serializer.DataRoot.FavListCount; i++)
                    {
                        this.comboSource.Properties.Items.Add(new ListOption(list, i, list.ShortCaption + " - " + list.GetFavListCaption(i - 1, true)));
                    }
                }
            }

            // select target
            this.comboTarget.EditValue = null;
            this.comboTarget.Properties.Items.Clear();
            foreach (var list in main.DataRoot.ChannelLists)
            {
                if (list.Channels.Count == 0)
                {
                    continue;
                }
                if (list.IsMixedSourceFavoritesList)
                {
                    for (int i = 1; i <= main.DataRoot.FavListCount; i++)
                    {
                        this.comboTarget.Properties.Items.Add(new ListOption(list, i, list.ShortCaption + (i == 0 ? "" : " - " + list.GetFavListCaption(i - 1, true))));
                    }
                }
                else
                {
                    this.comboTarget.Properties.Items.Add(new ListOption(list, 0, list.ShortCaption));
                    if (main.CurrentChannelList == list)
                    {
                        this.comboTarget.SelectedIndex = this.comboTarget.Properties.Items.Count - 1;
                    }
                }
            }
            if (this.comboTarget.SelectedIndex < 0 && this.comboTarget.Properties.Items.Count > 0)
            {
                this.comboTarget.SelectedIndex = 0;
            }


            // detect whether auto-sorting is possible
            this.rbAuto.Enabled = true;
            foreach (var list in main.DataRoot.ChannelLists)
            {
                if (list.Channels.Count == 0 || list.IsMixedSourceFavoritesList)
                {
                    continue;
                }
                this.rbAuto.Enabled &= (serializer.DataRoot.GetChannelList(list.SignalSource)?.SignalSource ?? 0) == list.SignalSource;
            }
            if (this.rbAuto.Enabled)
            {
                this.rbAuto.Checked = true;
            }
            else
            {
                this.rbManual.Checked = true;
            }
        }
Exemplo n.º 3
0
        public RPCFunc(TypeRegistry r, Method method)
        {
            m_method = method;

            m_s = r.GetSerializer <R>();
        }
Exemplo n.º 4
0
 public void Success <R>(R result, SerializerBase <R> s)
 {
     s.Serialize(result, m_formatter);
     m_response.ResultBytes = m_formatter.GetStore().Bytes;
 }
Exemplo n.º 5
0
 public override void Setup(TypeRegistry r)
 {
     m_elementSerializer = (SerializerBase <T>)r.GetSerializer <T>();
 }