Beispiel #1
0
        /// <summary>
        /// Add a new filter argument to the list of filters and
        /// select this filter if <paramref name="bSelectNewFilter"/>
        /// indicates it.
        /// </summary>
        /// <param name="filterString"></param>
        /// <param name="bSelectNewFilter"></param>
        public void AddFilter(string filterString,
                              bool bSelectNewFilter = false)
        {
            var item = new FilterItemViewModel(filterString);

            _CurrentItems.Add(item);
            _CurrentItems.Sort(i => i.FilterDisplayName, ListSortDirection.Ascending);

            if (bSelectNewFilter == true)
            {
                this.SelectedItem = item;
            }
        }
		void UpdateDevices()
		{
			AvailableDevices = new SortableObservableCollection<GKDevice>();
			Devices = new SortableObservableCollection<GKDevice>();
			SelectedAvailableDevice = null;
			SelectedDevice = null;

			foreach (var device in SourceDevices)
			{
				if (!device.Driver.IsGroupDevice)
				{
					if (DevicesList.Contains(device))
						Devices.Add(device);
					else
						AvailableDevices.Add(device);
				}
			}
			Devices.Sort(x => x.IntDottedPresentationAddress);
			AvailableDevices.Sort(x => x.IntDottedPresentationAddress);

			SelectedDevice = Devices.FirstOrDefault();
			SelectedAvailableDevice = AvailableDevices.FirstOrDefault();

			OnPropertyChanged(() => Devices);
			OnPropertyChanged(() => AvailableDevices);
		}
		public GuardZonesSelectationViewModel(List<GKGuardZone> guardZones)
		{
			Title = "Выбор охранных зон";
			AddCommand = new RelayCommand<object>(OnAdd, CanAdd);
			RemoveCommand = new RelayCommand<object>(OnRemove, CanRemove);
			AddAllCommand = new RelayCommand(OnAddAll, CanAddAll);
			RemoveAllCommand = new RelayCommand(OnRemoveAll, CanRemoveAll);
			CreateNewCommand = new RelayCommand(OnCreateNew);

			GuardZones = guardZones;
			TargetZones = new SortableObservableCollection<GKGuardZone>();
			SourceZones = new SortableObservableCollection<GKGuardZone>();

			foreach (var guardZone in GKManager.GuardZones)
			{
				if (GuardZones.Contains(guardZone))
					TargetZones.Add(guardZone);
				else
					SourceZones.Add(guardZone);
			}
			TargetZones.Sort(x => x.No);
			SourceZones.Sort(x => x.No);

			SelectedTargetZone = TargetZones.FirstOrDefault();
			SelectedSourceZone = SourceZones.FirstOrDefault();
		}
		public DelaysSelectationViewModel(List<GKDelay> delays)
		{
			Title = "Выбор задержек";
			AddCommand = new RelayCommand<object>(OnAdd, CanAdd);
			RemoveCommand = new RelayCommand<object>(OnRemove, CanRemove);
			AddAllCommand = new RelayCommand(OnAddAll, CanAddAll);
			RemoveAllCommand = new RelayCommand(OnRemoveAll, CanRemoveAll);
			CreateNewCommand = new RelayCommand(OnCreateNew);

			Delays = delays;
			TargetDelays = new SortableObservableCollection<GKDelay>();
			SourceDelays = new SortableObservableCollection<GKDelay>();

			foreach (var delay in GKManager.DeviceConfiguration.Delays)
			{
				if (Delays.Contains(delay))
					TargetDelays.Add(delay);
				else
					SourceDelays.Add(delay);
			}
			TargetDelays.Sort(x => x.No);
			SourceDelays.Sort(x => x.No);

			SelectedTargetDelay = TargetDelays.FirstOrDefault();
			SelectedSourceDelay = SourceDelays.FirstOrDefault();
		}
