public void GetAllTimetable()
        {
            string fullPath = AppDomain.CurrentDomain.BaseDirectory + @"TimeTables\";

            if (!Directory.Exists(fullPath))
            {
                Directory.CreateDirectory(fullPath);
            }

            Console.WriteLine(fullPath);
            string[] AllFiles = Directory.GetFiles(fullPath);

            DataCollection <object> course_group = new DataCollection <object>(
                "Courses",
                "Расписание",
                DataCollection <object> .GroupType.Courses);

            int    i = 0;
            string name;

            foreach (var image in AllFiles)
            {
                switch (Path.GetFileNameWithoutExtension(image))
                {
                case "1":
                    name = "Первый курс";
                    break;

                case "2":
                    name = "Второй курс";
                    break;

                case "3":
                    name = "Третий курс";
                    break;

                case "4":
                    name = "Четвертый курс";
                    break;

                case "5":
                    name = "Первый курс магистратуры";
                    break;

                case "6":
                    name = "Второй курс магистратуры";
                    break;

                default:
                    name = "";
                    break;
                }
                course_group.Items.Add(new Page(
                                           "Course-" + i.ToString(),
                                           name,
                                           typeof(ScrollViewerSample),
                                           StringToArr(image)));

                i++;
            }

            AddToGroups(course_group);
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataItem" /> class.
 /// </summary>
 /// <param name="uniqueId">The unique id of this item.</param>
 /// <param name="title">The title of this item.</param>
 /// <param name="subtitle">The subtitle of this item.</param>
 /// <param name="imagePath">A relative path of the image for this item.</param>
 /// <param name="description">A description of this item.</param>
 /// <param name="content">The content of this item.</param>
 /// <param name="group">The group of this item.</param>
 /// <param name="navigationPage">What page should launch when clicking this item.</param>
 public DataItem(string uniqueId, string title, string subtitle, Uri imagePath, string description, string content, DataCollection group, Type navigationPage)
     : base(uniqueId, title, subtitle, imagePath, description)
 {
     this.content        = content;
     this.group          = group;
     this.navigationPage = navigationPage;
 }
Exemple #3
0
        public DataSource()
        {
            string itemContent = string.Format(
                CultureInfo.CurrentCulture,
                "Item Content: {0}\n\n{0}\n\n{0}\n\n{0}\n\n{0}\n\n{0}\n\n{0}",
                "Curabitur class aliquam vestibulum nam curae maecenas sed integer cras phasellus suspendisse quisque donec dis praesent accumsan bibendum pellentesque condimentum adipiscing etiam consequat vivamus dictumst aliquam duis convallis scelerisque est parturient ullamcorper aliquet fusce suspendisse nunc hac eleifend amet blandit facilisi condimentum commodo scelerisque faucibus aenean ullamcorper ante mauris dignissim consectetuer nullam lorem vestibulum habitant conubia elementum pellentesque morbi facilisis arcu sollicitudin diam cubilia aptent vestibulum auctor eget dapibus pellentesque inceptos leo egestas interdum nulla consectetuer suspendisse adipiscing pellentesque proin lobortis sollicitudin augue elit mus congue fermentum parturient fringilla euismod feugiat");

            var mainWindowPages = new DataCollection(
                "Group-1",
                "Group Title: MainPage Items",
                "Group Subtitle: ",
                DataSource.mediumGrayImage,
                "Series of applets that users can interact with");

            mainWindowPages.Items.Add(
                new DataItem(
                    "Group-1-Item-Weather",
                    "Weather",
                    "More Details",
                    new Uri("../Images/WeatherIcons/mostlycloudy.png", UriKind.Relative),
                    "Expanded weather information",
                    itemContent,
                    mainWindowPages,
                    typeof(WeatherPage)));
            mainWindowPages.Items.Add(
                new DataItem(
                    "Group-1-Bongo-Info",
                    "Bus Schedule",
                    "Complete Schedule",
                    new Uri("../Assets/BusLogoFront.png", UriKind.Relative),
                    "Expanded Bongo data",
                    itemContent,
                    mainWindowPages,
                    typeof(BongoPage)));
            mainWindowPages.Items.Add(
                new DataItem(
                    "Group-1-CS-Events",
                    "News & Events",
                    string.Empty,
                    new Uri("../Assets/newsIcon.png", UriKind.Relative),
                    "CS Events, CS News, and Today's Headlines",
                    itemContent,
                    mainWindowPages,
                    typeof(CSEvents)));
            mainWindowPages.Items.Add(
                new DataItem(
                    "Group-1-People",
                    "People",
                    "List of Faculty",
                    new Uri("../Assets/people Icon.png", UriKind.Relative),
                    "List of faculty members",
                    itemContent,
                    mainWindowPages,
                    typeof(PeoplePage)));
            mainWindowPages.Items.Add(
                new DataItem(
                    "Group-1-Maps",
                    "Building Map",
                    string.Empty,
                    new Uri("../Assets/mapIcon.png", UriKind.Relative),
                    "Map of building",
                    itemContent,
                    mainWindowPages,
                    typeof(MapsPage)));

            this.AllGroups.Add(mainWindowPages);
        }
Exemple #4
0
 public DataItem(DotNetWikiBot.Page page, DataCollection group)
     : base(page)
 {
     this.group = group;
     this.page  = page;
 }