예제 #1
0
        /// <summary>
        /// Copies the statistics.
        /// </summary>
        /// <param name="lmId">The lm id.</param>
        /// <param name="statistic">The statistic.</param>
        /// <remarks>Documented by Dev08, 2009-02-09</remarks>
        public void CopyStatistics(int lmId, IStatistic statistic)
        {
            if (statistic.StartTimestamp == null || statistic.EndTimestamp == null)     //do not save invalid sessions
            {
                return;
            }

            SqlCeCommand cmd = MSSQLCEConn.CreateCommand(parent.CurrentUser);

            cmd.CommandText = "INSERT INTO LearningSessions(user_id, lm_id, starttime, endtime, sum_right, sum_wrong, " +
                              "pool_content, box1_content, box2_content, box3_content, box4_content, box5_content, box6_content, box7_content, box8_content, box9_content, box10_content)" +
                              "VALUES(@userid, @lmid, @starttime, @endtime, @sumright, @sumwrong, @pool, @b1, @b2, @b3, @b4, @b5, @b6, @b7, @b8, @b9, @b10)";

            cmd.Parameters.Add("@userid", parent.CurrentUser.Id);
            cmd.Parameters.Add("@lmid", lmId);
            cmd.Parameters.Add("@starttime", statistic.StartTimestamp);
            cmd.Parameters.Add("@endtime", statistic.EndTimestamp);
            cmd.Parameters.Add("@sumright", statistic.Right);
            cmd.Parameters.Add("@sumwrong", statistic.Wrong);
            int counter = 0;

            foreach (int box in statistic.Boxes)
            {
                ++counter;
                cmd.Parameters.Add("@b" + counter.ToString(), box);
            }

            cmd.Parameters.Add("@pool", parent.GetParentDictionary().Boxes.Box[0].MaximalSize);     //pool max size => cards in pools

            MSSQLCEConn.ExecuteNonQuery(cmd);
        }
        /// <summary>
        /// Gets the statistics for an index entry.
        /// </summary>
        /// <param name="entry">The learning module index entry.</param>
        /// <remarks>Documented by Dev03, 2008-12-04</remarks>
        private static void GetStatistics(LearningModulesIndexEntry entry)
        {
            LearningModuleStatistics lms = new LearningModuleStatistics();

            entry.Statistics = lms;
            try
            {
                if (entry.Dictionary.Statistics.Count > 0)
                {
                    for (int i = (entry.Dictionary.Statistics.Count - 1); i >= 0; i--)
                    {
                        IStatistic stat = entry.Dictionary.Statistics[i];
                        if ((stat.Right + stat.Wrong) > 0)
                        {
                            lms.CardsAsked      = stat.Right + stat.Wrong;
                            lms.LastSessionTime = stat.EndTimestamp - stat.StartTimestamp;
                            lms.LastEndTime     = stat.EndTimestamp;
                            lms.LastStartTime   = stat.StartTimestamp;
                            lms.Right           = stat.Right;
                            lms.Wrong           = stat.Wrong;
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("LearningModulesIndex.GetStatistics() - " + ex.Message);
            }
        }
예제 #3
0
 public void Save(IStatistic statistic)
 {
     foreach (var player in statistic)
     {
         this.PlayerMementoStorage.Add(player.StoreToMemento());
     }
 }
예제 #4
0
 private void events_ShowStatsPanel(MainForm form, IStatistic statistic, Competitor[] tabsToShow)
 {
     if (form == base.AssociatedForm)
     {
         ShowStatsPanel(statistic, tabsToShow);
     }
 }
        /// <summary>
        /// Copies the statistics.
        /// </summary>
        /// <param name="lmId">The lm id.</param>
        /// <param name="statistic">The statistic.</param>
        /// <remarks>Documented by Dev08, 2009-02-09</remarks>
        public void CopyStatistics(int lmId, IStatistic statistic)
        {
            if (statistic.StartTimestamp == null || statistic.EndTimestamp == null)     //do not save invalid sessions
                return;

            SqlCeCommand cmd = MSSQLCEConn.CreateCommand(parent.CurrentUser);
            cmd.CommandText = "INSERT INTO LearningSessions(user_id, lm_id, starttime, endtime, sum_right, sum_wrong, " +
                              "pool_content, box1_content, box2_content, box3_content, box4_content, box5_content, box6_content, box7_content, box8_content, box9_content, box10_content)" +
                              "VALUES(@userid, @lmid, @starttime, @endtime, @sumright, @sumwrong, @pool, @b1, @b2, @b3, @b4, @b5, @b6, @b7, @b8, @b9, @b10)";

            cmd.Parameters.Add("@userid", parent.CurrentUser.Id);
            cmd.Parameters.Add("@lmid", lmId);
            cmd.Parameters.Add("@starttime", statistic.StartTimestamp);
            cmd.Parameters.Add("@endtime", statistic.EndTimestamp);
            cmd.Parameters.Add("@sumright", statistic.Right);
            cmd.Parameters.Add("@sumwrong", statistic.Wrong);
            int counter = 0;
            foreach (int box in statistic.Boxes)
            {
                ++counter;
                cmd.Parameters.Add("@b" + counter.ToString(), box);
            }

            cmd.Parameters.Add("@pool", parent.GetParentDictionary().Boxes.Box[0].MaximalSize);     //pool max size => cards in pools

            MSSQLCEConn.ExecuteNonQuery(cmd);
        }
        /// <summary>
        /// Copies the statistics.
        /// </summary>
        /// <param name="lmId">The lm id.</param>
        /// <param name="statistic">The statistic.</param>
        /// <remarks>Documented by Dev08, 2009-02-09</remarks>
        public void CopyStatistics(int lmId, IStatistic statistic)
        {
            if (statistic.StartTimestamp == null || statistic.EndTimestamp == null)     //do not save invalid sessions
                return;

            using (NpgsqlConnection con = PostgreSQLConn.CreateConnection(parent.CurrentUser))
            {
                using (NpgsqlCommand cmd = con.CreateCommand())
                {
                    cmd.CommandText = "INSERT INTO \"LearningSessions\"(user_id, lm_id, starttime, endtime, sum_right, sum_wrong, " +
                                      "pool_content, box1_content, box2_content, box3_content, box4_content, box5_content, box6_content, box7_content, box8_content, box9_content, box10_content)" +
                                      "VALUES(:userid, :lmid, :starttime, :endtime, :sumright, :sumwrong, :pool, :b1, :b2, :b3, :b4, :b5, :b6, :b7, :b8, :b9, :b10)";

                    cmd.Parameters.Add("userid", parent.CurrentUser.Id);
                    cmd.Parameters.Add("lmid", lmId);
                    cmd.Parameters.Add("starttime", statistic.StartTimestamp);
                    cmd.Parameters.Add("endtime", statistic.EndTimestamp);
                    cmd.Parameters.Add("sumright", statistic.Right);
                    cmd.Parameters.Add("sumwrong", statistic.Wrong);
                    int counter = 0;
                    foreach (int box in statistic.Boxes)
                    {
                        ++counter;
                        cmd.Parameters.Add("b" + counter.ToString(), box);
                    }
                    cmd.Parameters.Add("pool", parent.GetParentDictionary().Boxes.Box[0].MaximalSize);     //pool max size => cards in pools

                    PostgreSQLConn.ExecuteNonQuery(cmd, parent.CurrentUser);
                }
            }
        }
예제 #7
0
 public static void Add <TKey>(this IStatistic <TKey> stat, IEnumerable <KeyValuePair <TKey, int> > pairs)
 {
     foreach (var pair in pairs)
     {
         stat.Add(pair.Key, pair.Value);
     }
 }
예제 #8
0
        public Engine(IRender render, IStatisticFactory statisticFactory, IStatisticStorage statisticStorage)
        {
            if (render == null)
            {
                throw new ArgumentNullException("render");
            }

            if (statisticFactory == null)
            {
                throw new ArgumentNullException("statisticFactory");
            }

            if (statisticStorage == null)
            {
                throw new ArgumentNullException("statisticStorage");
            }

            this.Render = render;
            this.StatisticFactory = statisticFactory;
            this.StatisticStorage = statisticStorage;

            this.State = new StartState(this);
            this.CommandFactory = new CommandFactory(this);
            this.Statistic = StatisticFactory.CreateStatistic();
        }
예제 #9
0
 public void OnShowStatsPanel(MainForm form, IStatistic statistic, Competitor[] tabsToShow)
 {
     if (ShowStatsPanel != null)
     {
         ShowStatsPanel(form, statistic, tabsToShow);
     }
 }
예제 #10
0
 public static void WriteToCsv <TKey>(this IStatistic <TKey> stat, TextWriter writer, int take = -1)
 {
     foreach (var pair in take == -1 ? stat.KeyFrequency : stat.KeyFrequency.Take(take))
     {
         writer.WriteLine($"{pair.Key}, {pair.Value}");
     }
 }
        /// <summary>
        /// Copies the statistics.
        /// </summary>
        /// <param name="lmId">The lm id.</param>
        /// <param name="statistic">The statistic.</param>
        /// <remarks>Documented by Dev08, 2009-02-09</remarks>
        public void CopyStatistics(int lmId, IStatistic statistic)
        {
            if (statistic.StartTimestamp == null || statistic.EndTimestamp == null)     //do not save invalid sessions
            {
                return;
            }

            using (NpgsqlConnection con = PostgreSQLConn.CreateConnection(parent.CurrentUser))
            {
                using (NpgsqlCommand cmd = con.CreateCommand())
                {
                    cmd.CommandText = "INSERT INTO \"LearningSessions\"(user_id, lm_id, starttime, endtime, sum_right, sum_wrong, " +
                                      "pool_content, box1_content, box2_content, box3_content, box4_content, box5_content, box6_content, box7_content, box8_content, box9_content, box10_content)" +
                                      "VALUES(:userid, :lmid, :starttime, :endtime, :sumright, :sumwrong, :pool, :b1, :b2, :b3, :b4, :b5, :b6, :b7, :b8, :b9, :b10)";

                    cmd.Parameters.Add("userid", parent.CurrentUser.Id);
                    cmd.Parameters.Add("lmid", lmId);
                    cmd.Parameters.Add("starttime", statistic.StartTimestamp);
                    cmd.Parameters.Add("endtime", statistic.EndTimestamp);
                    cmd.Parameters.Add("sumright", statistic.Right);
                    cmd.Parameters.Add("sumwrong", statistic.Wrong);
                    int counter = 0;
                    foreach (int box in statistic.Boxes)
                    {
                        ++counter;
                        cmd.Parameters.Add("b" + counter.ToString(), box);
                    }
                    cmd.Parameters.Add("pool", parent.GetParentDictionary().Boxes.Box[0].MaximalSize);     //pool max size => cards in pools

                    PostgreSQLConn.ExecuteNonQuery(cmd, parent.CurrentUser);
                }
            }
        }
예제 #12
0
        public Engine(IRender render, IStatisticFactory statisticFactory, IStatisticStorage statisticStorage)
        {
            if (render == null)
            {
                throw new ArgumentNullException("render");
            }

            if (statisticFactory == null)
            {
                throw new ArgumentNullException("statisticFactory");
            }

            if (statisticStorage == null)
            {
                throw new ArgumentNullException("statisticStorage");
            }

            this.Render           = render;
            this.StatisticFactory = statisticFactory;
            this.StatisticStorage = statisticStorage;

            this.State          = new StartState(this);
            this.CommandFactory = new CommandFactory(this);
            this.Statistic      = StatisticFactory.CreateStatistic();
        }
 /// <summary>
 /// The save...
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 public void Save(IStatistic statistic)
 {
     foreach (var player in statistic)
     {
         this.PlayerMementoStorage.Add(player.StoreToMemento());
     }
 }
예제 #14
0
 public void AddStats(int number, IStatistic stat)
 {
     if (_repository.ContainsKey(number))
     {
         _repository[number].AddStatistic(stat);
     }
 }
예제 #15
0
        public string GetChartData(string piServer)
        {
            piServer = string.IsNullOrEmpty(piServer) ? Constant.PIPServer : piServer;
            IStatistic st   = DataAccess.CreateStatistic(piServer);
            string     json = st.ChartData();

            return(json);
        }
예제 #16
0
        private void ShowStatsPanel(IStatistic Statistic, Competitor[] tabsToShow)
        {
            StatsPanel panel = new StatsPanel(base.AssociatedForm, Statistic, tabsToShow);

            AddContentPanel(panel);
            panel.AddToolStrip();
            FinishedAdding();
        }
 public StatisticsController(
     IInterviweeManagement InterviweeManagement,
     IStatistic Statistic
     )
 {
     m_InterviweeManagement = InterviweeManagement;
     m_Statistic            = Statistic;
 }
예제 #18
0
 /// <summary>
 /// Converts one property of the specified statistic to a card view model.
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 /// <returns></returns>
 public CardViewModel Convert(IStatistic statistic)
 {
     return(new CardViewModel
     {
         Style = statistic.BestAssetClassProfit.StyleTypeForCurrency(),
         Header = Resources.ViewTextKpiBestAssetClass,
         Title = $"{statistic.BestAssetClassName} ({statistic.BestAssetClassProfit} €)"
     });
 }
예제 #19
0
 /// <summary>
 /// Converts one property of the specified statistic to a card view model.
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 /// <returns></returns>
 public CardViewModel Convert(IStatistic statistic)
 {
     return(new CardViewModel
     {
         Style = StyleType.Danger,
         Header = Resources.ViewTextKpiAmountOfLossTrades,
         Title = $"{statistic.AmountOfLossTransactions} ({statistic.PercentageOfLossTransactions} %)"
     });
 }
예제 #20
0
 /// <summary>
 /// Converts one property of the specified statistic to a card view model.
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 /// <returns></returns>
 public CardViewModel Convert(IStatistic statistic)
 {
     return(new CardViewModel
     {
         Style = StyleType.Light,
         Header = Resources.ViewTextKpiAvgHoldingPeriodIntradayTrades,
         Title = $"{statistic.AvgHoldingPeriodIntradayTrades:0} {Resources.DisplayTooltipMinutes} ({statistic.AmountIntradayTrades})"
     });
 }
예제 #21
0
 /// <summary>
 /// Converts one property of the specified statistic to a card view model.
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 /// <returns></returns>
 public CardViewModel Convert(IStatistic statistic)
 {
     return(new CardViewModel
     {
         Style = StyleType.Light,
         Header = Resources.ViewTextKpiAverageBuyVolume,
         Title = statistic.AverageBuyVolume.ToString("C", System.Globalization.CultureInfo.GetCultureInfo("de-de"))
     });
 }
예제 #22
0
 /// <summary>
 /// Converts one property of the specified statistic to a card view model.
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 /// <returns></returns>
 public CardViewModel Convert(IStatistic statistic)
 {
     return(new CardViewModel
     {
         Style = statistic.ProfitMaximum.StyleTypeForCurrency(),
         Header = Resources.ViewTextKpiProfitMaximum,
         Title = statistic.ProfitMaximum.ToString("C", System.Globalization.CultureInfo.GetCultureInfo("de-de"))
     });
 }
예제 #23
0
 /// <summary>
 /// Converts one property of the specified statistic to a card view model.
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 /// <returns></returns>
 public CardViewModel Convert(IStatistic statistic)
 {
     return(new CardViewModel
     {
         Style = StyleType.Secondary,
         Header = Resources.ViewTextKpiAmountOfTrades,
         Title = statistic.AmountOfTransactions.ToString()
     });
 }
예제 #24
0
 public Node(
     IStatistic statistic,
     IHistogram histogram
     )
 {
     _statistic    = statistic;
     _histogram    = histogram;
     Distributions = new List <IDistribution>();
 }
예제 #25
0
 /// <summary>
 /// Converts one property of the specified statistic to a card view model.
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 /// <returns></returns>
 public CardViewModel Convert(IStatistic statistic)
 {
     return(new CardViewModel
     {
         Style = StyleType.Warning,
         Header = Resources.ViewTextKpiTaxes,
         Title = statistic.SumTaxes.ToString("0.00 €")
     });
 }
예제 #26
0
 /// <summary>
 /// Converts one property of the specified statistic to a card view model.
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 /// <returns></returns>
 public CardViewModel Convert(IStatistic statistic)
 {
     return(new CardViewModel
     {
         Style = StyleType.Success,
         Header = Resources.ViewTextKpiMostConsecutiveWins,
         Title = statistic.MostConsecutiveWins.ToString()
     });
 }
예제 #27
0
 /// <summary>
 /// Converts one property of the specified statistic to a card view model.
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 /// <returns></returns>
 public CardViewModel Convert(IStatistic statistic)
 {
     return(new CardViewModel
     {
         Style = statistic.LossMaximum.StyleTypeForCurrency(),
         Header = Resources.ViewTextKpiLossMaximum,
         Title = statistic.LossMaximum.ToString("0.00 €")
     });
 }
예제 #28
0
 public Event(
     IStatistic statistic,
     ISourceScope sourceScope,
     ITimeScope timeScope)
 {
     this.Statistic   = statistic;
     this.SourceScope = sourceScope;
     this.TimeScope   = timeScope;
 }
예제 #29
0
 /// <summary>
 /// Converts one property of the specified statistic to a card view model.
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 /// <returns></returns>
 public CardViewModel Convert(IStatistic statistic)
 {
     return(new CardViewModel
     {
         Style = StyleType.Light,
         Header = Resources.ViewTextKpiAverageBuyVolume,
         Title = statistic.AverageBuyVolume.ToString("0.00 €")
     });
 }
예제 #30
0
 /// <summary>
 /// Converts one property of the specified statistic to a card view model.
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 /// <returns></returns>
 public CardViewModel Convert(IStatistic statistic)
 {
     return(new CardViewModel
     {
         Style = StyleType.Info,
         Header = Resources.ViewTextKpiAmountOfTransactionsPerYear,
         Title = statistic.AmountOfTransactionsPerYear.ToString("0.00")
     });
 }
예제 #31
0
 /// <summary>
 /// Converts one property of the specified statistic to a card view model.
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 /// <returns></returns>
 public CardViewModel Convert(IStatistic statistic)
 {
     return(new CardViewModel
     {
         Style = StyleType.Warning,
         Header = Resources.ViewTextKpiTaxes,
         Title = statistic.SumTaxes.ToString("C", System.Globalization.CultureInfo.GetCultureInfo("de-de"))
     });
 }
예제 #32
0
 /// <summary>
 /// Converts one property of the specified statistic to a card view model.
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 /// <returns></returns>
 public CardViewModel Convert(IStatistic statistic)
 {
     return(new CardViewModel
     {
         Style = statistic.BestAssetClassProfit.StyleTypeForCurrency(),
         Header = Resources.ViewTextKpiBestAssetClass,
         Title = $"{statistic.BestAssetClassName} ({statistic.BestAssetClassProfit.ToString("C", System.Globalization.CultureInfo.GetCultureInfo("de-de"))})"
     });
 }
예제 #33
0
 /// <summary>
 /// Converts one property of the specified statistic to a card view model.
 /// </summary>
 /// <param name="statistic">The statistic.</param>
 /// <returns></returns>
 public CardViewModel Convert(IStatistic statistic)
 {
     return(new CardViewModel
     {
         Style = statistic.AvgEntryEfficiency.StyleTypeForEfficiency(),
         Header = Resources.ViewTextKpiAvgEntryEfficiency,
         Title = $"{statistic.AvgEntryEfficiency:0.00} %"
     });
 }
 public DebugMailSender(string address, int port, bool useSsl, string login, string password, IStatistic statistic)
 {
     _address   = address;
     _port      = port;
     _useSsl    = useSsl;
     _login     = login;
     _password  = password;
     _statistic = statistic;
 }
        public void MedianCalculation()
        {
            numbers.Add(13.50);
            numbers.Add(8.00);
            numbers.Add(5.25);
            numbers.Add(20.99);
            numbers.Add(1.00);
            numbers.Add(3.50);
            numbers.Add(30.00);
            calculate = new MedianStatistic();

            Assert.AreEqual(calculate.CalculateStatistics(numbers), 8.00);
        }
        public void AverageCalculation()
        {
            numbers.Add(13.50);
            numbers.Add(8.00);
            numbers.Add(5.25);
            numbers.Add(20.99);
            numbers.Add(1.00);
            numbers.Add(3.50);
            numbers.Add(30.00);

            calculate = new AverageStatistic();

            Assert.AreEqual(calculate.CalculateStatistics(numbers), 11.748571428571427);
        }
예제 #37
0
 /// <summary>
 /// Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </summary>
 /// <param name="item">The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
 /// <returns>
 /// true if <paramref name="item"/> was successfully removed from the <see cref="T:System.Collections.Generic.ICollection`1"/>; otherwise, false. This method also returns false if <paramref name="item"/> is not found in the original <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </returns>
 /// <exception cref="T:System.NotSupportedException">
 /// The <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.
 /// </exception>
 /// <remarks>Documented by Dev03, 2009-03-23</remarks>
 public bool Remove(IStatistic item)
 {
     return stats.Remove(item);
 }
예제 #38
0
 /// <summary>
 /// Adds an item to the <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </summary>
 /// <param name="item">The object to add to the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
 /// <exception cref="T:System.NotSupportedException">
 /// The <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.
 /// </exception>
 /// <remarks>Documented by Dev03, 2009-03-23</remarks>
 public void Add(IStatistic item)
 {
     stats.Add(item);
 }
예제 #39
0
파일: DbStatistics.cs 프로젝트: hmehr/OSS
 public void Add(IStatistic item)
 {
     connector.CopyStatistics(learningModuleId, item);
 }
예제 #40
0
 public void AddStatistic(IStatistic statistic)
 {
     _statistics.Add(statistic);
 }
예제 #41
0
 /// <summary>
 /// Copies the elements of the <see cref="T:System.Collections.Generic.ICollection`1"/> to an <see cref="T:System.Array"/>, starting at a particular <see cref="T:System.Array"/> index.
 /// </summary>
 /// <param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:System.Collections.Generic.ICollection`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
 /// <param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
 /// <exception cref="T:System.ArgumentNullException">
 /// 	<paramref name="array"/> is null.
 /// </exception>
 /// <exception cref="T:System.ArgumentOutOfRangeException">
 /// 	<paramref name="arrayIndex"/> is less than 0.
 /// </exception>
 /// <exception cref="T:System.ArgumentException">
 /// 	<paramref name="array"/> is multidimensional.
 /// -or-
 /// <paramref name="arrayIndex"/> is equal to or greater than the length of <paramref name="array"/>.
 /// -or-
 /// The number of elements in the source <see cref="T:System.Collections.Generic.ICollection`1"/> is greater than the available space from <paramref name="arrayIndex"/> to the end of the destination <paramref name="array"/>.
 /// </exception>
 public void CopyTo(IStatistic[] array, int arrayIndex)
 {
     stats.CopyTo(array, arrayIndex);
 }
예제 #42
0
 /// <summary>
 /// Determines whether the <see cref="T:System.Collections.Generic.ICollection`1"/> contains a specific value.
 /// </summary>
 /// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
 /// <returns>
 /// true if <paramref name="item"/> is found in the <see cref="T:System.Collections.Generic.ICollection`1"/>; otherwise, false.
 /// </returns>
 public bool Contains(IStatistic item)
 {
     return stats.Contains(item);
 }
예제 #43
0
 /// <summary>
 /// Inserts an item to the <see cref="T:System.Collections.Generic.IList`1"/> at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param>
 /// <param name="item">The object to insert into the <see cref="T:System.Collections.Generic.IList`1"/>.</param>
 /// <exception cref="T:System.ArgumentOutOfRangeException">
 /// 	<paramref name="index"/> is not a valid index in the <see cref="T:System.Collections.Generic.IList`1"/>.
 /// </exception>
 /// <exception cref="T:System.NotSupportedException">
 /// The <see cref="T:System.Collections.Generic.IList`1"/> is read-only.
 /// </exception>
 /// <remarks>Documented by Dev03, 2009-03-23</remarks>
 public void Insert(int index, IStatistic item)
 {
     stats.Insert(index, item);
 }
예제 #44
0
파일: DbStatistics.cs 프로젝트: hmehr/OSS
 public bool Remove(IStatistic item)
 {
     throw new NotAllowedInDbModeException();
 }
예제 #45
0
 /// <summary>
 /// Determines the index of a specific item in the <see cref="T:System.Collections.Generic.IList`1"/>.
 /// </summary>
 /// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.IList`1"/>.</param>
 /// <returns>
 /// The index of <paramref name="item"/> if found in the list; otherwise, -1.
 /// </returns>
 public int IndexOf(IStatistic item)
 {
     return stats.IndexOf(item);
 }
예제 #46
0
파일: DbStatistics.cs 프로젝트: hmehr/OSS
 public void Insert(int index, IStatistic item)
 {
     throw new NotAllowedInDbModeException();
 }
예제 #47
0
 /// <summary>
 /// Inserts an item to the <see cref="T:System.Collections.Generic.IList`1"/> at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param>
 /// <param name="item">The object to insert into the <see cref="T:System.Collections.Generic.IList`1"/>.</param>
 /// <exception cref="T:System.ArgumentOutOfRangeException"><paramref name="index"/> is not a valid index in the <see cref="T:System.Collections.Generic.IList`1"/>.
 ///   </exception>
 ///   
 /// <exception cref="T:System.NotSupportedException">
 /// The <see cref="T:System.Collections.Generic.IList`1"/> is read-only.
 ///   </exception>
 public void Insert(int index, IStatistic item)
 {
     if (item is XmlStatistic)
     {
         if ((item as XmlStatistic).Statistic.OwnerDocument != m_dictionary)
             m_dictionary.DocumentElement.AppendChild((item as XmlStatistic).Statistic);
         stats.Insert(index, item);
     }
     else
         throw new ArgumentException("Can only add XmlStatistics");
 }
예제 #48
0
 /// <summary>
 /// Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </summary>
 /// <param name="item">The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
 /// <returns>
 /// true if <paramref name="item"/> was successfully removed from the <see cref="T:System.Collections.Generic.ICollection`1"/>; otherwise, false. This method also returns false if <paramref name="item"/> is not found in the original <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </returns>
 /// <exception cref="T:System.NotSupportedException">
 /// The <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.
 /// </exception>
 public bool Remove(IStatistic item)
 {
     m_dictionary.RemoveChild((item as XmlStatistic).Statistic);
     return stats.Remove(item);
 }
 public void Save(IStatistic statistic)
 {
 }
 public void ShowHighScore(IStatistic statistic)
 {
     Console.WriteLine();
     Console.WriteLine("Scoreboard:");
     int place = 1;
     foreach (var player in statistic)
     {
         Console.WriteLine("{0}. {1} --> {2} Cells", place++, player.Name, player.Score);
         Console.WriteLine();
     }
 }