Beispiel #1
0
        internal void Mark(string stepDescription, int recursion = 0)
        {
            long tickMark = Stopwatch.ElapsedTicks;
            long msMark   = Stopwatch.ElapsedMilliseconds;
            var  tm       = new TimerMark()
            {
                Milliseconds = msMark, Ticks = tickMark, StepDescription = stepDescription
            };

            lock (Marks)
            {
                Marks.Add(tm);
            }
            #region test
            //            if (tm != null)
            //            {
            //                Marks.Add(tm);
            //            }
            //            else
            //            {
            //#if DEBUG
            //                throw new CodeFirstException("Null timer mark");
            //#else
            //                if(recursion < 10)
            //                {
            //                    Mark(stepDescription, recursion++);
            //                }
            //                else
            //                {
            //                    throw new CodeFirstException("Null timer mark - tried 10 times");
            //                }
            //#endif
            //            }
            #endregion
        }
Beispiel #2
0
 public Student(string number, int mark1, int mark2, int mark3, int mark4)
 {
     FacultyNumber = number;
     Marks.Add(mark1);
     Marks.Add(mark2);
     Marks.Add(mark3);
     Marks.Add(mark4);
 }
Beispiel #3
0
        //public override bool Equals(Student student)
        //{
        //    return base.Equals(student);
        //}
        //public override int GetHashCode()
        //{
        //    return base.GetHashCode();
        //}

        public void GiveGrade(int mark)
        {
            Marks.Add(mark);
            GradeGiven?.Invoke(this, new GradeEventArgs()
            {
                Grade = mark
            });
        }
 public void SetMarks(List <KVPBase> data)
 {
     data = data.OrderBy(p => p.Name).ToList();
     Marks.Clear();
     foreach (var item in data)
     {
         Marks.Add(item);
     }
 }
Beispiel #5
0
 public Student(string firstname, string lastname, int mark1, int mark2, int mark3, int mark4)
 {
     FirstName = firstname;
     LastName  = lastname;
     Marks.Add(mark1);
     Marks.Add(mark2);
     Marks.Add(mark3);
     Marks.Add(mark4);
 }
Beispiel #6
0
        public void AddMark(Mark mark)
        {
            if (mark == null)
            {
                throw new ArgumentNullException("The tag cannot be null.");
            }

            Marks.Add(mark);
        }
Beispiel #7
0
 public void SetMarks(List <KVPBase> data)
 {
     data = data.OrderBy(p => p.Name).ToList();
     Marks.Clear();
     data.ForEach(o => Marks.Add(o));
     if (LoadMarksComplete != null)
     {
         LoadMarksComplete(this, new EventArgs());
     }
 }
Beispiel #8
0
        public ListDataSource(IEnumerable <T> items, Func <T, bool> isMarked)
        {
            int index = 0;

            foreach (var item in items)
            {
                Add(item);
                if (isMarked?.Invoke(item) ?? false)
                {
                    Marks.Add(index);
                }
                index++;
            }
        }
Beispiel #9
0
        public Student(string studentName, Random rand)
        {
            StudentName = studentName;
            int randomNumber = 0;

            for (int i = 0; i < 5; i++)
            {
                int newMark;
                do
                {
                    newMark = rand.Next(1, 10);
                } while (newMark == randomNumber);

                randomNumber = newMark;

                Marks.Add(randomNumber);
            }
        }
Beispiel #10
0
        internal void End(string stepDescription, int recursion = 0)
        {
            Stopwatch.Stop();
            var tm = new TimerMark()
            {
                Milliseconds = Stopwatch.ElapsedMilliseconds, Ticks = Stopwatch.ElapsedTicks, StepDescription = stepDescription
            };

            lock (Marks)
            {
                Marks.Add(tm);
                Marks = Marks.Select(x => x != null ? x : new TimerMark()
                {
                    StepDescription = "MISSINGNO"
                }).OrderBy(x => x.Ticks).ToList();
            }
            #region test
            //            if (tm != null)
            //            {

            //            }
            //            else
            //            {
            //#if DEBUG
            //                throw new CodeFirstException("Null timer mark");
            //#else
            //                if(recursion < 10)
            //                {
            //                    End(stepDescription, recursion++);
            //                }
            //                else
            //                {
            //                    throw new CodeFirstException("Null timer mark - tried 10 times");
            //                }
            //#endif
            //            }
            #endregion
        }