Beispiel #5
0
        // Поиск потомков узла дерева сыслающегося на строку с ключом node_id
        private SortableObservableCollection <INode> GetChildren(int node_id, IEnumerable <Collect> list)
        {
            SortableObservableCollection <INode> tree = new SortableObservableCollection <INode>();

            foreach (Collect t in list.Where(n => n.Parent_id == node_id))
            {
                if (t.Type == "sheet") // конечный узел дерева - "лист"
                {
                    CSheet sheet = new CSheet();
                    sheet.Id       = t.Id;
                    sheet.ParentId = t.Parent_id;
                    sheet.Name     = t.Collect_name;
                    sheet.Dat      = t.DDate;
                    tree.Add(sheet);
                }
                else
                {
                    CNode node = new CNode();
                    node.Id       = t.Id;
                    node.Name     = t.Collect_name;
                    node.Children = GetChildren(t.Id, list);
                    tree.Add(node);
                }
            }
            tree.Sort(t => t.Name);
            return(tree);
        }
		public ZonesSelectationViewModel(List<GKZone> zones, bool canCreateNew = false)
		{
			Title = "Выбор зон";
			AddCommand = new RelayCommand<object>(OnAdd, CanAdd);
			RemoveCommand = new RelayCommand<object>(OnRemove, CanRemove);
			AddAllCommand = new RelayCommand(OnAddAll, CanAddAll);
			RemoveAllCommand = new RelayCommand(OnRemoveAll, CanRemoveAll);
			CreateNewCommand = new RelayCommand(OnCreateNew);

			Zones = zones;
			CanCreateNew = canCreateNew;
			TargetZones = new SortableObservableCollection<GKZone>();
			SourceZones = new SortableObservableCollection<GKZone>();

			foreach (var zone in GKManager.DeviceConfiguration.SortedZones)
			{
				if (Zones.Contains(zone))
					TargetZones.Add(zone);
				else
					SourceZones.Add(zone);
			}
			TargetZones.Sort(x => x.No);
			SourceZones.Sort(x => x.No);

			SelectedTargetZone = TargetZones.FirstOrDefault();
			SelectedSourceZone = SourceZones.FirstOrDefault();
		}
		public MPTsSelectationViewModel(List<GKMPT> mpts, bool canCreateNew = false)
		{
			Title = "Выбор МПТ";
			AddCommand = new RelayCommand<object>(OnAdd, CanAdd);
			RemoveCommand = new RelayCommand<object>(OnRemove, CanRemove);
			AddAllCommand = new RelayCommand(OnAddAll, CanAddAll);
			RemoveAllCommand = new RelayCommand(OnRemoveAll, CanRemoveAll);
			CreateNewCommand = new RelayCommand(OnCreateNew);

			MPTs = mpts;
			CanCreateNew = canCreateNew;
			TargetMPTs = new SortableObservableCollection<GKMPT>();
			SourceMPTs = new SortableObservableCollection<GKMPT>();

			foreach (var mpt in GKManager.DeviceConfiguration.MPTs)
			{
				if (MPTs.Contains(mpt))
					TargetMPTs.Add(mpt);
				else
					SourceMPTs.Add(mpt);
			}
			TargetMPTs.Sort(x => x.No);
			SourceMPTs.Sort(x => x.No);

			SelectedTargetMPT = TargetMPTs.FirstOrDefault();
			SelectedSourceMPT = SourceMPTs.FirstOrDefault();
		}
        /// <summary>
        /// Loads the values of the combobox cbxSelectedMultiSite and selects the predefined value, if was set
        /// </summary>
        private void LoadMultiSiteComboBox()
        {
            var tmp = new List <string>();

            tmp.Add(ApplicationSettings.AutomaticSite);

            var multiSiteList = _sites.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);

            foreach (var entry in multiSiteList)
            {
                var site = entry.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                tmp.Add(site[0]);
            }

            AvailableSites = new SortableObservableCollection <string>(tmp);
            AvailableSites.Sort(x => x.ToString(), ListSortDirection.Ascending);

            if ((ApplicationSettings.Instance.SelectedMultiSiteEntry != null) && (AvailableSites.Contains(ApplicationSettings.Instance.SelectedMultiSiteEntry)))
            {
                SelectedSite = ApplicationSettings.Instance.SelectedMultiSiteEntry;
            }
            else
            {
                SelectedSite = ApplicationSettings.AutomaticSite;
            }
        }
Beispiel #9
0
        /// <summary>
        /// Method can be invoked in PRISM MEF module registration to register a new document (viewmodel)
        /// type and its default file extension. The result of this call is an <seealso cref="IDocumentType"/>
        /// object and a <seealso cref="RegisterDocumentTypeEvent"/> event to inform listers about the new
        /// arrival of the new document type.
        /// </summary>
        /// <param name="key"></param>
        /// <param name="description"></param>
        /// <param name="fileFilterName"></param>
        /// <param name="defaultFilter"></param>
        /// <param name="fileOpenMethod"></param>
        /// <param name="createDocumentMethod"></param>
        /// <param name="t"></param>
        /// <param name="sortPriority"></param>
        /// <returns></returns>
        public IDocumentType RegisterDocumentType(string key,
                                                  string description,
                                                  string fileFilterName,
                                                  string defaultFilter,
                                                  FileOpenDelegate fileOpenMethod,
                                                  CreateNewDocumentDelegate createDocumentMethod,
                                                  Type t,
                                                  int sortPriority = 0)
        {
            try
            {
                Messaging.Output.Append(string.Format("{0} Registering document type: {1} ...",
                                                      DateTime.Now.ToLongTimeString(), description));

                var newFileType = new DocumentType(key, description, fileFilterName, defaultFilter,
                                                   fileOpenMethod, createDocumentMethod,
                                                   t, sortPriority);

                _DocumentTypes.Add(newFileType);
                _DocumentTypes.Sort(i => i.SortPriority, ListSortDirection.Ascending);

                return(newFileType);
            }
            catch (Exception exp)
            {
                Messaging.Output.AppendLine(exp.Message);
                Messaging.Output.AppendLine(exp.StackTrace);
            }
            finally
            {
                Messaging.Output.AppendLine("Done.");
            }

            return(null);
        }
		public DirectionsSelectationViewModel(List<GKDirection> directions)
		{
			Title = "Выбор направлений";
			AddCommand = new RelayCommand<object>(OnAdd, CanAdd);
			RemoveCommand = new RelayCommand<object>(OnRemove, CanRemove);
			AddAllCommand = new RelayCommand(OnAddAll, CanAddAll);
			RemoveAllCommand = new RelayCommand(OnRemoveAll, CanRemoveAll);
			CreateNewCommand = new RelayCommand(OnCreateNew);

			Directions = directions;
			TargetDirections = new SortableObservableCollection<GKDirection>();
			SourceDirections = new SortableObservableCollection<GKDirection>();

			foreach (var direction in GKManager.Directions)
			{
				if (Directions.Contains(direction))
					TargetDirections.Add(direction);
				else
					SourceDirections.Add(direction);
			}
			TargetDirections.Sort(x => x.No);
			SourceDirections.Sort(x => x.No);

			SelectedTargetDirection = TargetDirections.FirstOrDefault();
			SelectedSourceDirection = SourceDirections.FirstOrDefault();
		}
