Example #1
0
        public RegularSchedule(string fileName)
        {
            InitProgramSchedule();

            DigitalProducts       = new List <DigitalProduct>();
            DigitalProductSummary = new DigitalProductSummary();

            Snapshots       = new List <Snapshot.Snapshot>();
            SnapshotSummary = new SnapshotSummary(this);
            Options         = new List <OptionSet>();
            OptionsSummary  = new OptionSummary();

            _scheduleFile = new FileInfo(fileName);
            Load();

            LoadCalendars();
        }
Example #2
0
        public override void Deserialize(XmlNode rootNode)
        {
            base.Deserialize(rootNode);

            var node = rootNode.SelectSingleNode(@"ProgramSchedule");

            if (node != null)
            {
                InitProgramSchedule();
                ProgramSchedule.Deserialize(node);
            }

            node = rootNode.SelectSingleNode(@"WeeklySection");
            if (node != null && SelectedSpotType == SpotType.Week)
            {
                InitProgramSchedule();
                ProgramSchedule.DeserializeSection(node);
            }

            node = rootNode.SelectSingleNode(@"MonthlySection");
            if (node != null && SelectedSpotType == SpotType.Month)
            {
                InitProgramSchedule();
                ProgramSchedule.DeserializeSection(node);
            }

            node = rootNode.SelectSingleNode(@"DigitalProducts");
            if (node != null)
            {
                foreach (XmlNode productNode in node.ChildNodes)
                {
                    var product = new DigitalProduct();
                    product.Deserialize(productNode);
                    DigitalProducts.Add(product);
                }
            }

            node = rootNode.SelectSingleNode(@"DigitalProductSummary");
            if (node != null)
            {
                DigitalProductSummary.Deserialize(node);
            }

            node = rootNode.SelectSingleNode(@"Snapshots");
            if (node != null)
            {
                foreach (XmlNode snapshotNode in node.ChildNodes)
                {
                    var snapshot = new Snapshot.Snapshot(this);
                    snapshot.Deserialize(snapshotNode);
                    Snapshots.Add(snapshot);
                }
            }

            node = rootNode.SelectSingleNode(@"SnapshotSummary");
            if (node != null)
            {
                SnapshotSummary.Deserialize(node);
            }

            node = rootNode.SelectSingleNode(@"Options");
            if (node != null)
            {
                foreach (XmlNode optionSetNode in node.ChildNodes)
                {
                    var optionSet = new OptionSet(this);
                    optionSet.Deserialize(optionSetNode);
                    Options.Add(optionSet);
                }
            }

            node = rootNode.SelectSingleNode(@"OptionsSummary");
            if (node != null)
            {
                OptionsSummary.Deserialize(node);
            }
        }