Beispiel #11
0
 public void AddMark(byte mark)
 {
     Marks.Add(mark);
 }
Beispiel #12
0
 public void AddMark(double mark)
 {
     Marks.Add(mark);
 }
Beispiel #13
0
 public void AddMark(double Price, SolidColorBrush TextBrush, SolidColorBrush MarkFill,
                     SolidColorBrush LineBrush = null, double LineThikness = 0, double LineDash = 0, double LineIndent = 0) =>
 Marks.Add(new PriceMark(Price, Act, TextBrush, MarkFill, LineBrush, LineThikness, LineDash, LineIndent));
Beispiel #14
0
 public void AddMark(PriceMark pm) => Marks.Add(pm);
Beispiel #15
0
        void DemoData()
        {
            for (var i = 1; i <= 5; i++)
            {
                _posts.Add(new PostModel
                {
                    Id       = i,
                    Name     = string.Format("Пост № {0:00}", i),
                    TimeFrom = new TimeSpan(i % 2 == 0 ? 8 : 9, 0, 0),
                    TimeTo   = new TimeSpan(i % 2 == 0 ? 19 : 18, 0, 0)
                });
            }
            _orders.Add(new OrderModel
            {
                OrderNumer = 1,
                Car        = new CarViewModel("Demo 1"),
                DateWork   = DateTime.Now.AddHours(1).AddMinutes(25),
                DtCreate   = DateTime.Now,
                PostId     = 4,
                UserId     = 1
            });
            _orders.Add(new OrderModel
            {
                OrderNumer = 2,
                Car        = new CarViewModel("Demo 2"),
                DateWork   = DateTime.Now.AddHours(3).AddMinutes(32),
                DtCreate   = DateTime.Now,
                PostId     = 2,
                UserId     = 2
            });
            _users.Add(new UserLightModel {
                Id = 1, Nm = "Иванов Иван Иванович"
            });
            _users.Add(new UserLightModel {
                Id = 2, Nm = "Петров Петр Петрович"
            });

            _works.Add(new WorksInfoDataModel {
                Name = "Периодические", Id = 1, IdParent = 0
            });
            _works.Add(new WorksInfoDataModel {
                Name = "Остальные", Id = 2, IdParent = 0
            });
            // Значение NavUrl = Id для работы и пустое для подгруппы
            _works.Add(new WorksInfoDataModel {
                Name = "Двигатель", Id = 3, IdParent = 1, NavUrl = "3", Nh = 15
            });
            _works.Add(new WorksInfoDataModel {
                Name = "КПП", Id = 4, IdParent = 2, NavUrl = "4", Nh = 5
            });

            for (var i = 1; i < 5; i++)
            {
                Marks.Add(new KVPBase {
                    id = i, Name = "Марка " + i
                });
                Models.Add(new KVPBase {
                    id = i, Name = "Модель " + i
                });
                BodyTypes.Add(new KVPBase {
                    id = i, Name = "Тип кузова " + i
                });
                EngineTypes.Add(new KVPBase {
                    id = i, Name = "Тип двигателя " + i
                });
                EngineVolumes.Add(new KVPBase {
                    id = i, Name = string.Format("{0} л", i / 2.0)
                });
            }
            TransTypes.Add(new KVPBase {
                id = 1, Name = "автомат"
            });
            TransTypes.Add(new KVPBase {
                id = 2, Name = "механика"
            });
        }
Beispiel #16
0
 public void AddMark(Mark mark)
 {
     Marks.Add(mark);
 }