Beispiel #11
0
		public void Initialize()
		{
			IsNowPlaying = false;
			Sounds = new SortableObservableCollection<SoundViewModel>();
			var stateClasses = new List<Tuple<XStateClass, SoundType>>();

			stateClasses.Add(new Tuple<XStateClass, SoundType>(XStateClass.Fire1, SoundType.Fire1));
			stateClasses.Add(new Tuple<XStateClass, SoundType>(XStateClass.Fire2, SoundType.Fire2));
			stateClasses.Add(new Tuple<XStateClass, SoundType>(XStateClass.Attention, SoundType.Attention));
			stateClasses.Add(new Tuple<XStateClass, SoundType>(XStateClass.Fire1, SoundType.Alarm));
			stateClasses.Add(new Tuple<XStateClass, SoundType>(XStateClass.Failure, SoundType.Failure));
			stateClasses.Add(new Tuple<XStateClass, SoundType>(XStateClass.Off, SoundType.Off));
			stateClasses.Add(new Tuple<XStateClass, SoundType>(XStateClass.TurningOn, SoundType.TurningOn));
			stateClasses.Add(new Tuple<XStateClass, SoundType>(XStateClass.TurningOff, SoundType.StopStart));
			stateClasses.Add(new Tuple<XStateClass, SoundType>(XStateClass.AutoOff, SoundType.AutoOff));

			foreach (var stateClass in stateClasses)
			{
				var newSound = new Sound() { StateClass = stateClass.Item1, Type = stateClass.Item2 };

				var sound = ClientManager.SystemConfiguration.Sounds.FirstOrDefault(x => x.Type == stateClass.Item2);
				if (sound == null)
					ClientManager.SystemConfiguration.Sounds.Add(newSound);
				else
					newSound = sound;

				Sounds.Add(new SoundViewModel(newSound));
			}

			Sounds.Sort(x => EnumHelper.GetEnumDescription(x.SoundType));
			SelectedSound = Sounds.FirstOrDefault();

			if (ClientManager.SystemConfiguration.Sounds.RemoveAll(x => !Sounds.Any(y => y.SoundType == x.Type)) > 0)
				ServiceFactory.SaveService.SoundsChanged = true;
		}
		public PumpStationsSelectationViewModel(List<GKPumpStation> pumpStations)
		{
			Title = "Выбор насосных станций";
			AddCommand = new RelayCommand<object>(OnAdd, CanAdd);
			RemoveCommand = new RelayCommand<object>(OnRemove, CanRemove);
			AddAllCommand = new RelayCommand(OnAddAll, CanAddAll);
			RemoveAllCommand = new RelayCommand(OnRemoveAll, CanRemoveAll);
			CreateNewCommand = new RelayCommand(OnCreateNew);

			PumpStations = pumpStations;
			TargetPumpStations = new SortableObservableCollection<GKPumpStation>();
			SourcePumpStations = new SortableObservableCollection<GKPumpStation>();

			foreach (var pumpStation in GKManager.PumpStations)
			{
				if (PumpStations.Contains(pumpStation))
					TargetPumpStations.Add(pumpStation);
				else
					SourcePumpStations.Add(pumpStation);
			}
			TargetPumpStations.Sort(x => x.No);
			SourcePumpStations.Sort(x => x.No);

			SelectedTargetPumpStation = TargetPumpStations.FirstOrDefault();
			SelectedSourcePumpStation = SourcePumpStations.FirstOrDefault();
		}
        public void SortTest()
        {
            SortableObservableCollection <TournamentVw> Tournaments = new SortableObservableCollection <TournamentVw>();

            Tournaments.Add(new TournamentVw(1, 1, "AMyTournament", 0, 0, null, ""));
            Tournaments.Add(new TournamentVw(3, 1, "CMyTournament", 0, 0, null, ""));
            Tournaments.Add(new TournamentVw(4, 1, "AMyTournament", 0, 0, null, ""));
            Tournaments.Add(new TournamentVw(2, 1, "AMyTournament", 0, 0, null, ""));
            Tournaments.Add(new TournamentVw(5, 1, "DMyTournament", 0, 0, null, ""));
            Tournaments.Add(new TournamentVw(6, 1, "GMyTournament", 0, 0, null, ""));
            Tournaments.Add(new TournamentVw(8, 1, "ZMyTournament", 0, 0, null, ""));
            Tournaments.Add(new TournamentVw(7, 1, "KMyTournament", 0, 0, null, ""));
            Tournaments.Add(new TournamentVw(10, 1, "LMyTournament", 0, 0, null, ""));
            Tournaments.Add(new TournamentVw(9, 1, "AMyTournament", 0, 0, null, ""));

            Tournaments.Sort(TournamentsViewModel.Comparison);

            Assert.AreEqual(1, Tournaments[0].Id);
            Assert.AreEqual(2, Tournaments[1].Id);
            Assert.AreEqual(4, Tournaments[2].Id);
            Assert.AreEqual(9, Tournaments[3].Id);
            Assert.AreEqual(3, Tournaments[4].Id);
            Assert.AreEqual(5, Tournaments[5].Id);
            Assert.AreEqual(6, Tournaments[6].Id);
            Assert.AreEqual(7, Tournaments[7].Id);
            Assert.AreEqual(10, Tournaments[8].Id);
            Assert.AreEqual(8, Tournaments[9].Id);
        }
Beispiel #14
0
        public async Task <ObservableCollection <CatalogItem> > GetCatalogAsync()
        {
            await Task.Delay(10);

            MockCatalog.Sort(p => p.Id);
            return(MockCatalog);
        }
