Exemple #1
0
        public void Dump2Xml()
        {
            if ((TheHt.Count <= 0) || !IsDirty)
            {
                return;
            }

            Utility.EnsureDirectory(Filename);                //  will create the dir if its not there

            var writer = new XmlTextWriter(Filename, null);

            writer.WriteStartDocument();
            writer.WriteComment("Comments: " + Name);
            writer.WriteStartElement("stat-list");

            var myEnumerator = TheHt.GetEnumerator();

            while (myEnumerator.MoveNext())
            {
                var t = (YahooOutput)myEnumerator.Value;
                WriteStatNode(writer, t);
            }
            writer.WriteEndElement();
            writer.WriteEndDocument();
            writer.Close();
            Utility.Announce(Filename + " created");
        }
        public decimal InjuryRatio()
        {
            var players  = 0;
            var injuries = 0;

            var myEnumerator = TheHt.GetEnumerator();

            while (myEnumerator.MoveNext())
            {
                var p = (NFLPlayer)myEnumerator.Value;
                if (p.IsActive())
                {
                    players++;
                }
                if (p.IsInjured())
                {
                    injuries++;
                }
            }

            decimal ratio = Ratio(injuries, players);

            RosterLib.Utility.Announce(string.Format("Injury Ratio:- Injuries {0} players {1} Ratio {2:###.#}%",
                                                     injuries, players, ratio * 100.0M));
            return(ratio);
        }
        public void Dump2Xml()
        {
            if ((TheHt.Count > 0) && IsDirty)
            {
                XmlTextWriter writer = new
                                       XmlTextWriter(string.Format("{0}{1}", Utility.OutputDirectory(), Filename), null);

                writer.WriteStartDocument();
                writer.WriteComment("Comments: " + Name);
                writer.WriteStartElement("player-list");

                IDictionaryEnumerator myEnumerator = TheHt.GetEnumerator();
                while (myEnumerator.MoveNext())
                {
                    NFLPlayer p = (NFLPlayer)myEnumerator.Value;
                    if (p.PlayerCode.Length > 6)
                    {
                        WritePlayerNode(writer, p);
                    }
                }
                writer.WriteEndElement();
                writer.WriteEndDocument();
                writer.Close();
                RosterLib.Utility.Announce(string.Format("   {0} created", Filename));
            }
        }
Exemple #4
0
        /// <summary>
        ///   Converts the memory hash table to XML
        /// </summary>
        public void Dump2Xml()
        {
            if ((TheHt.Count > 0) && IsDirty)
            {
                var writer = new XmlTextWriter(string.Format("{0}", Filename), null);

                writer.WriteStartDocument();
                writer.WriteComment("Comments: " + Name);
                writer.WriteStartElement("torrent-list");

                var myEnumerator = TheHt.GetEnumerator();
                while (myEnumerator.MoveNext())
                {
                    var m = (TorrentItem)myEnumerator.Value;
                    WriteMediaNode(writer, m);
                }
                writer.WriteEndElement();
                writer.WriteEndDocument();
                writer.Close();
                Utility.Announce(string.Format("{0} created.", Filename));
            }
            else
            {
                Utility.Announce(string.Format("No changes to {0}.", Filename));
            }
        }
        public void Dump2Xml()
        {
            if ((TheHt.Count > 0) && IsDirty)
            {
                var writer = new XmlTextWriter(
                    filename: $"{Filename}",
                    encoding: null)
                {
                    Formatting = Formatting.Indented
                };
                writer.WriteStartDocument();

                writer.WriteComment("Comments: " + Name);
                writer.WriteStartElement("counter-list");

                var myEnumerator = TheHt.GetEnumerator();
                while (myEnumerator.MoveNext())
                {
                    var item = (CountItem)myEnumerator.Value;
                    WriteCountNode(writer, item);
                }
                writer.WriteEndElement();
                writer.WriteEndDocument();
                writer.Close();
            }
        }
Exemple #6
0
        public void DumpMedia()
        {
            var myEnumerator = TheHt.GetEnumerator();

            while (myEnumerator.MoveNext())
            {
                var s = (TorrentItem)myEnumerator.Value;
                Utility.Announce($"Season {myEnumerator.Key}:- ");
            }
        }
        public void DumpSeasons()
        {
            IDictionaryEnumerator myEnumerator = TheHt.GetEnumerator();

            while (myEnumerator.MoveNext())
            {
                NflSeason s = (NflSeason)myEnumerator.Value;
                RosterLib.Utility.Announce(string.Format("Season {0}:- ", myEnumerator.Key));
                s.DumpTeams();
            }
        }
Exemple #8
0
        public void DumpHt()
        {
            var myEnumerator = TheHt.GetEnumerator();
            var i            = 0;

            Logger.Trace("\t-INDEX-\t-KEY-\t-VALUE-");
            while (myEnumerator.MoveNext())
            {
                Logger.Trace(string.Format("\t[{0}]:\t{1}\t{2}", i++, myEnumerator.Key, myEnumerator.Value));
            }
        }
Exemple #9
0
        public void DumpHt()
        {
            var myEnumerator = TheHt.GetEnumerator();
            var i            = 0;

            Logger.Trace("\t-INDEX-\t-KEY-\t-VALUE-");
            while (myEnumerator.MoveNext())
            {
                Logger.Trace($"\t[{i++}]:\t{myEnumerator.Key}\t{myEnumerator.Value}");
            }
        }
Exemple #10
0
        public void Dump2Xml()
        {
            if ((TheHt.Count > 0) && IsDirty)
            {
                var writer = new
                             XmlTextWriter(string.Format("{0}{1}", Utility.OutputDirectory(), Filename), null);

                writer.WriteStartDocument();
                writer.WriteComment("Comments: " + Name);
                writer.WriteStartElement("team-list");

                var myEnumerator = TheHt.GetEnumerator();
                while (myEnumerator.MoveNext())
                {
                    var t = (NflTeam)myEnumerator.Value;
                    WriteTeamNode(writer, t);
                }
                writer.WriteEndElement();
                writer.WriteEndDocument();
                writer.Close();
                Utility.Announce(Filename + " created");
            }
        }
        /// <summary>
        ///   Converts the memory hash table to XML
        /// </summary>
        public void Dump2Xml()
        {
            if ((TheHt.Count > 0) && IsDirty)
            {
                XmlTextWriter writer = new
                                       XmlTextWriter(string.Format("{0}{1}", Utility.OutputDirectory(), Filename), null);

                writer.WriteStartDocument();
                writer.WriteComment("Comments: " + Name);
                writer.WriteStartElement("season-list");

                IDictionaryEnumerator myEnumerator = TheHt.GetEnumerator();
                while (myEnumerator.MoveNext())
                {
                    NflSeason s = (NflSeason)myEnumerator.Value;
                    WriteSeasonNode(writer, s);
                }
                writer.WriteEndElement();
                writer.WriteEndDocument();
                writer.Close();
                RosterLib.Utility.Announce(string.Format("{0}{1} created.", Utility.OutputDirectory(), Filename));
            }
        }