Exemple #1
0
        /// <summary>
        /// Initializes the view.
        /// </summary>
        /// <param name="e">The event args.</param>
        protected override void OnInitCore(EventArgs e)
        {
            this.Title = "silkveil.net | Administration | Mappings";

            XList mappingsList = new XList();
            this.Content.Controls.Add(mappingsList);

            mappingsList.DataTextField = "Name";
            mappingsList.DataNavigateUrlFormatString =
                this.GenerateLinkTo<MappingsController>() + "{0}/";

            mappingsList.DataNavigateUrlFields = new[] { "Name" };

            mappingsList.DataSource = this.MappingService.ReadMappings(this.CurrentlyLoggedOnUser);
            mappingsList.DataBind();
        }
Exemple #2
0
        /// <summary>
        /// Initializes the view.
        /// </summary>
        /// <param name="e">The event args.</param>
        protected override void OnInitCore(EventArgs e)
        {
            this.Title = "silkveil.net | Administration | Mappings";

            XList mappingsList = new XList();

            this.Content.Controls.Add(mappingsList);

            mappingsList.DataTextField = "Name";
            mappingsList.DataNavigateUrlFormatString =
                this.GenerateLinkTo <MappingsController>() + "{0}/";

            mappingsList.DataNavigateUrlFields = new[] { "Name" };

            mappingsList.DataSource = this.MappingService.ReadMappings(this.CurrentlyLoggedOnUser);
            mappingsList.DataBind();
        }
Exemple #3
0
        /// <summary>
        /// Initializes the view.
        /// </summary>
        /// <param name="e">The event args.</param>
        protected sealed override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            // Check whether the current user is allowed to enter the page. If not, redirect
            // to the logon page.
            if (this.RequiresAdministrativePrivileges && !this.CurrentlyLoggedOnUser.IsAdministrator)
            {
                this.Response.Redirect(
                    this._navigationService.GetSecurityTokenServicePath() + "Logon", true);
            }

            // Parse the master page.
            this.ParseMasterPage();

            // Call the template method.
            this.OnInitCore(e);

            // Build up the menu
            XList menu = new XList();

            menu.ActiveCssClass     = "active";
            menu.ActiveValue        = this.Request.RawUrl;
            menu.ActiveNotClickable = true;
            menu.ValueComparison    = ValueComparison.IgnoreRight;

            this.Menu.Controls.Add(menu);

            var items = new List <XListItem>
            {
                new XListItem
                {
                    Text        = "Dashboard",
                    NavigateUrl = this.GenerateLinkTo <HomeController>()
                },
                new XListItem
                {
                    Text        = "Mappings",
                    NavigateUrl =
                        this.GenerateLinkTo <MappingsController>()
                },
                new XListItem
                {
                    Text        = "Redirects",
                    NavigateUrl =
                        this.GenerateLinkTo <RedirectsController>()
                },
                new XListItem
                {
                    Text        = "ResourceController",
                    NavigateUrl = this.GenerateLinkTo <ResourcesController>(c => c.Index()),
                    Items       = new List <XListItem>()
                    {
                        new XListItem
                        {
                            Text        = "style.css",
                            NavigateUrl =
                                this.GenerateLinkTo <ResourcesController>(
                                    c => c.Index("Stylesheet.css"))
                        },
                        new XListItem
                        {
                            Text        = "MasterPage.html",
                            NavigateUrl =
                                this.GenerateLinkTo <ResourcesController>(
                                    c => c.Index("MasterPage.html"))
                        }
                    }
                }
            };

            items.ForEach(item => menu.Items.Add(item));

            menu.DataBind();

            BreadCrumb breadCrumb = new BreadCrumb
            {
                ShowStartSite = false,
                Menu          = menu,
                PreHtml       = "->",
                Seperator     = "/"
            };

            this.BreadCrumb.Controls.Add(breadCrumb);
        }