Beispiel #15
0
        public void Add(double r, double h)
        {
            Point p = new Point(r, h);

            if (_profile.Contains(p))
            {
                return;
            }
            else
            {
                _profile.Add(p);
            }

            if (_profile.Count > 1)
            {
                _profile.Sort <Point>((Point pt) => pt, _xascending);
            }
        }
        public void SortPausedSoccerLiveMonitor()
        {
            SortableObservableCollection <IMatchVw> collection = new SortableObservableCollection <IMatchVw>();

            collection.Add(new TestMatchVw()
            {
                SportDescriptor = SportSr.SPORT_DESCRIPTOR_SOCCER, IsLiveBet = true, LiveBetStatus = eMatchStatus.Started, LiveMatchMinuteEx = 45, LivePeriodInfo = eLivePeriodInfo.Soccer_1st_Period, Name = "test1", SportView = new TestGroupVw()
                {
                    DisplayName = "s", LineObject = new GroupLn()
                    {
                        Sort = { Value = 2 }
                    }
                }, StartDate = new DateTime(2013, 1, 2)
            });                                                                                                                                                                                                                                                                                                                                                                                         //should be third
            collection.Add(new TestMatchVw()
            {
                SportDescriptor = SportSr.SPORT_DESCRIPTOR_SOCCER, IsLiveBet = true, LiveBetStatus = eMatchStatus.Started, LiveMatchMinuteEx = 45, LivePeriodInfo = eLivePeriodInfo.Paused, Name = "test2", SportView = new TestGroupVw()
                {
                    DisplayName = "t", LineObject = new GroupLn()
                    {
                        Sort = { Value = 2 }
                    }
                }, StartDate = new DateTime(2013, 1, 1)
            });                                                                                                                                                                                                                                                                                                                                                                              //should be second
            collection.Add(new TestMatchVw()
            {
                SportDescriptor = SportSr.SPORT_DESCRIPTOR_SOCCER, IsLiveBet = true, LiveBetStatus = eMatchStatus.Started, LiveMatchMinuteEx = 20, LivePeriodInfo = eLivePeriodInfo.Soccer_1st_Period, Name = "test3", SportView = new TestGroupVw()
                {
                    DisplayName = "t", LineObject = new GroupLn()
                    {
                        Sort = { Value = 2 }
                    }
                }, StartDate = new DateTime(2013, 1, 2)
            });                                                                                                                                                                                                                                                                                                                                                                                         //should be forth
            collection.Add(new TestMatchVw()
            {
                SportDescriptor = SportSr.SPORT_DESCRIPTOR_SOCCER, IsLiveBet = true, LiveBetStatus = eMatchStatus.Started, LiveMatchMinuteEx = 50, LivePeriodInfo = eLivePeriodInfo.Soccer_2nd_Period, Name = "test4", SportView = new TestGroupVw()
                {
                    DisplayName = "t", LineObject = new GroupLn()
                    {
                        Sort = { Value = 2 }
                    }
                }, StartDate = new DateTime(2013, 1, 1)
            });                                                                                                                                                                                                                                                                                                                                                                                         //should be first

            var groupln = new GroupLn {
                Sort = { Value = 1 }
            };

            collection.Sort(LiveMonitorsService.Comparison);

            Assert.AreEqual("test4", collection[0].Name); //s
            Assert.AreEqual("test2", collection[1].Name); //s
            Assert.AreEqual("test1", collection[2].Name); //s
            Assert.AreEqual("test3", collection[3].Name); //s
        }
Beispiel #17
0
        public void GenerateTickets()
        {
            MainWindow window = new MainWindow();
            var        random = new Random();

            window.generator = new KenoLoader();
            var generator = (KenoLoader)window.generator;

            generator.Path = "test.xml";
            generator.Load();
            var player = new Player()
            {
                Name = "Loaded4", NumberOfTickets = 28, Stake = 1, Money = 100, System = 6, HotNumbers = 7, ColdNumbers = 0, HotRange = 11, ColdRange = 21, StatRange = 1
            };

            for (int i = 7800; i < generator.results.Count; i++)
            {
                var numbers = window.generator.Generate();
                foreach (var numberStat in window.NumbersStatistic)
                {
                    numberStat.Appear(numbers.Contains(numberStat.Number));
                }
                var tempStat = new SortableObservableCollection <NumberStat>();
                tempStat.Sync(window.NumbersStatistic);
                tempStat.Sort(x => x.TimesAppear(player.StatRange), ListSortDirection.Descending);

                window.GenerateNumbersBuyTickets(player, window.NumbersStatistic, random);
                var wonMoney = Calculate.CalculateTickets(numbers, player.Tickets);
                Console.WriteLine(wonMoney);
            }


            //foreach (var ticket in player.Tickets)
            //{
            //    foreach (var number in ticket.Numbers)
            //    {
            //        Console.Write(number + ";");
            //    }
            //    Console.WriteLine("\t" + ticket.wonNumbers + " " + ticket.wonAmount);
            //}
            Console.WriteLine();

            window.GenerateNumbersBuyTickets(player, window.NumbersStatistic, random);

            foreach (var ticket in player.Tickets)
            {
                foreach (var number in ticket.Numbers)
                {
                    Console.Write(number + " ");
                }
                Console.WriteLine();
            }
        }
Beispiel #18
0
        /// <summary>
        /// Method can be invoked in PRISM MEF module registration to register a new document (viewmodel)
        /// type and its default file extension. The result of this call is an <seealso cref="IDocumentType"/>
        /// object and a <seealso cref="RegisterDocumentTypeEvent"/> event to inform listers about the new
        /// arrival of the new document type.
        /// </summary>
        /// <param name="key"></param>
        /// <param name="description"></param>
        /// <param name="fileFilterName"></param>
        /// <param name="defaultFilter"></param>
        /// <param name="fileOpenMethod"></param>
        /// <param name="createDocumentMethod"></param>
        /// <param name="t"></param>
        /// <param name="sortPriority"></param>
        /// <returns></returns>
        public IDocumentType RegisterDocumentType(string key,
                                                  string description,
                                                  string fileFilterName,
                                                  string defaultFilter,
                                                  FileOpenDelegate fileOpenMethod,
                                                  CreateNewDocumentDelegate createDocumentMethod,
                                                  Type t,
                                                  int sortPriority = 0)
        {
            var newFileType = new DocumentType(key, description, fileFilterName, defaultFilter,
                                               fileOpenMethod, createDocumentMethod,
                                               t, sortPriority);

            _mDocumentTypes.Add(newFileType);
            _mDocumentTypes.Sort(i => i.SortPriority, ListSortDirection.Ascending);

            return(newFileType);
        }
