コード例 #1
0
        protected List <GroupForUser> GetModel()
        {
            var languageId = WebSettingsConfig.Instance.GetLanguageFromId();

            IGroupsQuery        groupsQuery = new GroupsQuery(languageId);
            List <GroupForUser> groups      = groupsQuery.GetVisibleGroups(GroupType);
            var sorter = new GroupsSorter(HttpContext.Request.Cookies);

            sorter.Sort(groups);
            return(groups);
        }
コード例 #2
0
ファイル: ModuleModel.cs プロジェクト: Ulexite/ACadPrint
        public ModuleModel()
        {
            //TODO: inject logger!
            //DI is for Dependency injection!
            sheets       = new SheetCache();
            destinations = new DestinationStorage();
            //TODO:Конфигурация!
            sorter = new GroupsSorter <Sheet>("Формат");
            PropertiesExractor propertiesExractor = new PropertiesExractor();

            sheetExtractor        = new SheetsExtractor(propertiesExractor, new SheetCreator(new BoundsCalculator()));
            destinationsExtractor = new DestinationsExtractor(propertiesExractor, new DestinationCreator());
        }
コード例 #3
0
        public ActionResult Index()
        {
            if (WebSettingsConfig.Instance.IsSectionForbidden(SectionId.FillDifference))
            {
                return(RedirectToAction("Index", RouteConfig.MAIN_CONTROLLER_NAME));
            }

            var languageId = WebSettingsConfig.Instance.GetLanguageFromId();

            var comparisonsQuery = new ComparisonsQuery(languageId);
            List <ComparisonForUser> comparisons = comparisonsQuery.GetVisibleWithoutRules();
            var sorter = new GroupsSorter(HttpContext.Request.Cookies);

            sorter.Sort(comparisons);

            return(View(comparisons));
        }
コード例 #4
0
        public ActionResult Index(VideoType type)
        {
            if (WebSettingsConfig.Instance.IsSectionForbidden(SectionId.Video))
            {
                return(RedirectToAction("Index", RouteConfig.MAIN_CONTROLLER_NAME));
            }

            IVideosQuery        videosQuery = GetVideosQuery();
            List <VideoForUser> videos      = videosQuery.GetVisible(type);

            var sorter = new GroupsSorter(HttpContext.Request.Cookies);

            sorter.Sort(videos);

            List <GroupForUser> convertedVideos =
                videos.Select(e => new GroupForUser(e.Id, e.Title, e.HasImage)).ToList();

            return(View(convertedVideos));
        }
コード例 #5
0
        public ActionResult Index()
        {
            if (WebSettingsConfig.Instance.IsSectionForbidden(SectionId.VisualDictionary))
            {
                return(RedirectToAction("Index", RouteConfig.MAIN_CONTROLLER_NAME));
            }

            long languageId = WebSettingsConfig.Instance.GetLanguageFromId();

            var representationsQuery = new RepresentationsQuery(languageId);
            List <RepresentationForUser> representations = representationsQuery.GetVisibleWithoutAreas();
            var sorter = new GroupsSorter(HttpContext.Request.Cookies);

            sorter.Sort(representations);

            List <GroupForUser> convertedRepresentations =
                representations.Select(e => new GroupForUser(e.Id, e.Title, true)).ToList();

            return(View(convertedRepresentations));
        }
コード例 #6
0
 public List <Tuple <int, string, bool> > GetItems()
 {
     return(GroupsSorter.GetTypes(HttpContext.Current.Request.Cookies));
 }
コード例 #7
0
ファイル: SheetsGroupTree.cs プロジェクト: Ulexite/ACadPrint
 public SheetsGroupTree(string groupBy, SheetTreeNodeCache nodeCache)
 {
     this.sorter    = new GroupsSorter <SheetTreeNode>(groupBy);
     this.nodeCache = nodeCache;
 }