Esempio n. 1
0
        public void SetTarget(ShipCatalogSortTarget sortTarget, bool reverse)
        {
            var target = this.sortableColumns.FirstOrDefault(x => x.Target == sortTarget);

            if (target == null)
            {
                return;
            }

            if (reverse)
            {
                switch (target.Direction)
                {
                case SortDirection.None:
                    target.Direction = SortDirection.Descending;
                    break;

                case SortDirection.Descending:
                    target.Direction = SortDirection.Ascending;
                    break;

                case SortDirection.Ascending:
                    target = this.noneColumn;
                    break;
                }
            }
            else
            {
                switch (target.Direction)
                {
                case SortDirection.None:
                    target.Direction = SortDirection.Ascending;
                    break;

                case SortDirection.Ascending:
                    target.Direction = SortDirection.Descending;
                    break;

                case SortDirection.Descending:
                    target = this.noneColumn;
                    break;
                }
            }

            this.currentSortTarget = target;
            this.sortableColumns.Where(x => x.Target != target.Target).ForEach(x => x.Direction = SortDirection.None);
        }
        public ShipCatalogSortWorker()
        {
            this.IdColumn = new IdColumnViewModel();
            this.TypeColumn = new TypeColumnViewModel();
            this.NameColumn = new NameColumnViewModel();
            this.LevelColumn = new LevelColumnViewModel();
            this.ConditionColumn = new ConditionColumnViewModel();

            this.sortableColumns = new List<SortableColumnViewModel>
            {
                this.noneColumn,
                this.IdColumn,
                this.TypeColumn,
                this.NameColumn,
                this.LevelColumn,
                this.ConditionColumn,
            };

            this.currentSortTarget = this.noneColumn;
        }
Esempio n. 3
0
        public ShipCatalogSortWorker()
        {
            this.IdColumn        = new IdColumnViewModel();
            this.TypeColumn      = new TypeColumnViewModel();
            this.NameColumn      = new NameColumnViewModel();
            this.LevelColumn     = new LevelColumnViewModel();
            this.ConditionColumn = new ConditionColumnViewModel();
            this.ViewRangeColumn = new ViewRangeColumnViewModel();

            this.sortableColumns = new List <SortableColumnViewModel>
            {
                this.noneColumn,
                this.IdColumn,
                this.TypeColumn,
                this.NameColumn,
                this.LevelColumn,
                this.ConditionColumn,
                this.ViewRangeColumn,
            };

            this.currentSortTarget = this.noneColumn;
        }
		public void SetTarget(ShipCatalogSortTarget sortTarget, bool reverse)
		{
			var target = this.sortableColumns.FirstOrDefault(x => x.Target == sortTarget);
			if (target == null) return;

			if (reverse)
			{
				switch (target.Direction)
				{
					case SortDirection.None:
						target.Direction = SortDirection.Descending;
						break;
					case SortDirection.Descending:
						target.Direction = SortDirection.Ascending;
						break;
					case SortDirection.Ascending:
						target = this.noneColumn;
						break;
				}
			}
			else
			{
				switch (target.Direction)
				{
					case SortDirection.None:
						target.Direction = SortDirection.Ascending;
						break;
					case SortDirection.Ascending:
						target.Direction = SortDirection.Descending;
						break;
					case SortDirection.Descending:
						target = this.noneColumn;
						break;
				}
			}

			this.currentSortTarget = target;
			this.sortableColumns.Where(x => x.Target != target.Target).ForEach(x => x.Direction = SortDirection.None);
		}
		public ShipCatalogSortWorker()
		{
			this.IdColumn = new IdColumnViewModel();
			this.TypeColumn = new TypeColumnViewModel();
			this.NameColumn = new NameColumnViewModel();
			this.LevelColumn = new LevelColumnViewModel();
			this.ConditionColumn = new ConditionColumnViewModel();
			this.FirepowerColumn = new FirepowerColumnViewModel();
			this.TorpedoColumn = new TorpedoColumnViewModel();
			this.AntiAirColumn = new AntiAirColumnViewModel();
			this.ArmorColumn = new ArmorColumnViewModel();
			this.LuckColumn = new LuckColumnViewModel();
			this.ViewRangeColumn = new ViewRangeColumnViewModel();
			this.EvasionColumn = new EvasionColumnViewModel();
			this.AntiSubColumn = new AntiSubColumnViewModel();

			this.sortableColumns = new List<SortableColumnViewModel>
			{
				this.noneColumn,
				this.IdColumn,
				this.TypeColumn,
				this.NameColumn,
				this.LevelColumn,
				this.ConditionColumn,
				this.FirepowerColumn,
				this.TorpedoColumn,
				this.AntiAirColumn,
				this.ArmorColumn,
				this.LuckColumn,
				this.ViewRangeColumn,
				this.EvasionColumn,
				this.AntiSubColumn,
			};

			this.currentSortTarget = this.noneColumn;
		}
Esempio n. 6
0
        public ShipCatalogSortWorker()
        {
            this.IdColumn        = new IdColumnViewModel();
            this.TypeColumn      = new TypeColumnViewModel();
            this.NameColumn      = new NameColumnViewModel();
            this.LevelColumn     = new LevelColumnViewModel();
            this.ConditionColumn = new ConditionColumnViewModel();
            this.FirepowerColumn = new FirepowerColumnViewModel();
            this.TorpedoColumn   = new TorpedoColumnViewModel();
            this.AntiAirColumn   = new AntiAirColumnViewModel();
            this.ArmorColumn     = new ArmorColumnViewModel();
            this.LuckColumn      = new LuckColumnViewModel();
            this.ViewRangeColumn = new ViewRangeColumnViewModel();
            this.EvasionColumn   = new EvasionColumnViewModel();
            this.AntiSubColumn   = new AntiSubColumnViewModel();

            this.sortableColumns = new List <SortableColumnViewModel>
            {
                this.noneColumn,
                this.IdColumn,
                this.TypeColumn,
                this.NameColumn,
                this.LevelColumn,
                this.ConditionColumn,
                this.FirepowerColumn,
                this.TorpedoColumn,
                this.AntiAirColumn,
                this.ArmorColumn,
                this.LuckColumn,
                this.ViewRangeColumn,
                this.EvasionColumn,
                this.AntiSubColumn,
            };

            this.currentSortTarget = this.noneColumn;
        }