Beispiel #19
0
        // Герерация структуры дерева из таблицы БД
        public void GenerateTree()
        {
            db.Collects.Load();

            IEnumerable <Collect> list = db.Collects.Local;

            SortableObservableCollection <INode> tree = new SortableObservableCollection <INode>();

            foreach (Collect t in db.Collects.Local.Where(t => t.Parent_id is null)) // выбираем корневые узлы дерева
            {
                CNode node = new CNode();
                node.Id       = t.Id;
                node.Name     = t.Collect_name;
                node.Children = GetChildren(t.Id, list); // поискпотомков корневого узла
                tree.Add(node);
            }
            tree.Sort(t => t.Name);
            treeColl.ItemsSource = tree;
        }
		public DoorsSelectationViewModel(List<GKDoor> doors, List<GKDoorType> doorsTypes = null)
		{
			Title = "Выбор точек доступа";
			AddCommand = new RelayCommand<object>(OnAdd, CanAdd);
			RemoveCommand = new RelayCommand<object>(OnRemove, CanRemove);
			AddAllCommand = new RelayCommand(OnAddAll, CanAddAll);
			RemoveAllCommand = new RelayCommand(OnRemoveAll, CanRemoveAll);
			CreateNewCommand = new RelayCommand(OnCreateNew);

			Doors = doors;
			TargetDoors = new SortableObservableCollection<GKDoor>();
			SourceDoors = new SortableObservableCollection<GKDoor>();

			var allDoors = GKManager.DeviceConfiguration.Doors;
			if (doorsTypes != null)
			{
				var filteredDoors = new List<GKDoor>();
				foreach (var door in allDoors)
					foreach (var doorType in doorsTypes)
					{
						if (door.DoorType == doorType)
						{
							filteredDoors.Add(door);
							break;
						}
					}
				allDoors = filteredDoors;
			}
			foreach (var door in allDoors)
			{
				if (Doors.Contains(door))
					TargetDoors.Add(door);
				else
					SourceDoors.Add(door);
			}
			TargetDoors.Sort(x => x.No);
			SourceDoors.Sort(x => x.No);

			SelectedTargetDoor = TargetDoors.FirstOrDefault();
			SelectedSourceDoor = SourceDoors.FirstOrDefault();
		}
        public void SortSports()
        {
            SortableObservableCollection <IMatchVw> collection = new SortableObservableCollection <IMatchVw>();

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = true, LiveBetStatus = eMatchStatus.Started, LiveMatchMinute = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test1", SportDescriptor = "SPRT_BASKETBALL", SportView = new TestGroupVw()
                {
                    DisplayName = "b", LineObject = new GroupLn()
                    {
                        Sort = { Value = 3 }
                    }
                }, StartDate = new DateTime(2013, 1, 1), DefaultSorting = 3
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = true, LiveBetStatus = eMatchStatus.Started, LiveMatchMinute = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test2", SportDescriptor = "SPRT_SOCCER", SportView = new TestGroupVw()
                {
                    DisplayName = "s", LineObject = new GroupLn()
                    {
                        Sort = { Value = 1 }
                    }
                }, StartDate = new DateTime(2013, 1, 1), DefaultSorting = 1
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = true, LiveBetStatus = eMatchStatus.Started, LiveMatchMinute = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test3", SportDescriptor = "SPRT_ICEH", SportView = new TestGroupVw()
                {
                    DisplayName = "h", LineObject = new GroupLn()
                    {
                        Sort = { Value = 4 }
                    }
                }, StartDate = new DateTime(2013, 1, 2), DefaultSorting = 4
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = true, LiveBetStatus = eMatchStatus.Started, LiveMatchMinute = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test4", SportDescriptor = "SPRT_TENNIS", SportView = new TestGroupVw()
                {
                    DisplayName = "t", LineObject = new GroupLn()
                    {
                        Sort = { Value = 2 }
                    }
                }, StartDate = new DateTime(2013, 1, 1), DefaultSorting = 2
            });



            collection.Sort(LiveMonitorsService.Comparison);
            LiveMonitorsService.UpdateHeaders(collection);

            Assert.AreEqual("s", collection[0].SportView.DisplayName); //s
            Assert.AreEqual("t", collection[1].SportView.DisplayName); //s
            Assert.AreEqual("b", collection[2].SportView.DisplayName); //s
            Assert.AreEqual("h", collection[3].SportView.DisplayName); //s


            Assert.AreEqual(true, collection[0].IsHeaderForLiveMonitor);
            Assert.AreEqual(true, collection[1].IsHeaderForLiveMonitor);
            Assert.AreEqual(true, collection[2].IsHeaderForLiveMonitor);
            Assert.AreEqual(true, collection[3].IsHeaderForLiveMonitor);
        }
Beispiel #22
0
        public void SearchViewModelSortingTest()
        {
            SortableObservableCollection <IMatchVw> collection = new SortableObservableCollection <IMatchVw>();

            collection.Add(new TestMatchVw()
            {
                IsLiveBet       = true,
                TournamentView  = TestGroupVw.CreateGroup(1, false),
                LiveBetStatus   = eMatchStatus.Started,
                LiveMatchMinute = 1,
                LivePeriodInfo  = eLivePeriodInfo.Basketball_1st_Quarter,
                Name            = "test1",
                SportView       = new TestGroupVw()
                {
                    DisplayName = "b", LineObject = new GroupLn()
                    {
                        Sort = { Value = 3 }
                    }
                },
                StartDate = new DateTime(2013, 1, 1)
            });
            collection.Add(new TestMatchVw()
            {
                IsLiveBet       = true,
                TournamentView  = TestGroupVw.CreateGroup(1, false),
                LiveBetStatus   = eMatchStatus.Started,
                LiveMatchMinute = 1,
                LivePeriodInfo  = eLivePeriodInfo.Basketball_1st_Quarter,
                Name            = "test2",
                SportView       = new TestGroupVw()
                {
                    DisplayName = "s", LineObject = new GroupLn()
                    {
                        Sort = { Value = 1 }
                    }
                },
                StartDate = new DateTime(2013, 1, 2)
            });
            collection.Add(new TestMatchVw()
            {
                IsLiveBet       = true,
                TournamentView  = TestGroupVw.CreateGroup(1, false),
                LiveBetStatus   = eMatchStatus.Started,
                LiveMatchMinute = 1,
                LivePeriodInfo  = eLivePeriodInfo.Basketball_1st_Quarter,
                Name            = "test3",
                SportView       = new TestGroupVw()
                {
                    DisplayName = "h", LineObject = new GroupLn()
                    {
                        Sort = { Value = 4 }
                    }
                },
                StartDate = new DateTime(2013, 1, 3)
            });
            collection.Add(new TestMatchVw()
            {
                IsLiveBet       = true,
                TournamentView  = TestGroupVw.CreateGroup(1, false),
                LiveBetStatus   = eMatchStatus.Started,
                LiveMatchMinute = 1,
                LivePeriodInfo  = eLivePeriodInfo.Basketball_1st_Quarter,
                Name            = "test4",
                SportView       = new TestGroupVw()
                {
                    DisplayName = "t", LineObject = new GroupLn()
                    {
                        Sort = { Value = 2 }
                    }
                },
                StartDate = new DateTime(2013, 1, 4)
            });


            collection.Sort(SearchViewModel.Comparison);

            Assert.AreEqual("test1", collection[0].Name);
            Assert.AreEqual("test2", collection[1].Name);
            Assert.AreEqual("test3", collection[2].Name);
            Assert.AreEqual("test4", collection[3].Name);
        }
        public void SameSport()
        {
            SortableObservableCollection <IMatchVw> collection = new SortableObservableCollection <IMatchVw>();

            collection.Add(new TestMatchVw()
            {
                SportDescriptor = "SPRT_SOCCER", IsLiveBet = false, LiveBetStatus = eMatchStatus.Undefined, LiveMatchMinute = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test1", SportView = new TestGroupVw()
                {
                    DisplayName = "s"
                }, StartDate = new DateTime(2013, 1, 5)
            });

            collection.Add(new TestMatchVw()
            {
                SportDescriptor = "SPRT_SOCCER", IsLiveBet = true, LiveBetStatus = eMatchStatus.Started, LiveMatchMinute = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test2", SportView = new TestGroupVw()
                {
                    DisplayName = "s"
                }, StartDate = new DateTime(2013, 1, 2)
            });

            collection.Add(new TestMatchVw()
            {
                SportDescriptor = "SPRT_SOCCER", IsLiveBet = false, LiveBetStatus = eMatchStatus.Undefined, LiveMatchMinute = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test3", SportView = new TestGroupVw()
                {
                    DisplayName = "s"
                }, StartDate = new DateTime(2013, 1, 3)
            });

            collection.Add(new TestMatchVw()
            {
                SportDescriptor = "SPRT_SOCCER", IsLiveBet = true, LiveBetStatus = eMatchStatus.Stopped, LiveMatchMinute = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test4", SportView = new TestGroupVw()
                {
                    DisplayName = "s"
                }, StartDate = new DateTime(2013, 1, 4)
            });


            collection.Sort(LiveMonitorsService.Comparison);
            LiveMonitorsService.UpdateHeaders(collection);

            Assert.AreEqual("test2", collection[0].Name); //s
            Assert.AreEqual("test4", collection[1].Name); //s
            Assert.AreEqual("test3", collection[2].Name); //s
            Assert.AreEqual("test1", collection[3].Name); //s


            Assert.AreEqual(true, collection[0].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[1].IsHeaderForLiveMonitor);
            Assert.AreEqual(true, collection[2].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[3].IsHeaderForLiveMonitor);


            collection = new SortableObservableCollection <IMatchVw>(collection.OrderByDescending(x => x.Name).ToList());

            collection.Sort(LiveMonitorsService.Comparison);
            LiveMonitorsService.UpdateHeaders(collection);

            Assert.AreEqual("test2", collection[0].Name); //s
            Assert.AreEqual("test4", collection[1].Name); //s
            Assert.AreEqual("test3", collection[2].Name); //s
            Assert.AreEqual("test1", collection[3].Name); //s

            Assert.AreEqual(true, collection[0].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[1].IsHeaderForLiveMonitor);
            Assert.AreEqual(true, collection[2].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[3].IsHeaderForLiveMonitor);
        }
        private void LoadDataInBackground()
        {
            if (App.RtmClient.TaskLists != null)
            {
                var tempTaskLists = new SortableObservableCollection<TaskList>();

                var tempOverdueTasks = new SortableObservableCollection<Task>();
                var tempTodayTasks = new SortableObservableCollection<Task>();
                var tempTomorrowTasks = new SortableObservableCollection<Task>();
                var tempWeekTasks = new SortableObservableCollection<Task>();
                var tempNoDueTasks = new SortableObservableCollection<Task>();

                var tempTags = new SortableObservableCollection<string>();

                foreach (TaskList l in App.RtmClient.TaskLists)
                {
                    tempTaskLists.Add(l);

                    if (l.IsNormal && l.Tasks != null)
                    {
                        foreach (Task task in l.Tasks)
                        {
                            // add tags
                            foreach (string tag in task.Tags)
                            {
                                if (!tempTags.Contains(tag)) tempTags.Add(tag);
                            }

                            if (task.IsIncomplete)
                            {
                                if (task.DueDateTime.HasValue)
                                {
                                    // overdue
                                    if (task.DueDateTime.Value < DateTime.Today || (task.HasDueTime && task.DueDateTime.Value < DateTime.Now))
                                    {
                                        tempOverdueTasks.Add(task);
                                    }
                                    // today
                                    else if (task.DueDateTime.Value.Date == DateTime.Today)
                                    {
                                        tempTodayTasks.Add(task);
                                    }
                                    // tomorrow
                                    else if (task.DueDateTime.Value.Date == DateTime.Today.AddDays(1))
                                    {
                                        tempTomorrowTasks.Add(task);
                                    }
                                    // this week
                                    else if (task.DueDateTime.Value.Date > DateTime.Today.AddDays(1) && task.DueDateTime.Value.Date <= DateTime.Today.AddDays(6))
                                    {
                                        tempWeekTasks.Add(task);
                                    }
                                }
                                else
                                {
                                    // no due
                                    tempNoDueTasks.Add(task);
                                }
                            }
                        }
                    }
                }

                tempOverdueTasks.Sort();
                tempTodayTasks.Sort();
                tempTomorrowTasks.Sort();
                tempWeekTasks.Sort();
                tempNoDueTasks.Sort();

                tempTags.Sort();

                SmartDispatcher.BeginInvoke(() =>
                {
                    TaskLists = tempTaskLists;

                    TodayTasks = tempTodayTasks;
                    TomorrowTasks = tempTomorrowTasks;
                    OverdueTasks = tempOverdueTasks;
                    WeekTasks = tempWeekTasks;
                    NoDueTasks = tempNoDueTasks;

                    Tags = tempTags;
                });
            }
        }
        public void DifferentSportsSort()
        {
            SortableObservableCollection <IMatchVw> collection = new SortableObservableCollection <IMatchVw>();

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = true, LiveBetStatus = eMatchStatus.NotStarted, LiveMatchMinuteEx = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test1", SportDescriptor = "SPRT_SOCCER", SportView = new TestGroupVw()
                {
                    DisplayName = "s", LineObject = new GroupLn()
                    {
                        Sort = { Value = 1 }
                    }
                }, StartDate = new DateTime(2013, 1, 1), DefaultSorting = 1
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = true, LiveBetStatus = eMatchStatus.Started, LiveMatchMinuteEx = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test2", SportDescriptor = "SPRT_TENNIS", SportView = new TestGroupVw()
                {
                    DisplayName = "t", LineObject = new GroupLn()
                    {
                        Sort = { Value = 2 }
                    }
                }, StartDate = new DateTime(2013, 1, 1), DefaultSorting = 2
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = true, LiveBetStatus = eMatchStatus.Started, LiveMatchMinuteEx = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test3", SportDescriptor = "SPRT_TENNIS", SportView = new TestGroupVw()
                {
                    DisplayName = "t", LineObject = new GroupLn()
                    {
                        Sort = { Value = 2 }
                    }
                }, StartDate = new DateTime(2013, 1, 2), DefaultSorting = 2
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = true, LiveBetStatus = eMatchStatus.Stopped, LiveMatchMinuteEx = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test4", SportDescriptor = "SPRT_TENNIS", SportView = new TestGroupVw()
                {
                    DisplayName = "t", LineObject = new GroupLn()
                    {
                        Sort = { Value = 2 }
                    }
                }, StartDate = new DateTime(2013, 1, 1), DefaultSorting = 2
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = true, LiveBetStatus = eMatchStatus.Stopped, LiveMatchMinuteEx = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test5", SportDescriptor = "SPRT_SOCCER", SportView = new TestGroupVw()
                {
                    DisplayName = "s", LineObject = new GroupLn()
                    {
                        Sort = { Value = 1 }
                    }
                }, StartDate = new DateTime(2013, 1, 2), DefaultSorting = 1
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = false, LiveBetStatus = eMatchStatus.Undefined, LiveMatchMinuteEx = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test6", SportDescriptor = "SPRT_SOCCER", SportView = new TestGroupVw()
                {
                    DisplayName = "s", LineObject = new GroupLn()
                    {
                        Sort = { Value = 1 }
                    }
                }, StartDate = new DateTime(2013, 1, 2), DefaultSorting = 1
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = true, LiveBetStatus = eMatchStatus.NotStarted, LiveMatchMinuteEx = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test7", SportDescriptor = "SPRT_TENNIS", SportView = new TestGroupVw()
                {
                    DisplayName = "t", LineObject = new GroupLn()
                    {
                        Sort = { Value = 2 }
                    }
                }, StartDate = new DateTime(2013, 1, 3), DefaultSorting = 2
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = true, LiveBetStatus = eMatchStatus.Stopped, LiveMatchMinuteEx = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test8", SportDescriptor = "SPRT_SOCCER", SportView = new TestGroupVw()
                {
                    DisplayName = "s", LineObject = new GroupLn()
                    {
                        Sort = { Value = 1 }
                    }
                }, StartDate = new DateTime(2013, 1, 1), DefaultSorting = 1
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = false, LiveBetStatus = eMatchStatus.Undefined, LiveMatchMinuteEx = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test9", SportDescriptor = "SPRT_SOCCER", SportView = new TestGroupVw()
                {
                    DisplayName = "s", LineObject = new GroupLn()
                    {
                        Sort = { Value = 1 }
                    }
                }, StartDate = new DateTime(2013, 1, 4), DefaultSorting = 1
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = true, LiveBetStatus = eMatchStatus.Stopped, LiveMatchMinuteEx = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test10", SportDescriptor = "SPRT_TENNIS", SportView = new TestGroupVw()
                {
                    DisplayName = "t", LineObject = new GroupLn()
                    {
                        Sort = { Value = 2 }
                    }
                }, StartDate = new DateTime(2013, 1, 2), DefaultSorting = 2
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = false, LiveBetStatus = eMatchStatus.Undefined, LiveMatchMinuteEx = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test11", SportDescriptor = "SPRT_TENNIS", SportView = new TestGroupVw()
                {
                    DisplayName = "t", LineObject = new GroupLn()
                    {
                        Sort = { Value = 2 }
                    }
                }, StartDate = new DateTime(2013, 1, 5), DefaultSorting = 2
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = true, LiveBetStatus = eMatchStatus.Started, LiveMatchMinuteEx = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test12", SportDescriptor = "SPRT_SOCCER", SportView = new TestGroupVw()
                {
                    DisplayName = "s", LineObject = new GroupLn()
                    {
                        Sort = { Value = 1 }
                    }
                }, StartDate = new DateTime(2013, 1, 1), DefaultSorting = 1
            });

            collection.Add(new TestMatchVw()
            {
                IsLiveBet = true, LiveBetStatus = eMatchStatus.Started, LiveMatchMinuteEx = 1, LivePeriodInfo = eLivePeriodInfo.Basketball_1st_Quarter, Name = "test13", SportDescriptor = "SPRT_SOCCER", SportView = new TestGroupVw()
                {
                    DisplayName = "s", LineObject = new GroupLn()
                    {
                        Sort = { Value = 1 }
                    }
                }, StartDate = new DateTime(2013, 1, 2), DefaultSorting = 1
            });

            var groupln = new GroupLn {
                Sort = { Value = 1 }
            };

            collection.Sort(LiveMonitorsService.Comparison);
            LiveMonitorsService.UpdateHeaders(collection);

            Assert.AreEqual("test12", collection[0].Name);  //s
            Assert.AreEqual("test8", collection[1].Name);   //s
            Assert.AreEqual("test13", collection[2].Name);  //s
            Assert.AreEqual("test5", collection[3].Name);   //s
            Assert.AreEqual("test2", collection[4].Name);   //t
            Assert.AreEqual("test4", collection[5].Name);   //t
            Assert.AreEqual("test10", collection[6].Name);  //t
            Assert.AreEqual("test3", collection[7].Name);   //t
            Assert.AreEqual("test1", collection[8].Name);   //s
            Assert.AreEqual("test6", collection[9].Name);   //s
            Assert.AreEqual("test9", collection[10].Name);  //s
            Assert.AreEqual("test7", collection[11].Name);  //t
            Assert.AreEqual("test11", collection[12].Name); //t

            Assert.AreEqual(true, collection[0].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[1].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[2].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[3].IsHeaderForLiveMonitor);
            Assert.AreEqual(true, collection[4].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[5].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[6].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[7].IsHeaderForLiveMonitor);
            Assert.AreEqual(true, collection[8].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[9].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[10].IsHeaderForLiveMonitor);
            Assert.AreEqual(true, collection[11].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[12].IsHeaderForLiveMonitor);

            collection = new SortableObservableCollection <IMatchVw>(collection.OrderByDescending(x => x.Name).ToList());

            collection.Sort(LiveMonitorsService.Comparison);
            LiveMonitorsService.UpdateHeaders(collection);

            Assert.AreEqual("test12", collection[0].Name);  //s
            Assert.AreEqual("test8", collection[1].Name);   //s
            Assert.AreEqual("test13", collection[2].Name);  //s
            Assert.AreEqual("test5", collection[3].Name);   //s
            Assert.AreEqual("test2", collection[4].Name);   //t
            Assert.AreEqual("test4", collection[5].Name);   //t
            Assert.AreEqual("test10", collection[6].Name);  //t
            Assert.AreEqual("test3", collection[7].Name);   //t
            Assert.AreEqual("test1", collection[8].Name);   //s
            Assert.AreEqual("test6", collection[9].Name);   //s
            Assert.AreEqual("test9", collection[10].Name);  //s
            Assert.AreEqual("test7", collection[11].Name);  //t
            Assert.AreEqual("test11", collection[12].Name); //t

            Assert.AreEqual(true, collection[0].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[1].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[2].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[3].IsHeaderForLiveMonitor);
            Assert.AreEqual(true, collection[4].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[5].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[6].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[7].IsHeaderForLiveMonitor);
            Assert.AreEqual(true, collection[8].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[9].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[10].IsHeaderForLiveMonitor);
            Assert.AreEqual(true, collection[11].IsHeaderForLiveMonitor);
            Assert.AreEqual(false, collection[12].IsHeaderForLiveMonitor);
        }
		void UpdateGrid()
		{
			using (new WaitWrapper())
			{
				var employeeUID = Guid.Empty;

				if (SelectedTimeTrack != null)
				{
					employeeUID = SelectedTimeTrack.ShortEmployee.UID;
				}

				TotalDays = (int)(TimeTrackFilter.EndDate - TimeTrackFilter.StartDate).TotalDays + 1;
				FirstDay = TimeTrackFilter.StartDate;

				TimeTracks = new SortableObservableCollection<TimeTrackViewModel>();
				var stream = ClientManager.RubezhService.GetTimeTracksStream(TimeTrackFilter.EmployeeFilter, TimeTrackFilter.StartDate, TimeTrackFilter.EndDate);
				var folderName = AppDataFolderHelper.GetFolder("TempServer");
				var resultFileName = Path.Combine(folderName, "ClientTimeTrackResult.xml");
				var resultFileStream = File.Create(resultFileName);
				CopyStream(stream, resultFileStream);
				var timeTrackResult = Deserialize(resultFileName);

				if (timeTrackResult != null)
				{
					TimeTrackEmployeeResults = timeTrackResult.TimeTrackEmployeeResults;
					foreach (var timeTrackEmployeeResult in TimeTrackEmployeeResults)
					{
						var timeTrackViewModel = new TimeTrackViewModel(TimeTrackFilter, timeTrackEmployeeResult);
						TimeTracks.Add(timeTrackViewModel);
					}

					TimeTracks.Sort(x => x.ShortEmployee.LastName);
					RowHeight = 60 + 20 * TimeTrackFilter.TotalTimeTrackTypeFilters.Count;
				}

				SelectedTimeTrack = TimeTracks.FirstOrDefault(x => x.ShortEmployee.UID == employeeUID) ??
									TimeTracks.FirstOrDefault();
			}
		}